Home | History | Annotate | Download | only in MCTargetDesc
      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 HEXAGONMCELFSTREAMER_H
     11 #define HEXAGONMCELFSTREAMER_H
     12 
     13 #include "MCTargetDesc/HexagonMCCodeEmitter.h"
     14 #include "MCTargetDesc/HexagonMCInstrInfo.h"
     15 #include "MCTargetDesc/HexagonMCTargetDesc.h"
     16 #include "llvm/MC/MCELFStreamer.h"
     17 #include "HexagonTargetStreamer.h"
     18 
     19 namespace llvm {
     20 
     21 class HexagonMCELFStreamer : public MCELFStreamer {
     22   std::unique_ptr<MCInstrInfo> MCII;
     23 
     24 public:
     25   HexagonMCELFStreamer(MCContext &Context, MCAsmBackend &TAB,
     26                        raw_pwrite_stream &OS, MCCodeEmitter *Emitter)
     27       : MCELFStreamer(Context, TAB, OS, Emitter),
     28         MCII(createHexagonMCInstrInfo()) {}
     29 
     30   virtual void EmitInstruction(const MCInst &Inst,
     31                                const MCSubtargetInfo &STI) override;
     32   void EmitSymbol(const MCInst &Inst);
     33   void HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
     34                                       unsigned ByteAlignment,
     35                                       unsigned AccessSize);
     36   void HexagonMCEmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
     37                                  unsigned ByteAlignment, unsigned AccessSize);
     38 };
     39 
     40 MCStreamer *createHexagonELFStreamer(MCContext &Context, MCAsmBackend &MAB,
     41                                      raw_pwrite_stream &OS, MCCodeEmitter *CE);
     42 
     43 } // namespace llvm
     44 
     45 #endif
     46