xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AVR/MCTargetDesc/AVRMCELFStreamer.h (revision e25152834cdf3b353892835a4f3b157e066a8ed4)
10b57cec5SDimitry Andric //===--------- AVRMCELFStreamer.h - AVR subclass of MCELFStreamer ---------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H
100b57cec5SDimitry Andric #define LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H
110b57cec5SDimitry Andric 
120b57cec5SDimitry Andric #include "MCTargetDesc/AVRMCExpr.h"
130b57cec5SDimitry Andric #include "MCTargetDesc/AVRMCTargetDesc.h"
140b57cec5SDimitry Andric #include "llvm/MC/MCAsmBackend.h"
150b57cec5SDimitry Andric #include "llvm/MC/MCCodeEmitter.h"
160b57cec5SDimitry Andric #include "llvm/MC/MCELFStreamer.h"
170b57cec5SDimitry Andric #include "llvm/MC/MCInstrInfo.h"
180b57cec5SDimitry Andric #include "llvm/MC/MCObjectWriter.h"
190b57cec5SDimitry Andric 
200b57cec5SDimitry Andric namespace llvm {
210b57cec5SDimitry Andric 
220b57cec5SDimitry Andric const int SIZE_LONG = 4;
230b57cec5SDimitry Andric const int SIZE_WORD = 2;
240b57cec5SDimitry Andric 
250b57cec5SDimitry Andric class AVRMCELFStreamer : public MCELFStreamer {
260b57cec5SDimitry Andric   std::unique_ptr<MCInstrInfo> MCII;
270b57cec5SDimitry Andric 
280b57cec5SDimitry Andric public:
AVRMCELFStreamer(MCContext & Context,std::unique_ptr<MCAsmBackend> TAB,std::unique_ptr<MCObjectWriter> OW,std::unique_ptr<MCCodeEmitter> Emitter)290b57cec5SDimitry Andric   AVRMCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
300b57cec5SDimitry Andric                    std::unique_ptr<MCObjectWriter> OW,
310b57cec5SDimitry Andric                    std::unique_ptr<MCCodeEmitter> Emitter)
320b57cec5SDimitry Andric       : MCELFStreamer(Context, std::move(TAB), std::move(OW),
330b57cec5SDimitry Andric                       std::move(Emitter)),
340b57cec5SDimitry Andric         MCII(createAVRMCInstrInfo()) {}
350b57cec5SDimitry Andric 
AVRMCELFStreamer(MCContext & Context,std::unique_ptr<MCAsmBackend> TAB,std::unique_ptr<MCObjectWriter> OW,std::unique_ptr<MCCodeEmitter> Emitter,MCAssembler * Assembler)360b57cec5SDimitry Andric   AVRMCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
370b57cec5SDimitry Andric                    std::unique_ptr<MCObjectWriter> OW,
380b57cec5SDimitry Andric                    std::unique_ptr<MCCodeEmitter> Emitter,
390b57cec5SDimitry Andric                    MCAssembler *Assembler)
400b57cec5SDimitry Andric       : MCELFStreamer(Context, std::move(TAB), std::move(OW),
410b57cec5SDimitry Andric                       std::move(Emitter)),
420b57cec5SDimitry Andric         MCII(createAVRMCInstrInfo()) {}
430b57cec5SDimitry Andric 
44*5ffd83dbSDimitry Andric   void emitValueForModiferKind(
450b57cec5SDimitry Andric       const MCSymbol *Sym, unsigned SizeInBytes, SMLoc Loc = SMLoc(),
460b57cec5SDimitry Andric       AVRMCExpr::VariantKind ModifierKind = AVRMCExpr::VK_AVR_None);
470b57cec5SDimitry Andric };
480b57cec5SDimitry Andric 
490b57cec5SDimitry Andric MCStreamer *createAVRELFStreamer(Triple const &TT, MCContext &Context,
500b57cec5SDimitry Andric                                  std::unique_ptr<MCAsmBackend> MAB,
510b57cec5SDimitry Andric                                  std::unique_ptr<MCObjectWriter> OW,
520b57cec5SDimitry Andric                                  std::unique_ptr<MCCodeEmitter> CE);
530b57cec5SDimitry Andric 
540b57cec5SDimitry Andric } // end namespace llvm
550b57cec5SDimitry Andric 
560b57cec5SDimitry Andric #endif // LLVM_LIB_TARGET_AVR_MCTARGETDESC_AVRMCELFSTREAMER_H
57