LLVM: llvm::MCSymbolRefExpr Class Reference (original) (raw)

Represent a reference to a symbol from inside an expression. More...

#include "[llvm/MC/MCExpr.h](MCExpr%5F8h%5Fsource.html)"

Inheritance diagram for llvm::MCSymbolRefExpr:

Public Member Functions
Accessors
const MCSymbol & getSymbol () const
VariantKind getKind () const
uint16_t getSpecifier () const
Public Member Functions inherited from llvm::MCExpr
MCExpr (const MCExpr &)=delete
MCExpr & operator= (const MCExpr &)=delete
ExprKind getKind () const
SMLoc getLoc () const
LLVM_ABI void dump () const
LLVM_ABI bool evaluateAsAbsolute (int64_t &Res) const
Try to evaluate the expression to an absolute value.
LLVM_ABI bool evaluateAsAbsolute (int64_t &Res, const MCAssembler &Asm) const
LLVM_ABI bool evaluateAsAbsolute (int64_t &Res, const MCAssembler *Asm) const
LLVM_ABI bool evaluateKnownAbsolute (int64_t &Res, const MCAssembler &Asm) const
Aggressive variant of evaluateAsRelocatable when relocations are unavailable (e.g.
LLVM_ABI bool evaluateAsRelocatable (MCValue &Res, const MCAssembler *Asm) const
Try to evaluate the expression to a relocatable value, i.e.
LLVM_ABI bool evaluateAsValue (MCValue &Res, const MCAssembler &Asm) const
Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables.
LLVM_ABI MCFragment * findAssociatedFragment () const
Find the "associated section" for this expression, which is currently defined as the absolute section for constants, or otherwise the section associated with the first defined symbol in the expression.
Static Public Member Functions
static bool classof (const MCExpr *E)
Construction
static const MCSymbolRefExpr * create (const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
static LLVM_ABI const MCSymbolRefExpr * create (const MCSymbol *Symbol, Spec specifier, MCContext &Ctx, SMLoc Loc=SMLoc())
Static Public Member Functions inherited from llvm::MCExpr
static LLVM_ABI bool evaluateSymbolicAdd (const MCAssembler *, bool, const MCValue &, const MCValue &, MCValue &)
Additional Inherited Members
Protected Types inherited from llvm::MCExpr
using Spec = uint16_t
Protected Member Functions inherited from llvm::MCExpr
MCExpr (ExprKind Kind, SMLoc Loc, unsigned SubclassData=0)
LLVM_ABI bool evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, bool InSet) const
unsigned getSubclassData () const

Detailed Description

Represent a reference to a symbol from inside an expression.

A symbol reference in an expression may be a use of a label, a use of an assembler variable (defined constant), or constitute an implicit definition of the symbol as external.

Definition at line 190 of file MCExpr.h.

Member Enumeration Documentation

VariantKind

Enumerator
VK_COFF_IMGREL32
FirstTargetSpecifier

Definition at line 197 of file MCExpr.h.

Member Function Documentation

classof()

create() [1/2]

Definition at line 214 of file MCExpr.h.

References create().

Referenced by llvm::ConstantPool::addEntry(), llvm::CSKYConstantPool::addEntry(), llvm::MCAsmParser::applySpecifier(), ARM64EmitRuntimeFunction(), ARM64EmitUnwindInfoForSegment(), ARMEmitRuntimeFunction(), ARMEmitUnwindInfo(), buildSymbolDiff(), buildSymbolDiff(), computeLabelDiff(), llvm::MCSpecifierExpr::create(), create(), createGOTRelExprOp(), createPCXCallOP(), createPCXRelExprOp(), createSparcMCOperand(), createVEMCOperand(), llvm::SystemZTargetGOFFStreamer::createWordDiffExpr(), llvm::SystemZTargetHLASMStreamer::createWordDiffExpr(), llvm::AMDGPUDisassembler::decodeVersionImm(), llvm::AsmPrinter::doFinalization(), llvm::AddressPool::emit(), EmitAbsDifference(), llvm::MCStreamer::emitAbsoluteSymbolDiff(), llvm::MCStreamer::emitAbsoluteSymbolDiffAsULEB128(), emitAddress(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), llvm::TargetLoweringObjectFile::emitCGProfileMetadata(), llvm::MCWinCOFFStreamer::emitCOFFImgRel32(), llvm::MCWinCOFFStreamer::emitCOFFSecRel32(), llvm::MCWinCOFFStreamer::emitCOFFSectionIndex(), llvm::MipsTargetELFStreamer::emitDirectiveCpsetup(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), emitDirectiveRelocJalr(), llvm::EHStreamer::emitExceptionTable(), llvm::CodeViewContext::emitFileChecksumOffset(), llvm::WebAssemblyAsmPrinter::EmitFunctionAttributes(), llvm::AsmPrinter::emitFunctionBody(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::AMDGPUTargetELFStreamer::EmitHSAMetadata(), llvm::ARMAsmPrinter::emitInstruction(), llvm::SystemZAsmPrinter::emitInstruction(), llvm::X86AsmPrinter::emitInstruction(), llvm::AMDGPUTargetELFStreamer::EmitISAVersion(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), llvm::AsmPrinter::emitJumpTableEntry(), llvm::BPFAsmPrinter::emitJumpTableInfo(), llvm::LoongArchAsmPrinter::emitJumpTableInfo(), llvm::ARMAsmPrinter::emitJumpTableInsts(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), llvm::X86AsmPrinter::emitKCFITypeId(), llvm::AsmPrinter::emitLabelPlusOffset(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), llvm::SystemZAsmPrinter::emitMachineConstantPoolValue(), llvm::XtensaAsmPrinter::emitMachineConstantPoolValue(), emitNonLazySymbolPointer(), emitNonLazySymbolPointer(), EmitNop(), llvm::AArch64_ELFTargetObjectFile::emitPersonalityValueImpl(), llvm::MCObjectStreamer::emitRelocDirective(), EmitRuntimeFunction(), llvm::HexagonAsmPrinter::EmitSled(), llvm::LoongArchAsmPrinter::emitSled(), EmitSymbolRefWithOfs(), EmitSymbolRefWithOfs(), llvm::MCStreamer::emitSymbolValue(), EmitUnwindInfo(), llvm::AVRMCELFStreamer::emitValueForModiferKind(), llvm::MCELFStreamer::emitWeakReference(), llvm::MCWinCOFFStreamer::emitWeakReference(), llvm::MCXCOFFStreamer::emitXCOFFRefDirective(), llvm::AsmPrinter::emitXRayTable(), llvm::ARMAsmPrinter::emitXXStructor(), llvm::CodeViewContext::encodeDefRange(), llvm::WasmException::endFunction(), llvm::ELFObjectWriter::executePostLayoutBinding(), llvm::RecordStreamer::flushSymverDirectives(), forceExpAbs(), llvm::MCResourceInfo::gatherResourceInfo(), getAuthPtrSlotSymbolHelper(), llvm::ARMElfTargetObjectFile::getDebugThreadLocalSymbol(), llvm::MipsTargetObjectFile::getDebugThreadLocalSymbol(), llvm::SystemZELFTargetObjectFile::getDebugThreadLocalSymbol(), llvm::TargetLoweringObjectFile::getDebugThreadLocalSymbol(), llvm::X86ELFTargetObjectFile::getDebugThreadLocalSymbol(), llvm::SystemZMCInstLower::getExpr(), llvm::MCAsmInfo::getExprForFDESymbol(), llvm::RISCVMCAsmInfo::getExprForFDESymbol(), llvm::AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::X86_64MCAsmInfoDarwin::getExprForPersonalitySymbol(), getGlobalOffsetTable(), llvm::AArch64MCInstLower::GetGlobalValueSymbol(), llvm::AArch64_ELFTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::ARMElfTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::RISCVELFTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::X86_64ELFTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::X86_64MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::ARMElfTargetObjectFile::getIndirectSymViaRWPI(), GetOptionalAbsDifference(), llvm::M68kTargetLowering::getPICJumpTableRelocBaseExpr(), llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), llvm::TargetLowering::getPICJumpTableRelocBaseExpr(), llvm::X86TargetLowering::getPICJumpTableRelocBaseExpr(), GetSubDivExpr(), GetSymbolRef(), GetSymbolRef(), llvm::MCResourceInfo::getSymRefExpr(), getTLSGetOffset(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::ARMElfTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::X86_64MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeReference(), llvm::HexagonLowerToMC(), llvm::HexagonAsmPrinter::HexagonProcessInstruction(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::BPFMCInstLower::Lower(), llvm::LanaiMCInstLower::Lower(), llvm::MSP430MCInstLower::Lower(), llvm::AsmPrinter::lowerBlockAddressConstant(), llvm::AsmPrinter::lowerConstant(), llvm::M68kTargetLowering::LowerCustomJumpTableEntry(), llvm::RISCVTargetLowering::LowerCustomJumpTableEntry(), llvm::VETargetLowering::LowerCustomJumpTableEntry(), llvm::X86TargetLowering::LowerCustomJumpTableEntry(), llvm::TargetLoweringObjectFileELF::lowerDSOLocalEquivalent(), llvm::AVRMCInstLower::lowerInstruction(), llvm::AArch64MCInstLower::lowerOperand(), llvm::AMDGPUMCInstLower::lowerOperand(), llvm::ARMAsmPrinter::lowerOperand(), llvm::CSKYMCInstLower::lowerOperand(), llvm::LowerPPCMachineOperandToMCOperand(), llvm::TargetLoweringObjectFileCOFF::lowerRelativeReference(), llvm::TargetLoweringObjectFileELF::lowerSymbolDifference(), llvm::BPFMCInstLower::LowerSymbolOperand(), llvm::LanaiMCInstLower::LowerSymbolOperand(), llvm::M68kMCInstLower::LowerSymbolOperand(), llvm::MSP430MCInstLower::LowerSymbolOperand(), llvm::XtensaAsmPrinter::LowerSymbolOperand(), LowerSymbolOperand(), llvm::AVRMCInstLower::lowerSymbolOperand(), llvm::CSKYMCInstLower::lowerSymbolOperand(), lowerSymbolOperand(), lowerSymbolOperand(), llvm::AArch64MCInstLower::lowerSymbolOperandCOFF(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), llvm::AArch64MCInstLower::lowerSymbolOperandMachO(), makeEndMinusStartExpr(), makeStartPlusIntExpr(), llvm::MCAsmParserExtension::parseDirectiveCGProfile(), llvm::FaultMaps::recordFaultingOp(), llvm::LoongArchAsmBackend::relaxAlign(), llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand(), llvm::AMDGPUSymbolizer::tryAddingSymbolicOperand(), and llvm::MCExternalSymbolizer::tryAddingSymbolicOperand().

create() [2/2]

getKind()

VariantKind llvm::MCSymbolRefExpr::getKind ( ) const inline

getSpecifier()

uint16_t llvm::MCSymbolRefExpr::getSpecifier ( ) const inline

getSymbol()

const MCSymbol & llvm::MCSymbolRefExpr::getSymbol ( ) const inline

Definition at line 227 of file MCExpr.h.

Referenced by llvm::ConstantPool::addEntry(), llvm::MCAsmParser::applySpecifier(), llvm::MipsTargetELFStreamer::emitAssignment(), llvm::MCWinCOFFStreamer::emitCGProfileEntry(), llvm::NVPTXTargetStreamer::emitValue(), llvm::MCExpr::evaluateAsRelocatableImpl(), EvaluateCRExpr(), llvm::MCWinCOFFStreamer::finalizeCGProfileEntry(), hasGOTReference(), knownBitsMapHelper(), llvm::WebAssemblyInstPrinter::printCatchList(), printExpr(), printExpr(), printExpr(), llvm::PPCInstPrinter::printInst(), llvm::SystemZInstPrinterCommon::printPCRelTLSOperand(), and llvm::PPCInstPrinter::printTLSCall().


The documentation for this class was generated from the following files: