LLVM
17.0.0git
|
Represent a reference to a symbol from inside an expression. More...
#include "llvm/MC/MCExpr.h"
Public Member Functions | |
Accessors | |
const MCSymbol & | getSymbol () const |
VariantKind | getKind () const |
bool | hasSubsectionsViaSymbols () const |
![]() | |
MCExpr (const MCExpr &)=delete | |
MCExpr & | operator= (const MCExpr &)=delete |
ExprKind | getKind () const |
SMLoc | getLoc () const |
void | print (raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const |
void | dump () const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAsmLayout &Layout, const SectionAddrMap &Addrs) const |
Try to evaluate the expression to an absolute value. More... | |
bool | evaluateAsAbsolute (int64_t &Res) const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAssembler &Asm) const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAssembler *Asm) const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAsmLayout &Layout) const |
bool | evaluateKnownAbsolute (int64_t &Res, const MCAsmLayout &Layout) const |
bool | evaluateAsRelocatable (MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const |
Try to evaluate the expression to a relocatable value, i.e. More... | |
bool | evaluateAsValue (MCValue &Res, const MCAsmLayout &Layout) const |
Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables. More... | |
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. More... | |
Static Public Member Functions | |
static bool | classof (const MCExpr *E) |
Construction | |
static const MCSymbolRefExpr * | create (const MCSymbol *Symbol, MCContext &Ctx) |
static const MCSymbolRefExpr * | create (const MCSymbol *Symbol, VariantKind Kind, MCContext &Ctx, SMLoc Loc=SMLoc()) |
static const MCSymbolRefExpr * | create (StringRef Name, VariantKind Kind, MCContext &Ctx) |
Static Utility Functions | |
static StringRef | getVariantKindName (VariantKind Kind) |
static VariantKind | getVariantKindForName (StringRef Name) |
Additional Inherited Members | |
![]() | |
MCExpr (ExprKind Kind, SMLoc Loc, unsigned SubclassData=0) | |
bool | evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, const MCAsmLayout *Layout, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) const |
unsigned | getSubclassData () const |
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 419 of file MCExpr.h.
References E, and llvm::MCExpr::SymbolRef.
|
inlinestatic |
Definition at line 386 of file MCExpr.h.
References VK_None.
Referenced by llvm::CSKYConstantPool::addEntry(), llvm::ConstantPool::addEntry(), ARM64EmitRuntimeFunction(), ARM64EmitUnwindInfoForSegment(), ARMEmitRuntimeFunction(), ARMEmitUnwindInfo(), buildSymbolDiff(), createGOTRelExprOp(), createPCXRelExprOp(), createSparcMCOperand(), createVEMCOperand(), llvm::AsmPrinter::doFinalization(), EmitAbsDifference(), llvm::MCStreamer::emitAbsoluteSymbolDiff(), llvm::MCStreamer::emitAbsoluteSymbolDiffAsULEB128(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), llvm::TargetLoweringObjectFile::emitCGProfileMetadata(), llvm::MCWinCOFFStreamer::emitCOFFImgRel32(), llvm::MCWinCOFFStreamer::emitCOFFSecRel32(), llvm::MCWinCOFFStreamer::emitCOFFSectionIndex(), llvm::MipsTargetELFStreamer::emitDirectiveCpLoad(), llvm::MipsTargetELFStreamer::emitDirectiveCpsetup(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), emitDirectiveRelocJalr(), llvm::CodeViewContext::emitFileChecksumOffset(), llvm::AsmPrinter::emitFunctionBody(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::AMDGPUTargetELFStreamer::EmitHSAMetadata(), llvm::SystemZAsmPrinter::emitInstruction(), llvm::ARMAsmPrinter::emitInstruction(), llvm::X86AsmPrinter::emitInstruction(), llvm::AMDGPUTargetELFStreamer::EmitISAVersion(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), llvm::AsmPrinter::emitJumpTableInfo(), llvm::ARMAsmPrinter::emitJumpTableInsts(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), llvm::X86AsmPrinter::emitKCFITypeId(), llvm::AsmPrinter::emitLabelPlusOffset(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), llvm::SystemZAsmPrinter::emitMachineConstantPoolValue(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), emitNonLazySymbolPointer(), EmitNop(), llvm::MCObjectStreamer::emitRelocDirective(), EmitRuntimeFunction(), llvm::HexagonAsmPrinter::EmitSled(), EmitSymbolRefWithOfs(), llvm::MCStreamer::emitSymbolValue(), EmitUnwindInfo(), llvm::AVRMCELFStreamer::emitValueForModiferKind(), llvm::MCWasmStreamer::emitWeakReference(), llvm::MCELFStreamer::emitWeakReference(), llvm::MCWinCOFFStreamer::emitWeakReference(), llvm::AsmPrinter::emitXRayTable(), llvm::ARMAsmPrinter::emitXXStructor(), llvm::CodeViewContext::encodeDefRange(), llvm::WasmException::endFunction(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), llvm::RecordStreamer::flushSymverDirectives(), forceExpAbs(), llvm::ARMElfTargetObjectFile::getDebugThreadLocalSymbol(), llvm::MipsTargetObjectFile::getDebugThreadLocalSymbol(), llvm::X86ELFTargetObjectFile::getDebugThreadLocalSymbol(), llvm::TargetLoweringObjectFile::getDebugThreadLocalSymbol(), llvm::SystemZMCInstLower::getExpr(), llvm::RISCVMCAsmInfo::getExprForFDESymbol(), llvm::SparcELFMCAsmInfo::getExprForFDESymbol(), llvm::MCAsmInfo::getExprForFDESymbol(), llvm::AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::SparcELFMCAsmInfo::getExprForPersonalitySymbol(), llvm::X86_64MCAsmInfoDarwin::getExprForPersonalitySymbol(), getGlobalOffsetTable(), llvm::X86_64MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::ARMElfTargetObjectFile::getIndirectSymViaRWPI(), GetOptionalAbsDifference(), llvm::M68kTargetLowering::getPICJumpTableRelocBaseExpr(), llvm::X86TargetLowering::getPICJumpTableRelocBaseExpr(), llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), llvm::TargetLowering::getPICJumpTableRelocBaseExpr(), GetSubDivExpr(), GetSymbolRef(), getTLSGetOffset(), llvm::X86_64MachoTargetObjectFile::getTTypeGlobalReference(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), llvm::ARMElfTargetObjectFile::getTTypeGlobalReference(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeReference(), llvm::HexagonLowerToMC(), llvm::HexagonAsmPrinter::HexagonProcessInstruction(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::MSP430MCInstLower::Lower(), llvm::BPFMCInstLower::Lower(), llvm::LanaiMCInstLower::Lower(), llvm::AVRAsmPrinter::lowerConstant(), llvm::AsmPrinter::lowerConstant(), llvm::VETargetLowering::LowerCustomJumpTableEntry(), llvm::M68kTargetLowering::LowerCustomJumpTableEntry(), llvm::RISCVTargetLowering::LowerCustomJumpTableEntry(), llvm::X86TargetLowering::LowerCustomJumpTableEntry(), llvm::TargetLoweringObjectFileELF::lowerDSOLocalEquivalent(), llvm::AVRMCInstLower::lowerInstruction(), llvm::CSKYMCInstLower::lowerOperand(), llvm::AArch64MCInstLower::lowerOperand(), llvm::ARMAsmPrinter::lowerOperand(), llvm::LowerPPCMachineOperandToMCOperand(), llvm::TargetLoweringObjectFileELF::lowerRelativeReference(), llvm::TargetLoweringObjectFileCOFF::lowerRelativeReference(), llvm::TargetLoweringObjectFileWasm::lowerRelativeReference(), lowerSymbolOperand(), LowerSymbolOperand(), llvm::CSKYMCInstLower::lowerSymbolOperand(), llvm::AVRMCInstLower::lowerSymbolOperand(), llvm::BPFMCInstLower::LowerSymbolOperand(), llvm::LanaiMCInstLower::LowerSymbolOperand(), llvm::MSP430MCInstLower::LowerSymbolOperand(), llvm::M68kMCInstLower::LowerSymbolOperand(), llvm::AArch64MCInstLower::lowerSymbolOperandCOFF(), llvm::AArch64MCInstLower::lowerSymbolOperandDarwin(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), makeStartPlusIntExpr(), llvm::MCAsmParserExtension::ParseDirectiveCGProfile(), llvm::FaultMaps::recordFaultingOp(), llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand(), llvm::MCExternalSymbolizer::tryAddingSymbolicOperand(), and llvm::AMDGPUSymbolizer::tryAddingSymbolicOperand().
|
static |
Definition at line 210 of file MCExpr.cpp.
|
static |
Definition at line 216 of file MCExpr.cpp.
|
inline |
Definition at line 401 of file MCExpr.h.
References llvm::MCExpr::getSubclassData().
Referenced by llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), fixELFSymbolsInTLSFixupsImpl(), llvm::PPCMCCodeEmitter::getMemRI34PCRelEncoding(), llvm::PPCMCCodeEmitter::getTLSRegEncoding(), llvm::isPartOfGOTToPCRelPair(), needsExpandMemInst(), llvm::MCExpr::print(), printExpr(), llvm::PPCInstPrinter::printInst(), llvm::PPCInstPrinter::printTLSCall(), and shouldBeSls().
Definition at line 399 of file MCExpr.h.
Referenced by llvm::MCWinCOFFStreamer::emitCGProfileEntry(), llvm::MCObjectStreamer::emitRelocDirective(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), EvaluateCRExpr(), llvm::MCWinCOFFStreamer::finalizeCGProfileEntry(), llvm::MCExpr::findAssociatedFragment(), fixELFSymbolsInTLSFixupsImpl(), llvm::MCAsmLayout::getBaseSymbol(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), getOffsetAndDataFragment(), llvm::RISCVMCExpr::getPCRelHiFixup(), handleIndirectSymViaGOTPCRel(), hasGOTReference(), llvm::MCExpr::print(), printExpr(), llvm::PPCInstPrinter::printInst(), llvm::PPCInstPrinter::printTLSCall(), llvm::WebAssemblyAsmTypeCheck::typeCheck(), and llvm::MachObjectWriter::writeObject().
|
static |
Definition at line 389 of file MCExpr.cpp.
|
static |
Definition at line 221 of file MCExpr.cpp.
Referenced by llvm::MCExpr::print(), and llvm::PPCInstPrinter::printTLSCall().
|
inline |
Definition at line 405 of file MCExpr.h.
References llvm::MCExpr::getSubclassData().
Referenced by llvm::MCExpr::evaluateAsRelocatableImpl().