#include "MCTargetDesc/AMDGPUFixupKinds.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/TargetParser/TargetParser.h"
usingnamespacellvm;
usingnamespacellvm::AMDGPU;
namespace {
class AMDGPUAsmBackend : public MCAsmBackend { … };
}
void AMDGPUAsmBackend::relaxInstruction(MCInst &Inst,
const MCSubtargetInfo &STI) const { … }
bool AMDGPUAsmBackend::fixupNeedsRelaxation(const MCFixup &Fixup,
uint64_t Value) const { … }
bool AMDGPUAsmBackend::mayNeedRelaxation(const MCInst &Inst,
const MCSubtargetInfo &STI) const { … }
static unsigned getFixupKindNumBytes(unsigned Kind) { … }
static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
MCContext *Ctx) { … }
void AMDGPUAsmBackend::applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
const MCValue &Target,
MutableArrayRef<char> Data, uint64_t Value,
bool IsResolved,
const MCSubtargetInfo *STI) const { … }
std::optional<MCFixupKind>
AMDGPUAsmBackend::getFixupKind(StringRef Name) const { … }
const MCFixupKindInfo &AMDGPUAsmBackend::getFixupKindInfo(
MCFixupKind Kind) const { … }
bool AMDGPUAsmBackend::shouldForceRelocation(const MCAssembler &,
const MCFixup &Fixup,
const MCValue &,
const MCSubtargetInfo *STI) { … }
unsigned AMDGPUAsmBackend::getMinimumNopSize() const { … }
bool AMDGPUAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count,
const MCSubtargetInfo *STI) const { … }
namespace {
class ELFAMDGPUAsmBackend : public AMDGPUAsmBackend { … };
}
MCAsmBackend *llvm::createAMDGPUAsmBackend(const Target &T,
const MCSubtargetInfo &STI,
const MCRegisterInfo &MRI,
const MCTargetOptions &Options) { … }