LLVM 20.0.0git
|
This represents an "assembler immediate". More...
#include "llvm/MC/MCValue.h"
Public Member Functions | |
MCValue ()=default | |
int64_t | getConstant () const |
const MCSymbolRefExpr * | getSymA () const |
const MCSymbolRefExpr * | getSymB () const |
uint32_t | getRefKind () const |
bool | isAbsolute () const |
Is this an absolute (as opposed to relocatable) value. | |
void | print (raw_ostream &OS) const |
Print the value to the stream OS . | |
void | dump () const |
Print the value to stderr. | |
MCSymbolRefExpr::VariantKind | getAccessVariant () const |
Static Public Member Functions | |
static MCValue | get (const MCSymbolRefExpr *SymA, const MCSymbolRefExpr *SymB=nullptr, int64_t Val=0, uint32_t RefKind=0) |
static MCValue | get (int64_t Val) |
This represents an "assembler immediate".
In its most general form, this can hold ":Kind:(SymbolA - SymbolB + imm64)". Not all targets supports relocations of this general form, but we need to represent this anyway.
In general both SymbolA and SymbolB will also have a modifier analogous to the top-level Kind. Current targets are not expected to make use of both though. The choice comes down to whether relocation modifiers apply to the closest symbol or the whole expression.
Note that this class must remain a simple POD value class, because we need it to live in unions etc.
|
default |
LLVM_DUMP_METHOD void MCValue::dump | ( | ) | const |
Print the value to stderr.
Definition at line 41 of file MCValue.cpp.
References llvm::dbgs(), and print().
|
inlinestatic |
Definition at line 59 of file MCValue.h.
Referenced by llvm::AArch64MCExpr::evaluateAsRelocatableImpl(), llvm::AArch64AuthMCExpr::evaluateAsRelocatableImpl(), llvm::AMDGPUMCExpr::evaluateAsRelocatableImpl(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::LanaiMCExpr::evaluateAsRelocatableImpl(), llvm::LoongArchMCExpr::evaluateAsRelocatableImpl(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), llvm::RISCVMCExpr::evaluateAsRelocatableImpl(), llvm::SystemZMCExpr::evaluateAsRelocatableImpl(), llvm::VEMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), evaluateSymbolicAdd(), llvm::LoongArchAsmBackend::handleAddSubRelocations(), llvm::RISCVAsmBackend::handleAddSubRelocations(), llvm::LoongArchAsmBackend::shouldInsertFixupForCodeAlign(), and llvm::RISCVAsmBackend::shouldInsertFixupForCodeAlign().
|
inlinestatic |
MCSymbolRefExpr::VariantKind MCValue::getAccessVariant | ( | ) | const |
Definition at line 46 of file MCValue.cpp.
References A, B, getSymA(), getSymB(), llvm_unreachable, and llvm::MCSymbolRefExpr::VK_None.
|
inline |
Definition at line 43 of file MCValue.h.
Referenced by llvm::MCObjectStreamer::emitRelocDirective(), llvm::AArch64MCExpr::evaluateAsRelocatableImpl(), llvm::AArch64AuthMCExpr::evaluateAsRelocatableImpl(), llvm::AMDGPUMCExpr::evaluateAsRelocatableImpl(), llvm::LanaiMCExpr::evaluateAsRelocatableImpl(), llvm::LoongArchMCExpr::evaluateAsRelocatableImpl(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::RISCVMCExpr::evaluateAsRelocatableImpl(), llvm::SystemZMCExpr::evaluateAsRelocatableImpl(), llvm::VEMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::RISCVAsmBackend::evaluateTargetFixup(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::AArch64_ELFTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::ARMElfTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::RISCVELFTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::X86_64MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::X86_64ELFTargetObjectFile::getIndirectSymViaGOTPCRel(), getNode(), getOffsetAndDataFragment(), handleIndirectSymViaGOTPCRel(), and print().
|
inline |
Definition at line 46 of file MCValue.h.
Referenced by llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), and print().
|
inline |
Definition at line 44 of file MCValue.h.
Referenced by llvm::MCObjectStreamer::emitRelocDirective(), llvm::AArch64MCExpr::evaluateAsRelocatableImpl(), llvm::AArch64AuthMCExpr::evaluateAsRelocatableImpl(), llvm::CSKYMCExpr::evaluateAsRelocatableImpl(), llvm::LanaiMCExpr::evaluateAsRelocatableImpl(), llvm::LoongArchMCExpr::evaluateAsRelocatableImpl(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::RISCVMCExpr::evaluateAsRelocatableImpl(), llvm::SystemZMCExpr::evaluateAsRelocatableImpl(), llvm::VEMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::RISCVAsmBackend::evaluateTargetFixup(), getAccessVariant(), getOffsetAndDataFragment(), llvm::RISCVMCExpr::getPCRelHiFixup(), handleIndirectSymViaGOTPCRel(), print(), and llvm::ELFObjectWriter::shouldRelocateWithSymbol().
|
inline |
Definition at line 45 of file MCValue.h.
Referenced by llvm::MCObjectStreamer::emitRelocDirective(), llvm::AArch64MCExpr::evaluateAsRelocatableImpl(), llvm::AArch64AuthMCExpr::evaluateAsRelocatableImpl(), llvm::CSKYMCExpr::evaluateAsRelocatableImpl(), llvm::LanaiMCExpr::evaluateAsRelocatableImpl(), llvm::LoongArchMCExpr::evaluateAsRelocatableImpl(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::RISCVMCExpr::evaluateAsRelocatableImpl(), llvm::SystemZMCExpr::evaluateAsRelocatableImpl(), llvm::VEMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::RISCVAsmBackend::evaluateTargetFixup(), getAccessVariant(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), getOffsetAndDataFragment(), handleIndirectSymViaGOTPCRel(), and print().
|
inline |
Is this an absolute (as opposed to relocatable) value.
Definition at line 49 of file MCValue.h.
Referenced by llvm::DelayedMCExprs::assignDocNode(), llvm::MCObjectStreamer::emitRelocDirective(), llvm::AMDGPUMCExpr::evaluateAsRelocatableImpl(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), getOffsetAndDataFragment(), handleIndirectSymViaGOTPCRel(), print(), and llvm::DelayedMCExprs::resolveDelayedExpressions().
void MCValue::print | ( | raw_ostream & | OS | ) | const |
Print the value to the stream OS
.
Definition at line 18 of file MCValue.cpp.
References getConstant(), getRefKind(), getSymA(), getSymB(), isAbsolute(), and OS.
Referenced by dump().