LLVM 24.0.0git
MipsAsmBackend.h
Go to the documentation of this file.
1//===-- MipsAsmBackend.h - Mips 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// This file defines the MipsAsmBackend class.
10//
11//===----------------------------------------------------------------------===//
12//
13
14#ifndef LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSASMBACKEND_H
15#define LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSASMBACKEND_H
16
20
21namespace llvm {
22
23struct MCFixupKindInfo;
24class MCRegisterInfo;
25class Target;
26
28 Triple TheTriple;
29 bool IsN32;
30
31public:
32 MipsAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT,
33 StringRef CPU, bool N32)
34 : MCAsmBackend(TT.isLittleEndian() ? llvm::endianness::little
35 : llvm::endianness::big),
36 TheTriple(TT), IsN32(N32) {}
37
38 std::unique_ptr<MCObjectTargetWriter>
39 createObjectTargetWriter() const override;
40
41 void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target,
42 uint8_t *Data, uint64_t Value, bool IsResolved) override;
43
44 std::optional<MCFixupKind> getFixupKind(StringRef Name) const override;
45 MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override;
46
48 const MCSubtargetInfo &STI) const override;
50 const MCValue &, uint64_t,
51 bool) const override;
52 void relaxInstruction(MCInst &Inst,
53 const MCSubtargetInfo &STI) const override;
54
56 const MCSubtargetInfo *STI) const override;
57}; // class MipsAsmBackend
58
59} // namespace
60
61#endif
uint64_t uint64_t
#define T
MachineRegisterInfo & MRI
SI Fold Operands
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
MCAsmBackend(llvm::endianness Endian)
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition MCFixup.h:65
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:187
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Generic base class for all target subtargets.
void relaxInstruction(MCInst &Inst, const MCSubtargetInfo &STI) const override
Relax the instruction in the given fragment to the next wider instruction.
bool writeNopData(raw_ostream &OS, uint64_t Count, const MCSubtargetInfo *STI) const override
WriteNopData - Write an (optimal) nop sequence of Count bytes to the given output.
bool fixupNeedsRelaxationAdvanced(const MCFragment &, const MCFixup &, const MCValue &, uint64_t, bool) const override
Target specific predicate for whether a given fixup requires the associated instruction to be relaxed...
bool mayNeedRelaxation(unsigned Opcode, ArrayRef< MCOperand > Operands, const MCSubtargetInfo &STI) const override
Check whether the given instruction (encoded as Opcode+Operands) may need relaxation.
MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override
Get information on a fixup kind.
std::optional< MCFixupKind > getFixupKind(StringRef Name) const override
Map a relocation name used in .reloc to a fixup kind.
void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target, uint8_t *Data, uint64_t Value, bool IsResolved) override
ApplyFixup - Apply the Value for given Fixup into the provided data fragment, at the offset specified...
std::unique_ptr< MCObjectTargetWriter > createObjectTargetWriter() const override
MipsAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU, bool N32)
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
LLVM Value Representation.
Definition Value.h:75
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
uint16_t MCFixupKind
Extensible enumeration to represent the type of a fixup.
Definition MCFixup.h:22
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
Definition InstrProf.h:145
endianness
Definition bit.h:71
Target independent information on a fixup kind.