1 //===--------- AVRMCELFStreamer.h - AVR subclass of MCELFStreamer ---------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H
11 #define LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H
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"
23 const int SIZE_LONG = 4;
24 const int SIZE_WORD = 2;
26 class AVRMCELFStreamer : public MCELFStreamer {
27 std::unique_ptr<MCInstrInfo> MCII;
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),
35 MCII(createAVRMCInstrInfo()) {}
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),
43 MCII(createAVRMCInstrInfo()) {}
45 void EmitValueForModiferKind(
46 const MCSymbol *Sym, unsigned SizeInBytes, SMLoc Loc = SMLoc(),
47 AVRMCExpr::VariantKind ModifierKind = AVRMCExpr::VK_AVR_None);
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);
55 } // end namespace llvm
57 #endif // LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H