1 //===--------- AVRMCELFStreamer.h - AVR 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_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H 11 #define LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H 12 13 #include "MCTargetDesc/AVRMCExpr.h" 14 #include "MCTargetDesc/AVRMCTargetDesc.h" 15 #include "llvm/MC/MCAsmBackend.h" 16 #include "llvm/MC/MCCodeEmitter.h" 17 #include "llvm/MC/MCELFStreamer.h" 18 #include "llvm/MC/MCInstrInfo.h" 19 #include "llvm/MC/MCObjectWriter.h" 20 21 namespace llvm { 22 23 const int SIZE_LONG = 4; 24 const int SIZE_WORD = 2; 25 26 class AVRMCELFStreamer : public MCELFStreamer { 27 std::unique_ptr<MCInstrInfo> MCII; 28 29 public: AVRMCELFStreamer(MCContext & Context,std::unique_ptr<MCAsmBackend> TAB,std::unique_ptr<MCObjectWriter> OW,std::unique_ptr<MCCodeEmitter> Emitter)30 AVRMCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB, 31 std::unique_ptr<MCObjectWriter> OW, 32 std::unique_ptr<MCCodeEmitter> Emitter) 33 : MCELFStreamer(Context, std::move(TAB), std::move(OW), 34 std::move(Emitter)), 35 MCII(createAVRMCInstrInfo()) {} 36 AVRMCELFStreamer(MCContext & Context,std::unique_ptr<MCAsmBackend> TAB,std::unique_ptr<MCObjectWriter> OW,std::unique_ptr<MCCodeEmitter> Emitter,MCAssembler * Assembler)37 AVRMCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB, 38 std::unique_ptr<MCObjectWriter> OW, 39 std::unique_ptr<MCCodeEmitter> Emitter, 40 MCAssembler *Assembler) 41 : MCELFStreamer(Context, std::move(TAB), std::move(OW), 42 std::move(Emitter)), 43 MCII(createAVRMCInstrInfo()) {} 44 45 void EmitValueForModiferKind( 46 const MCSymbol *Sym, unsigned SizeInBytes, SMLoc Loc = SMLoc(), 47 AVRMCExpr::VariantKind ModifierKind = AVRMCExpr::VK_AVR_None); 48 }; 49 50 MCStreamer *createAVRELFStreamer(Triple const &TT, MCContext &Context, 51 std::unique_ptr<MCAsmBackend> MAB, 52 std::unique_ptr<MCObjectWriter> OW, 53 std::unique_ptr<MCCodeEmitter> CE); 54 55 } // end namespace llvm 56 57 #endif // LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H 58