59 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8//9// \file The AVR assembly backend implementation.10//11//===----------------------------------------------------------------------===//12//13 14#ifndef LLVM_AVR_ASM_BACKEND_H15#define LLVM_AVR_ASM_BACKEND_H16 17#include "MCTargetDesc/AVRFixupKinds.h"18 19#include "llvm/MC/MCAsmBackend.h"20#include "llvm/TargetParser/Triple.h"21 22namespace llvm {23 24class MCAssembler;25class MCContext;26struct MCFixupKindInfo;27 28/// Utilities for manipulating generated AVR machine code.29class AVRAsmBackend : public MCAsmBackend {30public:31 AVRAsmBackend(Triple::OSType OSType)32 : MCAsmBackend(llvm::endianness::little), OSType(OSType) {}33 34 void adjustFixupValue(const MCFixup &Fixup, const MCValue &Target,35 uint64_t &Value, MCContext *Ctx = nullptr) const;36 37 std::unique_ptr<MCObjectTargetWriter>38 createObjectTargetWriter() const override;39 40 void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target,41 uint8_t *Data, uint64_t Value, bool IsResolved) override;42 43 std::optional<MCFixupKind> getFixupKind(StringRef Name) const override;44 MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override;45 46 bool writeNopData(raw_ostream &OS, uint64_t Count,47 const MCSubtargetInfo *STI) const override;48 49 bool forceRelocation(const MCFragment &F, const MCFixup &Fixup,50 const MCValue &Target);51 52private:53 Triple::OSType OSType;54};55 56} // end namespace llvm57 58#endif // LLVM_AVR_ASM_BACKEND_H59