blob: 398b409f4586dc5d170f1f4b035ccde360c87de5 [file] [log] [blame]
Dylan McKayba233432017-12-09 08:01:28 +00001//===--------- 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
20namespace llvm {
21
22const int SIZE_LONG = 4;
23const int SIZE_WORD = 2;
24
25class AVRMCELFStreamer : public MCELFStreamer {
26 std::unique_ptr<MCInstrInfo> MCII;
27
28public:
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
47MCStreamer *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