Recommit r373598 "[yaml2obj/obj2yaml] - Add support for SHT_LLVM_ADDRSIG sections."
[llvm-complete.git] / lib / Target / AVR / MCTargetDesc / AVRMCELFStreamer.h
blob37a610bc4248fab86d1d210c2dba7611d2257ef8
1 //===--------- AVRMCELFStreamer.h - AVR subclass of MCELFStreamer ---------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H
10 #define LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H
12 #include "MCTargetDesc/AVRMCExpr.h"
13 #include "MCTargetDesc/AVRMCTargetDesc.h"
14 #include "llvm/MC/MCAsmBackend.h"
15 #include "llvm/MC/MCCodeEmitter.h"
16 #include "llvm/MC/MCELFStreamer.h"
17 #include "llvm/MC/MCInstrInfo.h"
18 #include "llvm/MC/MCObjectWriter.h"
20 namespace llvm {
22 const int SIZE_LONG = 4;
23 const int SIZE_WORD = 2;
25 class AVRMCELFStreamer : public MCELFStreamer {
26 std::unique_ptr<MCInstrInfo> MCII;
28 public:
29 AVRMCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
30 std::unique_ptr<MCObjectWriter> OW,
31 std::unique_ptr<MCCodeEmitter> Emitter)
32 : MCELFStreamer(Context, std::move(TAB), std::move(OW),
33 std::move(Emitter)),
34 MCII(createAVRMCInstrInfo()) {}
36 AVRMCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
37 std::unique_ptr<MCObjectWriter> OW,
38 std::unique_ptr<MCCodeEmitter> Emitter,
39 MCAssembler *Assembler)
40 : MCELFStreamer(Context, std::move(TAB), std::move(OW),
41 std::move(Emitter)),
42 MCII(createAVRMCInstrInfo()) {}
44 void EmitValueForModiferKind(
45 const MCSymbol *Sym, unsigned SizeInBytes, SMLoc Loc = SMLoc(),
46 AVRMCExpr::VariantKind ModifierKind = AVRMCExpr::VK_AVR_None);
49 MCStreamer *createAVRELFStreamer(Triple const &TT, MCContext &Context,
50 std::unique_ptr<MCAsmBackend> MAB,
51 std::unique_ptr<MCObjectWriter> OW,
52 std::unique_ptr<MCCodeEmitter> CE);
54 } // end namespace llvm
56 #endif // LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H