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 };
27 
28 void ARMWinCOFFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
29  switch (Flag) {
30  default: llvm_unreachable("not implemented");
31  case MCAF_SyntaxUnified:
32  case MCAF_Code16:
33  break;
34  }
35 }
36 
37 void ARMWinCOFFStreamer::EmitThumbFunc(MCSymbol *Symbol) {
38  getAssembler().setIsThumbFunc(Symbol);
39 }
40 }
41 
43  MCContext &Context, std::unique_ptr<MCAsmBackend> &&MAB,
44  raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> &&Emitter,
46  auto *S =
47  new ARMWinCOFFStreamer(Context, std::move(MAB), std::move(Emitter), OS);
48  S->getAssembler().setIncrementalLinkerCompatible(IncrementalLinkerCompatible);
49  return S;
50 }
51 
uint64_t CallInst * C
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
cl::opt< bool > RelaxAll("mc-relax-all", cl::desc("When used with filetype=obj, " "relax all fixups in the emitted object file"))
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:168
cl::opt< bool > IncrementalLinkerCompatible("incremental-linker-compatible", cl::desc("When used with filetype=obj, " "emit an object file which can be used with an incremental linker"))
#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