LLVM  4.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 
30  void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
31  void EmitSymbol(const MCInst &Inst);
32  void HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
33  unsigned ByteAlignment,
34  unsigned AccessSize);
35  void HexagonMCEmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
36  unsigned ByteAlignment, unsigned AccessSize);
37 };
38 
39 MCStreamer *createHexagonELFStreamer(MCContext &Context, MCAsmBackend &MAB,
40  raw_pwrite_stream &OS, MCCodeEmitter *CE);
41 
42 } // end namespace llvm
43 
44 #endif // LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCELFSTREAMER_H
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
LLVMContext & Context
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
Context object for machine code objects.
Definition: MCContext.h:51
MCInstrInfo * createHexagonMCInstrInfo()
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:150
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:23
void HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, unsigned AccessSize)
void EmitSymbol(const MCInst &Inst)
MCStreamer * createHexagonELFStreamer(MCContext &Context, MCAsmBackend &MAB, raw_pwrite_stream &OS, MCCodeEmitter *CE)
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:36
HexagonMCELFStreamer(MCContext &Context, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter)
void HexagonMCEmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, unsigned AccessSize)