[PowerPC] Do not emit record-form rotates when record-form andi/andis suffices
[llvm-core.git] / lib / Target / AVR / MCTargetDesc / AVRAsmBackend.h
blobd48077c3ab8ef3b9aae58060aa1242603a136637
1 //===-- AVRAsmBackend.h - AVR Asm Backend --------------------------------===//
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 // \file The AVR assembly backend implementation.
12 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_AVR_ASM_BACKEND_H
16 #define LLVM_AVR_ASM_BACKEND_H
18 #include "MCTargetDesc/AVRFixupKinds.h"
20 #include "llvm/ADT/Triple.h"
21 #include "llvm/MC/MCAsmBackend.h"
23 namespace llvm {
25 class MCAssembler;
26 class MCObjectWriter;
27 class Target;
29 struct MCFixupKindInfo;
31 /// Utilities for manipulating generated AVR machine code.
32 class AVRAsmBackend : public MCAsmBackend {
33 public:
34 AVRAsmBackend(Triple::OSType OSType)
35 : MCAsmBackend(support::little), OSType(OSType) {}
37 void adjustFixupValue(const MCFixup &Fixup, const MCValue &Target,
38 uint64_t &Value, MCContext *Ctx = nullptr) const;
40 std::unique_ptr<MCObjectTargetWriter>
41 createObjectTargetWriter() const override;
43 void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
44 const MCValue &Target, MutableArrayRef<char> Data,
45 uint64_t Value, bool IsResolved,
46 const MCSubtargetInfo *STI) const override;
48 const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const override;
50 unsigned getNumFixupKinds() const override {
51 return AVR::NumTargetFixupKinds;
54 bool mayNeedRelaxation(const MCInst &Inst,
55 const MCSubtargetInfo &STI) const override {
56 return false;
59 bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
60 const MCRelaxableFragment *DF,
61 const MCAsmLayout &Layout) const override {
62 llvm_unreachable("RelaxInstruction() unimplemented");
63 return false;
66 void relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI,
67 MCInst &Res) const override {}
69 bool writeNopData(raw_ostream &OS, uint64_t Count) const override;
71 bool shouldForceRelocation(const MCAssembler &Asm, const MCFixup &Fixup,
72 const MCValue &Target) override;
74 private:
75 Triple::OSType OSType;
78 } // end namespace llvm
80 #endif // LLVM_AVR_ASM_BACKEND_H