LLVM  6.0.0svn
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"
14 
15 using namespace llvm;
16 
17 namespace {
18 class ARMWinCOFFStreamer : public MCWinCOFFStreamer {
19 public:
20  ARMWinCOFFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> AB,
21  std::unique_ptr<MCCodeEmitter> CE, raw_pwrite_stream &OS)
22  : MCWinCOFFStreamer(C, std::move(AB), std::move(CE), OS) {}
23 
24  void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
25  void EmitThumbFunc(MCSymbol *Symbol) override;
26  void FinishImpl() override;
27 };
28 
29 void ARMWinCOFFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
30  switch (Flag) {
31  default: llvm_unreachable("not implemented");
32  case MCAF_SyntaxUnified:
33  case MCAF_Code16:
34  break;
35  }
36 }
37 
38 void ARMWinCOFFStreamer::EmitThumbFunc(MCSymbol *Symbol) {
39  getAssembler().setIsThumbFunc(Symbol);
40 }
41 
42 void ARMWinCOFFStreamer::FinishImpl() {
43  EmitFrames(nullptr);
44 
46 }
47 }
48 
50  MCContext &Context, std::unique_ptr<MCAsmBackend> &&MAB,
51  raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> &&Emitter,
52  bool RelaxAll, bool IncrementalLinkerCompatible) {
53  auto *S =
54  new ARMWinCOFFStreamer(Context, std::move(MAB), std::move(Emitter), OS);
55  S->getAssembler().setIncrementalLinkerCompatible(IncrementalLinkerCompatible);
56  return S;
57 }
58 
uint64_t CallInst * C
void FinishImpl() override
Streamer specific finalization.
LLVMContext & Context
Compute iterated dominance frontiers using a linear time algorithm.
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:920
Context object for machine code objects.
Definition: MCContext.h:59
.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:121
Streaming machine code generation interface.
Definition: MCStreamer.h:169
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MCStreamer * createARMWinCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > &&MAB, raw_pwrite_stream &OS, std::unique_ptr< MCCodeEmitter > &&Emitter, bool RelaxAll, bool IncrementalLinkerCompatible)
.syntax (ARM/ELF)
Definition: MCDirectives.h:49
MCAssemblerFlag
Definition: MCDirectives.h:48
An abstract base class for streams implementations that also support a pwrite operation.
Definition: raw_ostream.h:337