LLVM  9.0.0svn
ARMWinCOFFStreamer.cpp
Go to the documentation of this file.
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 
9 #include "ARMMCTargetDesc.h"
10 #include "llvm/MC/MCAsmBackend.h"
11 #include "llvm/MC/MCCodeEmitter.h"
12 #include "llvm/MC/MCObjectWriter.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,
22  std::unique_ptr<MCObjectWriter> OW)
23  : MCWinCOFFStreamer(C, std::move(AB), std::move(CE), std::move(OW)) {}
24 
25  void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
26  void EmitThumbFunc(MCSymbol *Symbol) override;
27  void FinishImpl() override;
28 };
29 
30 void ARMWinCOFFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
31  switch (Flag) {
32  default: llvm_unreachable("not implemented");
33  case MCAF_SyntaxUnified:
34  case MCAF_Code16:
35  break;
36  }
37 }
38 
39 void ARMWinCOFFStreamer::EmitThumbFunc(MCSymbol *Symbol) {
40  getAssembler().setIsThumbFunc(Symbol);
41 }
42 
43 void ARMWinCOFFStreamer::FinishImpl() {
44  EmitFrames(nullptr);
45 
47 }
48 }
49 
51  MCContext &Context, std::unique_ptr<MCAsmBackend> &&MAB,
52  std::unique_ptr<MCObjectWriter> &&OW,
53  std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll,
54  bool IncrementalLinkerCompatible) {
55  auto *S = new ARMWinCOFFStreamer(Context, std::move(MAB), std::move(Emitter),
56  std::move(OW));
57  S->getAssembler().setIncrementalLinkerCompatible(IncrementalLinkerCompatible);
58  return S;
59 }
60 
uint64_t CallInst * C
void FinishImpl() override
Streamer specific finalization.
LLVMContext & Context
This class represents lattice values for constants.
Definition: AllocatorList.h:23
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
Definition: BitVector.h:937
Context object for machine code objects.
Definition: MCContext.h:62
.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:117
Streaming machine code generation interface.
Definition: MCStreamer.h:188
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