LLVM  4.0.0
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"
12 
13 using namespace llvm;
14 
15 namespace {
16 class ARMWinCOFFStreamer : public MCWinCOFFStreamer {
17 public:
18  ARMWinCOFFStreamer(MCContext &C, MCAsmBackend &AB, MCCodeEmitter &CE,
20  : MCWinCOFFStreamer(C, AB, CE, OS) {}
21 
22  void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
23  void EmitThumbFunc(MCSymbol *Symbol) override;
24 };
25 
26 void ARMWinCOFFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
27  switch (Flag) {
28  default: llvm_unreachable("not implemented");
29  case MCAF_SyntaxUnified:
30  case MCAF_Code16:
31  break;
32  }
33 }
34 
35 void ARMWinCOFFStreamer::EmitThumbFunc(MCSymbol *Symbol) {
36  getAssembler().setIsThumbFunc(Symbol);
37 }
38 }
39 
42  MCCodeEmitter *Emitter, bool RelaxAll, bool IncrementalLinkerCompatible) {
43  auto *S = new ARMWinCOFFStreamer(Context, MAB, *Emitter, OS);
44  S->getAssembler().setIncrementalLinkerCompatible(IncrementalLinkerCompatible);
45  return S;
46 }
47 
LLVMContext & Context
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
MCStreamer * createARMWinCOFFStreamer(MCContext &Context, MCAsmBackend &MAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter, bool RelaxAll, bool IncrementalLinkerCompatible)
Context object for machine code objects.
Definition: MCContext.h:51
.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:161
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:23
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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"))
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
.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:333
cl::opt< bool > RelaxAll("mc-relax-all", cl::desc("When used with filetype=obj, ""relax all fixups in the emitted object file"))
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:36