LLVM  5.0.0
HexagonMCELFStreamer.h
Go to the documentation of this file.
1 //===- HexagonMCELFStreamer.h - Hexagon subclass of MCElfStreamer ---------===//
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 #ifndef LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCELFSTREAMER_H
11 #define LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCELFSTREAMER_H
12 
14 #include "llvm/MC/MCELFStreamer.h"
15 #include "llvm/MC/MCInstrInfo.h"
16 #include <cstdint>
17 #include <memory>
18 
19 namespace llvm {
20 
22  std::unique_ptr<MCInstrInfo> MCII;
23 
24 public:
26  raw_pwrite_stream &OS, MCCodeEmitter *Emitter)
27  : MCELFStreamer(Context, TAB, OS, Emitter),
28  MCII(createHexagonMCInstrInfo()) {}
29 
31  MCAsmBackend &TAB,
32  raw_pwrite_stream &OS, MCCodeEmitter *Emitter,
33  MCAssembler *Assembler) :
34  MCELFStreamer(Context, TAB, OS, Emitter),
35  MCII (createHexagonMCInstrInfo()) {}
36 
37  void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI,
38  bool) override;
39  void EmitSymbol(const MCInst &Inst);
41  unsigned ByteAlignment,
42  unsigned AccessSize);
44  unsigned ByteAlignment, unsigned AccessSize);
45 };
46 
47 MCStreamer *createHexagonELFStreamer(Triple const &TT, MCContext &Context,
48  MCAsmBackend &MAB, raw_pwrite_stream &OS,
49  MCCodeEmitter *CE);
50 
51 } // end namespace llvm
52 
53 #endif // LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCELFSTREAMER_H
LLVMContext & Context
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, bool) override
Emit the given Instruction into the current section.
MCStreamer * createHexagonELFStreamer(Triple const &TT, MCContext &Context, MCAsmBackend &MAB, raw_pwrite_stream &OS, MCCodeEmitter *CE)
Context object for machine code objects.
Definition: MCContext.h:59
MCInstrInfo * createHexagonMCInstrInfo()
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:159
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:22
void HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, unsigned AccessSize)
HexagonMCELFStreamer(MCContext &Context, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter, MCAssembler *Assembler)
void EmitSymbol(const MCInst &Inst)
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
MCSubtargetInfo - Generic base class for all target subtargets.
An abstract base class for streams implementations that also support a pwrite operation.
Definition: raw_ostream.h:333
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:35
HexagonMCELFStreamer(MCContext &Context, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter)
void HexagonMCEmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, unsigned AccessSize)