LLVM
8.0.1
|
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 |
void | printVariantKind (raw_ostream &OS) const |
bool | hasSubsectionsViaSymbols () const |
Public Member Functions inherited from llvm::MCExpr | |
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 | |
Protected Member Functions inherited from llvm::MCExpr | |
MCExpr (ExprKind Kind, SMLoc Loc) | |
bool | evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, const MCAsmLayout *Layout, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) 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.
enum llvm::MCSymbolRefExpr::VariantKind : uint16_t |
Definition at line 354 of file MCExpr.h.
References llvm::MCExpr::getKind(), and llvm::MCExpr::SymbolRef.
|
inlinestatic |
Definition at line 323 of file MCExpr.h.
References Name.
Referenced by llvm::ConstantPool::addEntry(), addNegOperand(), llvm::ARCMCInstLower::ARCMCInstLower(), ARM64EmitRuntimeFunction(), ARM64EmitUnwindInfo(), buildSymbolDiff(), ConvertDoubleToBytes(), convertFPR32ToFPR64(), countMCSymbolRefExpr(), createPCXRelExprOp(), createSparcMCOperand(), llvm::AddressPool::emit(), EmitAbsDifference(), llvm::MCStreamer::emitAbsoluteSymbolDiff(), llvm::MCStreamer::emitAbsoluteSymbolDiffAsULEB128(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), llvm::MCWinCOFFStreamer::EmitCOFFImgRel32(), llvm::MCWinCOFFStreamer::EmitCOFFSecRel32(), llvm::MCWinCOFFStreamer::EmitCOFFSectionIndex(), llvm::AsmPrinter::EmitDebugValue(), llvm::MipsTargetELFStreamer::emitDirectiveCpLoad(), llvm::MipsTargetELFStreamer::emitDirectiveCpsetup(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), emitDirectiveRelocJalr(), llvm::MipsAsmPrinter::EmitEndOfAsmFile(), llvm::CodeViewContext::emitFileChecksumOffset(), llvm::AsmPrinter::EmitFunctionBody(), EmitGenDwarfAranges(), EmitGenDwarfRanges(), llvm::AMDGPUTargetELFStreamer::EmitHSAMetadata(), llvm::MCELFStreamer::EmitIdent(), 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::AsmPrinter::EmitLabelPlusOffset(), llvm::SystemZAsmPrinter::EmitMachineConstantPoolValue(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), emitNonLazySymbolPointer(), EmitNop(), EmitNops(), llvm::MCObjectStreamer::EmitRelocDirective(), EmitRuntimeFunction(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), EmitSymbolRefWithOfs(), llvm::MCStreamer::EmitSymbolValue(), EmitUnwindInfo(), llvm::AVRMCELFStreamer::EmitValueForModiferKind(), llvm::MCELFStreamer::EmitWeakReference(), llvm::MCWasmStreamer::EmitWeakReference(), llvm::ARMAsmPrinter::EmitXXStructor(), encodeBitmaskPerm(), llvm::CodeViewContext::encodeDefRange(), llvm::WinException::endFunclet(), llvm::WasmException::endFunction(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), llvm::RecordStreamer::flushSymverDirectives(), forceExpAbs(), GetAbsDifference(), GetAEABIUnwindPersonalityName(), llvm::ARMElfTargetObjectFile::getDebugThreadLocalSymbol(), llvm::MipsTargetObjectFile::getDebugThreadLocalSymbol(), llvm::X86ELFTargetObjectFile::getDebugThreadLocalSymbol(), llvm::TargetLoweringObjectFile::getDebugThreadLocalSymbol(), getDwarfRegNum(), llvm::SystemZMCInstLower::getExpr(), 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::X86TargetLowering::getPICJumpTableRelocBaseExpr(), llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), llvm::TargetLowering::getPICJumpTableRelocBaseExpr(), getRealVLDOpcode(), getRetOpcode(), GetSymbolRef(), getTLSGetOffset(), llvm::X86_64MachoTargetObjectFile::getTTypeGlobalReference(), llvm::ARMElfTargetObjectFile::getTTypeGlobalReference(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeReference(), getVariantKind(), llvm::HexagonLowerToMC(), llvm::HexagonAsmPrinter::HexagonProcessInstruction(), incrementLoc(), llvm::XCoreMCInstLower::Initialize(), llvm::MipsMCInstLower::Initialize(), llvm::IsCPSRDead< MCInst >(), IsSmallMemAccess(), isWeak(), llvm::MSP430MCInstLower::Lower(), llvm::BPFMCInstLower::Lower(), llvm::LanaiMCInstLower::Lower(), llvm::WebAssemblyMCInstLower::Lower(), llvm::WebAssemblyAsmPrinter::lowerConstant(), llvm::AsmPrinter::lowerConstant(), llvm::X86TargetLowering::LowerCustomJumpTableEntry(), llvm::AVRMCInstLower::lowerInstruction(), llvm::AArch64MCInstLower::lowerOperand(), llvm::MipsMCInstLower::LowerOperand(), llvm::ARMAsmPrinter::lowerOperand(), llvm::LowerPPCMachineOperandToMCOperand(), llvm::TargetLoweringObjectFileELF::lowerRelativeReference(), llvm::TargetLoweringObjectFileCOFF::lowerRelativeReference(), llvm::TargetLoweringObjectFileWasm::lowerRelativeReference(), lowerSymbolOperand(), LowerSymbolOperand(), llvm::AVRMCInstLower::lowerSymbolOperand(), llvm::MSP430MCInstLower::LowerSymbolOperand(), llvm::BPFMCInstLower::LowerSymbolOperand(), llvm::LanaiMCInstLower::LowerSymbolOperand(), llvm::AArch64MCInstLower::lowerSymbolOperandCOFF(), llvm::AArch64MCInstLower::lowerSymbolOperandDarwin(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), makeCombineInst(), MCAttrForString(), nextReg(), printFPOReg(), printMCExpr(), llvm::FaultMaps::recordFaultingOp(), RefineErrorLoc(), llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand(), llvm::MCExternalSymbolizer::tryAddingSymbolicOperand(), llvm::AMDGPUSymbolizer::tryAddingSymbolicOperand(), and VisitGlobalVariableForEmission().
|
static |
Definition at line 179 of file MCExpr.cpp.
|
static |
Definition at line 185 of file MCExpr.cpp.
|
inline |
Definition at line 338 of file MCExpr.h.
Referenced by addNegOperand(), canUseLocalRelocation(), countMCSymbolRefExpr(), llvm::MCELFStreamer::EmitIdent(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), llvm::MCAssembler::Finish(), fixELFSymbolsInTLSFixupsImpl(), llvm::MCValue::getAccessVariant(), llvm::MCAssembler::getAtom(), getFixupKindLog2Size(), getRelocType(), HasSecRelSymbolRef(), incrementLoc(), IsEventType(), IsFunctionType(), IsGlobalType(), isNonILP32reloc(), isPCRel(), llvm::MCObjectWriter::isSymbolRefDifferenceFullyResolved(), llvm::MCAssembler::isThumbFunc(), isWeak(), llvm::MCExpr::print(), printExpr(), printSImmOperand(), and llvm::PPCInstPrinter::printTLSCall().
Definition at line 336 of file MCExpr.h.
References llvm::ARMBuildAttrs::Symbol.
Referenced by addNegOperand(), canUseLocalRelocation(), ConvertDoubleToBytes(), llvm::MCELFStreamer::EmitIdent(), llvm::MCObjectStreamer::EmitRelocDirective(), encodeBase64StringEntry(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), EvaluateCRExpr(), llvm::MCExpr::findAssociatedFragment(), fixELFSymbolsInTLSFixupsImpl(), GetAEABIUnwindPersonalityName(), getARMFixupKindMachOInfo(), llvm::MCAssembler::getAtom(), llvm::MCAsmLayout::getBaseSymbol(), getFixupKindLog2Size(), getFixupKindNumBytes(), getFixupOffset(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::RISCVMCExpr::getPCRelHiFixup(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), getSymbolValue(), handleIndirectSymViaGOTPCRel(), hasGOTReference(), isShiftedUIntAtAnyPosition(), llvm::MCObjectWriter::isSymbolRefDifferenceFullyResolved(), llvm::MCAssembler::isThumbFunc(), isWeak(), llvm::MCExpr::print(), PrintCFIEscape(), printExpr(), printSImmOperand(), llvm::PPCInstPrinter::printTLSCall(), RefineErrorLoc(), llvm::ARMAsmBackend::shouldForceRelocation(), and StartsWithGlobalOffsetTable().
|
static |
Definition at line 320 of file MCExpr.cpp.
Referenced by altMacroString().
|
static |
Definition at line 190 of file MCExpr.cpp.
Referenced by llvm::PPCInstPrinter::printTLSCall().
|
inline |
Definition at line 342 of file MCExpr.h.
Referenced by llvm::MCExpr::evaluateAsRelocatableImpl().
void MCSymbolRefExpr::printVariantKind | ( | raw_ostream & | OS | ) | const |
Definition at line 434 of file MCExpr.cpp.
Referenced by llvm::MCExpr::print().