LLVM  8.0.1
ARMWinCOFFStreamer.cpp
Go to the documentation of this file.
1 //===-- ARMWinCOFFStreamer.cpp - ARM Target WinCOFF Streamer ----*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "ARMMCTargetDesc.h"
11 #include "llvm/MC/MCAsmBackend.h"
12 #include "llvm/MC/MCCodeEmitter.h"
13 #include "llvm/MC/MCObjectWriter.h"
15 
16 using namespace llvm;
17 
18 namespace {
19 class ARMWinCOFFStreamer : public MCWinCOFFStreamer {
20 public:
21  ARMWinCOFFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> AB,
22  std::unique_ptr<MCCodeEmitter> CE,
23  std::unique_ptr<MCObjectWriter> OW)
24  : MCWinCOFFStreamer(C, std::move(AB), std::move(CE), std::move(OW)) {}
25 
26  void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
27  void EmitThumbFunc(MCSymbol *Symbol) override;
28  void FinishImpl() override;
29 };
30 
31 void ARMWinCOFFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
32  switch (Flag) {
33  default: llvm_unreachable("not implemented");
34  case MCAF_SyntaxUnified:
35  case MCAF_Code16:
36  break;
37  }
38 }
39 
40 void ARMWinCOFFStreamer::EmitThumbFunc(MCSymbol *Symbol) {
41  getAssembler().setIsThumbFunc(Symbol);
42 }
43 
44 void ARMWinCOFFStreamer::FinishImpl() {
45  EmitFrames(nullptr);
46 
48 }
49 }
50 
52  MCContext &Context, std::unique_ptr<MCAsmBackend> &&MAB,
53  std::unique_ptr<MCObjectWriter> &&OW,
54  std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll,
55  bool IncrementalLinkerCompatible) {
56  auto *S = new ARMWinCOFFStreamer(Context, std::move(MAB), std::move(Emitter),
57  std::move(OW));
58  S->getAssembler().setIncrementalLinkerCompatible(IncrementalLinkerCompatible);
59  return S;
60 }
61 
uint64_t CallInst * C
void FinishImpl() override
Streamer specific finalization.
LLVMContext & Context
This class represents lattice values for constants.
Definition: AllocatorList.h:24
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
Definition: BitVector.h:938
Context object for machine code objects.
Definition: MCContext.h:63
.code16 (X86) / .code 16 (ARM)
Definition: MCDirectives.h:51
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:118
Streaming machine code generation interface.
Definition: MCStreamer.h:189
MCStreamer * createARMWinCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > &&MAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter, bool RelaxAll, bool IncrementalLinkerCompatible)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
.syntax (ARM/ELF)
Definition: MCDirectives.h:49
MCAssemblerFlag
Definition: MCDirectives.h:48