ARMWinCOFFStreamer.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //===-- ARMWinCOFFStreamer.cpp - ARM Target WinCOFF Streamer ----*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "ARMMCTargetDesc.h"
  9. #include "llvm/MC/MCAsmBackend.h"
  10. #include "llvm/MC/MCCodeEmitter.h"
  11. #include "llvm/MC/MCObjectWriter.h"
  12. #include "llvm/MC/MCWinCOFFStreamer.h"
  13. using namespace llvm;
  14. namespace {
  15. class ARMWinCOFFStreamer : public MCWinCOFFStreamer {
  16. public:
  17. ARMWinCOFFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> AB,
  18. std::unique_ptr<MCCodeEmitter> CE,
  19. std::unique_ptr<MCObjectWriter> OW)
  20. : MCWinCOFFStreamer(C, std::move(AB), std::move(CE), std::move(OW)) {}
  21. void emitThumbFunc(MCSymbol *Symbol) override;
  22. void finishImpl() override;
  23. };
  24. void ARMWinCOFFStreamer::emitThumbFunc(MCSymbol *Symbol) {
  25. getAssembler().setIsThumbFunc(Symbol);
  26. }
  27. void ARMWinCOFFStreamer::finishImpl() {
  28. emitFrames(nullptr);
  29. MCWinCOFFStreamer::finishImpl();
  30. }
  31. }
  32. MCStreamer *llvm::createARMWinCOFFStreamer(
  33. MCContext &Context, std::unique_ptr<MCAsmBackend> &&MAB,
  34. std::unique_ptr<MCObjectWriter> &&OW,
  35. std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll,
  36. bool IncrementalLinkerCompatible) {
  37. auto *S = new ARMWinCOFFStreamer(Context, std::move(MAB), std::move(Emitter),
  38. std::move(OW));
  39. S->getAssembler().setIncrementalLinkerCompatible(IncrementalLinkerCompatible);
  40. return S;
  41. }