[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / llvm / lib / Target / AVR / MCTargetDesc / AVRAsmBackend.h
blob023660f0ff1408470d89736d27a090c089c9f10d
1 //===-- AVRAsmBackend.h - AVR Asm Backend --------------------------------===//
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 //===----------------------------------------------------------------------===//
8 //
9 // \file The AVR assembly backend implementation.
11 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_AVR_ASM_BACKEND_H
15 #define LLVM_AVR_ASM_BACKEND_H
17 #include "MCTargetDesc/AVRFixupKinds.h"
19 #include "llvm/MC/MCAsmBackend.h"
20 #include "llvm/TargetParser/Triple.h"
22 namespace llvm {
24 class MCAssembler;
25 class MCContext;
26 struct MCFixupKindInfo;
28 /// Utilities for manipulating generated AVR machine code.
29 class AVRAsmBackend : public MCAsmBackend {
30 public:
31 AVRAsmBackend(Triple::OSType OSType)
32 : MCAsmBackend(llvm::endianness::little), OSType(OSType) {}
34 void adjustFixupValue(const MCFixup &Fixup, const MCValue &Target,
35 uint64_t &Value, MCContext *Ctx = nullptr) const;
37 std::unique_ptr<MCObjectTargetWriter>
38 createObjectTargetWriter() const override;
40 void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
41 const MCValue &Target, MutableArrayRef<char> Data,
42 uint64_t Value, bool IsResolved,
43 const MCSubtargetInfo *STI) const override;
45 std::optional<MCFixupKind> getFixupKind(StringRef Name) const override;
46 const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const override;
48 unsigned getNumFixupKinds() const override {
49 return AVR::NumTargetFixupKinds;
52 bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
53 const MCRelaxableFragment *DF,
54 const MCAsmLayout &Layout) const override {
55 llvm_unreachable("RelaxInstruction() unimplemented");
56 return false;
59 bool writeNopData(raw_ostream &OS, uint64_t Count,
60 const MCSubtargetInfo *STI) const override;
62 bool shouldForceRelocation(const MCAssembler &Asm, const MCFixup &Fixup,
63 const MCValue &Target,
64 const MCSubtargetInfo *STI) override;
66 private:
67 Triple::OSType OSType;
70 } // end namespace llvm
72 #endif // LLVM_AVR_ASM_BACKEND_H