| Dylan McKay | ba23343 | 2017-12-09 08:01:28 +0000 | [diff] [blame] | 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 | |
| 20 | namespace llvm { |
| 21 | |
| 22 | const int SIZE_LONG = 4; |
| 23 | const int SIZE_WORD = 2; |
| 24 | |
| 25 | class AVRMCELFStreamer : public MCELFStreamer { |
| 26 | std::unique_ptr<MCInstrInfo> MCII; |
| 27 | |
| 28 | public: |
| 29 | AVRMCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB, |
| 30 | raw_pwrite_stream &OS, |
| 31 | std::unique_ptr<MCCodeEmitter> Emitter) |
| 32 | : MCELFStreamer(Context, std::move(TAB), OS, std::move(Emitter)), |
| 33 | MCII(createAVRMCInstrInfo()) {} |
| 34 | |
| 35 | AVRMCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB, |
| 36 | raw_pwrite_stream &OS, |
| 37 | std::unique_ptr<MCCodeEmitter> Emitter, |
| 38 | MCAssembler *Assembler) |
| 39 | : MCELFStreamer(Context, std::move(TAB), OS, std::move(Emitter)), |
| 40 | MCII(createAVRMCInstrInfo()) {} |
| 41 | |
| 42 | void EmitValueForModiferKind( |
| 43 | const MCSymbol *Sym, unsigned SizeInBytes, SMLoc Loc = SMLoc(), |
| 44 | AVRMCExpr::VariantKind ModifierKind = AVRMCExpr::VK_AVR_None); |
| 45 | }; |
| 46 | |
| 47 | MCStreamer *createAVRELFStreamer(Triple const &TT, MCContext &Context, |
| 48 | std::unique_ptr<MCAsmBackend> MAB, |
| 49 | raw_pwrite_stream &OS, |
| 50 | std::unique_ptr<MCCodeEmitter> CE); |
| 51 | |
| 52 | } // end namespace llvm |
| 53 | |
| 54 | #endif // LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H |