LLVM 20.0.0git
|
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created and uniqued by the MCContext class. More...
#include "llvm/MC/MCSymbol.h"
Public Member Functions | |
MCSymbol (const MCSymbol &)=delete | |
MCSymbol & | operator= (const MCSymbol &)=delete |
StringRef | getName () const |
getName - Get the symbol name. | |
bool | isRegistered () const |
void | setIsRegistered (bool Value) const |
void | setUsedInReloc () const |
bool | isUsedInReloc () const |
uint32_t | getIndex () const |
Get the (implementation defined) index. | |
void | setIndex (uint32_t Value) const |
Set the (implementation defined) index. | |
bool | isUnset () const |
uint64_t | getOffset () const |
void | setOffset (uint64_t Value) |
uint64_t | getCommonSize () const |
Return the size of a 'common' symbol. | |
void | setCommon (uint64_t Size, Align Alignment, bool Target=false) |
Mark this symbol as being 'common'. | |
MaybeAlign | getCommonAlignment () const |
Return the alignment of a 'common' symbol. | |
bool | declareCommon (uint64_t Size, Align Alignment, bool Target=false) |
Declare this symbol as being 'common'. | |
bool | isCommon () const |
Is this a 'common' symbol. | |
bool | isTargetCommon () const |
Is this a target-specific common-like symbol. | |
MCFragment * | getFragment (bool SetUsed=true) const |
bool | isExternal () const |
void | setExternal (bool Value) const |
bool | isWeakExternal () const |
void | print (raw_ostream &OS, const MCAsmInfo *MAI) const |
print - Print the value to the stream OS . | |
void | dump () const |
dump - Print the value to stderr. | |
Accessors | |
bool | isTemporary () const |
isTemporary - Check if this is an assembler temporary symbol. | |
bool | isUsed () const |
isUsed - Check if this is used. | |
bool | isRedefinable () const |
Check if this symbol is redefinable. | |
void | setRedefinable (bool Value) |
Mark this symbol as redefinable. | |
void | redefineIfPossible () |
Prepare this symbol to be redefined. | |
Associated Sections | |
bool | isDefined () const |
isDefined - Check if this symbol is defined (i.e., it has an address). | |
bool | isInSection () const |
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute). | |
bool | isUndefined (bool SetUsed=true) const |
isUndefined - Check if this symbol undefined (i.e., implicitly defined). | |
bool | isAbsolute () const |
isAbsolute - Check if this is an absolute symbol. | |
MCSection & | getSection () const |
Get the section associated with a defined, non-absolute symbol. | |
void | setFragment (MCFragment *F) const |
Mark the symbol as defined in the fragment F . | |
void | setUndefined () |
Mark the symbol as undefined. | |
bool | isELF () const |
bool | isCOFF () const |
bool | isGOFF () const |
bool | isMachO () const |
bool | isWasm () const |
bool | isXCOFF () const |
Variable Symbols | |
bool | isVariable () const |
isVariable - Check if this is a variable symbol. | |
const MCExpr * | getVariableValue (bool SetUsed=true) const |
getVariableValue - Get the value for variable symbols. | |
void | setVariableValue (const MCExpr *Value) |
Protected Types | |
enum | SymbolKind { SymbolKindUnset , SymbolKindCOFF , SymbolKindELF , SymbolKindGOFF , SymbolKindMachO , SymbolKindWasm , SymbolKindXCOFF } |
The kind of the symbol. More... | |
enum | Contents : uint8_t { SymContentsUnset , SymContentsOffset , SymContentsVariable , SymContentsCommon , SymContentsTargetCommon } |
A symbol can contain an Offset, or Value, or be Common, but never more than one of these. More... | |
enum | : unsigned { NumCommonAlignmentBits = 5 } |
The alignment of the symbol if it is 'common'. More... | |
enum | : unsigned { NumFlagsBits = 16 } |
The Flags field is used by object file implementations to store additional per symbol information which is not easily classified. More... | |
using | NameEntryStorageTy = union { const MCSymbolTableEntry *NameEntry |
The name for a symbol. | |
Protected Member Functions | |
MCSymbol (SymbolKind Kind, const MCSymbolTableEntry *Name, bool isTemporary) | |
void * | operator new (size_t s, const MCSymbolTableEntry *Name, MCContext &Ctx) |
uint32_t | getFlags () const |
Get the (implementation defined) symbol flags. | |
void | setFlags (uint32_t Value) const |
Set the (implementation defined) symbol flags. | |
void | modifyFlags (uint32_t Value, uint32_t Mask) const |
Modify the flags via a mask. | |
Protected Attributes | |
MCFragment * | Fragment = nullptr |
If a symbol has a Fragment, the section is implied, so we only need one pointer. | |
unsigned | HasName: 1 |
True if this symbol is named. | |
unsigned | IsTemporary: 1 |
IsTemporary - True if this is an assembler temporary label, which typically does not survive in the .o file's symbol table. | |
unsigned | IsRedefinable: 1 |
True if this symbol can be redefined. | |
unsigned | IsUsed: 1 |
IsUsed - True if this symbol has been used. | |
unsigned | IsRegistered: 1 |
unsigned | IsExternal: 1 |
True if this symbol is visible outside this translation unit. | |
unsigned | IsPrivateExtern: 1 |
Mach-O specific: This symbol is private extern. | |
unsigned | IsWeakExternal: 1 |
This symbol is weak external. | |
unsigned | Kind: 3 |
LLVM RTTI discriminator. | |
unsigned | IsUsedInReloc: 1 |
True if we have created a relocation that uses this symbol. | |
unsigned | SymbolContents: 3 |
This is actually a Contents enumerator, but is unsigned to avoid sign extension and achieve better bitpacking with MSVC. | |
unsigned | CommonAlignLog2: NumCommonAlignmentBits |
uint32_t | Flags: NumFlagsBits |
uint32_t | Index = 0 |
Index field, for use by the object file implementation. | |
union { | |
uint64_t Offset | |
The offset to apply to the fragment address to form this symbol's value. More... | |
uint64_t CommonSize | |
The size of the symbol, if it is 'common'. More... | |
const MCExpr * Value | |
If non-null, the value for a variable symbol. More... | |
}; | |
uint64_t | AlignmentPadding |
Static Protected Attributes | |
static MCFragment * | AbsolutePseudoFragment = &SentinelFragment |
Friends | |
class | MCExpr |
class | MCContext |
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created and uniqued by the MCContext class.
MCSymbols should only be constructed with valid names for the object file.
If the symbol is defined/emitted into the current translation unit, the Section member is set to indicate what section it lives in. Otherwise, if it is a reference to an external entity, it has a null section.
Definition at line 41 of file MCSymbol.h.
|
protected |
The name for a symbol.
MCSymbol contains a uint64_t so is probably aligned to 8. On a 32-bit system, the name is a pointer so isn't going to satisfy the 8 byte alignment of uint64_t. Account for that here.
Definition at line 159 of file MCSymbol.h.
|
protected |
The alignment of the symbol if it is 'common'.
Internally, this is stored as log2(align) + 1. We reserve 5 bits to encode this value which allows the following values 0b00000 -> unset 0b00001 -> 1ULL << 0 = 1 0b00010 -> 1ULL << 1 = 2 0b00011 -> 1ULL << 2 = 4 ... 0b11111 -> 1ULL << 30 = 1 GiB
Enumerator | |
---|---|
NumCommonAlignmentBits |
Definition at line 129 of file MCSymbol.h.
|
protected |
The Flags field is used by object file implementations to store additional per symbol information which is not easily classified.
Enumerator | |
---|---|
NumFlagsBits |
Definition at line 134 of file MCSymbol.h.
|
protected |
A symbol can contain an Offset, or Value, or be Common, but never more than one of these.
Enumerator | |
---|---|
SymContentsUnset | |
SymContentsOffset | |
SymContentsVariable | |
SymContentsCommon | |
SymContentsTargetCommon |
Definition at line 57 of file MCSymbol.h.
|
protected |
The kind of the symbol.
If it is any value other than unset then this class is actually one of the appropriate subclasses of MCSymbol.
Enumerator | |
---|---|
SymbolKindUnset | |
SymbolKindCOFF | |
SymbolKindELF | |
SymbolKindGOFF | |
SymbolKindMachO | |
SymbolKindWasm | |
SymbolKindXCOFF |
Definition at line 45 of file MCSymbol.h.
|
inlineprotected |
Definition at line 164 of file MCSymbol.h.
Declare this symbol as being 'common'.
Size | - The size of the symbol. |
Alignment | - The alignment of the symbol. |
Target | - Is the symbol a target-specific common-like symbol. |
Definition at line 375 of file MCSymbol.h.
References assert(), CommonSize, getCommonAlignment(), getOffset(), isCommon(), isTargetCommon(), setCommon(), and Size.
Referenced by llvm::AMDGPUTargetELFStreamer::emitAMDGPULDS().
LLVM_DUMP_METHOD void MCSymbol::dump | ( | ) | const |
dump - Print the value to stderr.
Definition at line 84 of file MCSymbol.cpp.
References llvm::dbgs().
|
inline |
Return the alignment of a 'common' symbol.
Definition at line 364 of file MCSymbol.h.
References assert(), CommonAlignLog2, llvm::decodeMaybeAlign(), and isCommon().
Referenced by declareCommon(), and llvm::MCSymbolMachO::getEncodedFlags().
|
inline |
Return the size of a 'common' symbol.
Definition at line 342 of file MCSymbol.h.
References assert(), CommonSize, and isCommon().
|
inlineprotected |
Get the (implementation defined) symbol flags.
Definition at line 421 of file MCSymbol.h.
References Flags.
Referenced by llvm::MCSymbolCOFF::getClass(), llvm::MCSymbolMachO::getEncodedFlags(), llvm::MCSymbolCOFF::getWeakExternalCharacteristics(), llvm::MCSymbolMachO::isAltEntry(), llvm::MCSymbolELF::isBindingSet(), llvm::MCSymbolMachO::isCold(), llvm::MCSymbolXCOFF::isEHInfo(), llvm::MCSymbolWasm::isExported(), llvm::MCSymbolELF::isMemtag(), llvm::MCSymbolMachO::isNoDeadStrip(), llvm::MCSymbolWasm::isNoStrip(), llvm::MCSymbolCOFF::isSafeSEH(), llvm::MCSymbolELF::isSignature(), llvm::MCSymbolMachO::isSymbolResolver(), llvm::MCSymbolWasm::isTLS(), llvm::MCSymbolMachO::isWeakDefinition(), llvm::MCSymbolMachO::isWeakReference(), llvm::MCSymbolELF::isWeakrefUsedInReloc(), llvm::MCSymbolELF::setBinding(), llvm::MCSymbolELF::setIsSignature(), llvm::MCSymbolELF::setIsWeakrefUsedInReloc(), llvm::MCSymbolELF::setMemtag(), llvm::MCSymbolELF::setOther(), llvm::MCSymbolELF::setType(), and llvm::MCSymbolELF::setVisibility().
|
inline |
Definition at line 397 of file MCSymbol.h.
References llvm::MCExpr::findAssociatedFragment(), Fragment, getVariableValue(), isVariable(), and isWeakExternal().
Referenced by AttemptToFoldSymbolOffsetDifference(), llvm::MachObjectWriter::getAtom(), getLabelOffset(), getOffsetAndDataFragment(), llvm::RISCVMCExpr::getPCRelHiFixup(), getSection(), llvm::MachObjectWriter::getSymbolAddress(), isAbsolute(), llvm::MCObjectWriter::isSymbolRefDifferenceFullyResolved(), llvm::MachObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(), isUndefined(), and llvm::LoongArchAsmBackend::shouldInsertFixupForCodeAlign().
|
inline |
Get the (implementation defined) index.
Definition at line 316 of file MCSymbol.h.
References Index.
Referenced by writeFragment(), and llvm::WinCOFFWriter::writeObject().
|
inline |
getName - Get the symbol name.
Definition at line 205 of file MCSymbol.h.
References llvm::StringMapEntry< ValueTy >::first(), and HasName.
Referenced by llvm::AsmPrinter::doFinalization(), llvm::EHStreamer::emitExceptionTable(), llvm::MipsAsmPrinter::emitFunctionBodyEnd(), llvm::AsmPrinter::emitFunctionEntryLabel(), llvm::ARMAsmPrinter::emitFunctionEntryLabel(), llvm::AsmPrinter::emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::XtensaTargetAsmStreamer::emitLiteral(), llvm::XtensaAsmPrinter::emitMachineConstantPoolValue(), EvaluateCRExpr(), llvm::RecordStreamer::flushSymverDirectives(), llvm::MCContext::getAssociativeCOFFSection(), getAuthPtrSlotSymbolHelper(), llvm::MCAssembler::getBaseSymbol(), llvm::TargetLoweringObjectFileELF::getCFIPersonalitySymbol(), llvm::MCContext::getCOFFSection(), llvm::MCContext::getELFSection(), llvm::MCSymbolMachO::getEncodedFlags(), llvm::AArch64MCInstLower::GetGlobalValueSymbol(), llvm::MCSymbolWasm::getImportName(), getLabelOffset(), llvm::NVPTXTargetLowering::getParamName(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), getStaticStructorSection(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), llvm::MCSymbolXCOFF::getUnqualifiedName(), llvm::MCContext::getWasmSection(), hasGOTReference(), llvm::DIELabel::print(), llvm::DIEDelta::print(), print(), llvm::MipsAsmPrinter::printOperand(), llvm::MCSectionELF::printSwitchToSection(), llvm::MCSectionWasm::printSwitchToSection(), llvm::PPCInstPrinter::printTLSCall(), smallData(), llvm::stableHashValue(), startsWithGlobalOffsetTable(), and llvm::WinCOFFWriter::writeObject().
|
inline |
Definition at line 327 of file MCSymbol.h.
References assert(), Offset, SymbolContents, SymContentsOffset, and SymContentsUnset.
Referenced by AttemptToFoldSymbolOffsetDifference(), declareCommon(), getLabelOffset(), getOffsetAndDataFragment(), llvm::RISCVMCExpr::getPCRelHiFixup(), and setCommon().
|
inline |
Get the section associated with a defined, non-absolute symbol.
Definition at line 269 of file MCSymbol.h.
References assert(), getFragment(), llvm::MCFragment::getParent(), and isInSection().
Referenced by llvm::MCLineSection::addEndEntry(), llvm::BTFDebug::beginFunctionImpl(), emitRangeList(), llvm::CodeViewContext::encodeInlineLineTable(), llvm::MCContext::getCOFFSection(), llvm::MCSectionELF::getLinkedToSection(), llvm::LoongArchAsmBackend::handleAddSubRelocations(), llvm::DwarfDebug::insertSectionLabel(), llvm::MCObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(), llvm::MachObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(), llvm::WinCOFFObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(), and llvm::WinCOFFWriter::writeObject().
getVariableValue - Get the value for variable symbols.
Definition at line 305 of file MCSymbol.h.
References assert(), IsUsed, isVariable(), and Value.
Referenced by llvm::MachObjectWriter::findAliasedSymbol(), getFragment(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), and llvm::MCParserUtils::isSymbolUsedInExpression().
|
inline |
isAbsolute - Check if this is an absolute symbol.
Definition at line 264 of file MCSymbol.h.
References AbsolutePseudoFragment, and getFragment().
Referenced by isInSection().
|
inline |
Definition at line 285 of file MCSymbol.h.
References Kind, and SymbolKindCOFF.
Referenced by llvm::MCSymbolCOFF::classof().
|
inline |
Is this a 'common' symbol.
Definition at line 387 of file MCSymbol.h.
References SymbolContents, SymContentsCommon, and SymContentsTargetCommon.
Referenced by declareCommon(), llvm::MCAssembler::getBaseSymbol(), getCommonAlignment(), getCommonSize(), and llvm::MCSymbolMachO::getEncodedFlags().
|
inline |
isDefined - Check if this symbol is defined (i.e., it has an address).
Defined symbols are either absolute or in some section.
Definition at line 250 of file MCSymbol.h.
References isUndefined().
Referenced by llvm::DwarfCompileUnit::attachLowHighPC(), llvm::EHStreamer::computePadMap(), llvm::AsmPrinter::emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::MCSymbolELF::getBinding(), llvm::MCContext::getCOFFSection(), getOffsetAndDataFragment(), and isInSection().
|
inline |
Definition at line 283 of file MCSymbol.h.
References Kind, and SymbolKindELF.
Referenced by llvm::MCSymbolELF::classof().
|
inline |
Definition at line 407 of file MCSymbol.h.
References IsExternal.
|
inline |
Definition at line 287 of file MCSymbol.h.
References Kind, and SymbolKindGOFF.
Referenced by llvm::MCSymbolGOFF::classof().
|
inline |
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
Definition at line 254 of file MCSymbol.h.
References isAbsolute(), and isDefined().
Referenced by llvm::BTFDebug::beginFunctionImpl(), llvm::MachObjectWriter::getAtom(), llvm::MCContext::getCOFFSection(), getSection(), llvm::LoongArchAsmBackend::handleAddSubRelocations(), llvm::MCSection::hasEnded(), llvm::MachObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(), and llvm::WinCOFFWriter::writeObject().
|
inline |
Definition at line 289 of file MCSymbol.h.
References Kind, and SymbolKindMachO.
Referenced by llvm::MCSymbolMachO::classof().
|
inline |
Check if this symbol is redefinable.
Definition at line 228 of file MCSymbol.h.
References IsRedefinable.
|
inline |
Definition at line 212 of file MCSymbol.h.
References IsRegistered.
Referenced by llvm::WinCOFFWriter::writeObject().
|
inline |
Is this a target-specific common-like symbol.
Definition at line 393 of file MCSymbol.h.
References SymbolContents, and SymContentsTargetCommon.
Referenced by declareCommon().
|
inline |
isTemporary - Check if this is an assembler temporary symbol.
Definition at line 222 of file MCSymbol.h.
References IsTemporary.
Referenced by llvm::MCWinCOFFStreamer::emitCGProfileEntry(), llvm::MCSymbolMachO::isSymbolLinkerVisible(), llvm::MachObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(), and llvm::WinCOFFWriter::writeObject().
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
Definition at line 259 of file MCSymbol.h.
References getFragment().
Referenced by AttemptToFoldSymbolOffsetDifference(), llvm::MachObjectWriter::doesSymbolRequireExternRelocation(), llvm::RISCVAsmBackend::evaluateTargetFixup(), isDefined(), and llvm::MCObjectWriter::isSymbolRefDifferenceFullyResolved().
|
inline |
Definition at line 325 of file MCSymbol.h.
References SymbolContents, and SymContentsUnset.
|
inline |
|
inline |
Definition at line 216 of file MCSymbol.h.
References IsUsedInReloc.
Referenced by llvm::MCSymbolELF::getBinding(), and llvm::MCSymbolMachO::isSymbolLinkerVisible().
|
inline |
isVariable - Check if this is a variable symbol.
Definition at line 300 of file MCSymbol.h.
References SymbolContents, and SymContentsVariable.
Referenced by AttemptToFoldSymbolOffsetDifference(), llvm::AsmPrinter::emitFunctionEntryLabel(), llvm::AsmPrinter::emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::MachObjectWriter::findAliasedSymbol(), getFragment(), getOffsetAndDataFragment(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), getVariableValue(), llvm::MCParserUtils::isSymbolUsedInExpression(), and setFragment().
|
inline |
Definition at line 291 of file MCSymbol.h.
References Kind, and SymbolKindWasm.
Referenced by llvm::MCSymbolWasm::classof().
|
inline |
Definition at line 411 of file MCSymbol.h.
References IsWeakExternal.
Referenced by getFragment(), and llvm::MCParserUtils::isSymbolUsedInExpression().
|
inline |
Definition at line 293 of file MCSymbol.h.
References Kind, and SymbolKindXCOFF.
Referenced by llvm::MCSymbolXCOFF::classof().
Modify the flags via a mask.
Definition at line 430 of file MCSymbol.h.
References assert(), Flags, and NumFlagsBits.
Referenced by llvm::MCSymbolMachO::clearReferenceType(), llvm::MCSymbolMachO::setAltEntry(), llvm::MCSymbolCOFF::setClass(), llvm::MCSymbolMachO::setCold(), llvm::MCSymbolXCOFF::setEHInfo(), llvm::MCSymbolWasm::setExported(), llvm::MCSymbolCOFF::setIsSafeSEH(), llvm::MCSymbolMachO::setNoDeadStrip(), llvm::MCSymbolWasm::setNoStrip(), llvm::MCSymbolMachO::setReferenceTypeUndefinedLazy(), llvm::MCSymbolMachO::setSymbolResolver(), llvm::MCSymbolMachO::setThumbFunc(), llvm::MCSymbolWasm::setTLS(), llvm::MCSymbolMachO::setWeakDefinition(), llvm::MCSymbolCOFF::setWeakExternalCharacteristics(), and llvm::MCSymbolMachO::setWeakReference().
|
protected |
Definition at line 30 of file MCSymbol.cpp.
void MCSymbol::print | ( | raw_ostream & | OS, |
const MCAsmInfo * | MAI | ||
) | const |
print - Print the value to the stream OS
.
Definition at line 58 of file MCSymbol.cpp.
References llvm::CallingConv::C, getName(), llvm::MCAsmInfo::isValidUnquotedName(), Name, OS, llvm::report_fatal_error(), and llvm::MCAsmInfo::supportsNameQuoting().
Referenced by llvm::M68kAsmPrinter::PrintAsmMemoryOperand(), llvm::WebAssemblyAsmPrinter::PrintAsmOperand(), printExpr(), llvm::ARMAsmPrinter::printOperand(), llvm::MipsAsmPrinter::printOperand(), llvm::HexagonAsmPrinter::printOperand(), llvm::MCSectionCOFF::printSwitchToSection(), llvm::ARMAsmPrinter::PrintSymbolOperand(), and llvm::AsmPrinter::PrintSymbolOperand().
|
inline |
Prepare this symbol to be redefined.
Definition at line 232 of file MCSymbol.h.
References IsRedefinable, setUndefined(), SymbolContents, SymContentsUnset, and SymContentsVariable.
Referenced by llvm::AsmPrinter::emitFunctionEntryLabel(), llvm::AsmPrinter::emitGlobalVariable(), and llvm::AMDGPUAsmPrinter::emitGlobalVariable().
Mark this symbol as being 'common'.
Size | - The size of the symbol. |
Alignment | - The alignment of the symbol. |
Target | - Is the symbol a target-specific common-like symbol. |
Definition at line 352 of file MCSymbol.h.
References assert(), CommonAlignLog2, CommonSize, llvm::encode(), getOffset(), NumCommonAlignmentBits, Size, SymbolContents, SymContentsCommon, and SymContentsTargetCommon.
Referenced by declareCommon().
|
inline |
Definition at line 408 of file MCSymbol.h.
References IsExternal, and Value.
Referenced by llvm::MCWinCOFFStreamer::finalizeCGProfileEntry().
|
inlineprotected |
Set the (implementation defined) symbol flags.
Definition at line 424 of file MCSymbol.h.
References assert(), Flags, NumFlagsBits, and Value.
Referenced by llvm::MCSymbolELF::setBinding(), llvm::MCSymbolMachO::setDesc(), llvm::MCSymbolELF::setIsSignature(), llvm::MCSymbolELF::setIsWeakrefUsedInReloc(), llvm::MCSymbolELF::setMemtag(), llvm::MCSymbolELF::setOther(), llvm::MCSymbolELF::setType(), and llvm::MCSymbolELF::setVisibility().
|
inline |
Mark the symbol as defined in the fragment F
.
Definition at line 275 of file MCSymbol.h.
References assert(), F, Fragment, and isVariable().
Referenced by llvm::MCContext::getCOFFSection(), llvm::MCContext::getWasmSection(), and llvm::MCContext::getXCOFFSection().
|
inline |
Set the (implementation defined) index.
Definition at line 321 of file MCSymbol.h.
References Value.
Referenced by llvm::AMDGPUTargetELFStreamer::emitAMDGPULDS().
|
inline |
Definition at line 213 of file MCSymbol.h.
References IsRegistered, and Value.
|
inline |
Definition at line 333 of file MCSymbol.h.
References assert(), Offset, SymbolContents, SymContentsOffset, SymContentsUnset, and Value.
|
inline |
Mark this symbol as redefinable.
Definition at line 230 of file MCSymbol.h.
References IsRedefinable, and Value.
|
inline |
Mark the symbol as undefined.
Definition at line 281 of file MCSymbol.h.
References Fragment.
Referenced by redefineIfPossible(), and setVariableValue().
|
inline |
Definition at line 215 of file MCSymbol.h.
References IsUsedInReloc.
Referenced by llvm::ELFObjectWriter::recordRelocation().
Definition at line 47 of file MCSymbol.cpp.
References assert(), IsUsed, setUndefined(), SymbolContents, SymContentsUnset, SymContentsVariable, and Value.
Referenced by llvm::MCELFStreamer::emitWeakReference(), llvm::MCWasmStreamer::emitWeakReference(), and llvm::SIInstrInfo::insertIndirectBranch().
|
friend |
Definition at line 153 of file MCSymbol.h.
|
friend |
Definition at line 152 of file MCSymbol.h.
union { ... } llvm::MCSymbol::@353 |
|
staticprotected |
Definition at line 66 of file MCSymbol.h.
Referenced by llvm::MCExpr::findAssociatedFragment(), and isAbsolute().
|
protected |
Definition at line 161 of file MCSymbol.h.
|
protected |
Definition at line 130 of file MCSymbol.h.
Referenced by getCommonAlignment(), and setCommon().
uint64_t llvm::MCSymbol::CommonSize |
The size of the symbol, if it is 'common'.
Definition at line 145 of file MCSymbol.h.
Referenced by declareCommon(), getCommonSize(), and setCommon().
|
mutableprotected |
Definition at line 135 of file MCSymbol.h.
Referenced by llvm::MCSymbolELF::getBinding(), llvm::MCSymbolMachO::getEncodedFlags(), getFlags(), llvm::MCSymbolELF::getOther(), llvm::MCSymbolELF::getType(), llvm::MCSymbolELF::getVisibility(), modifyFlags(), and setFlags().
|
mutableprotected |
If a symbol has a Fragment, the section is implied, so we only need one pointer.
The special AbsolutePseudoFragment value is for absolute symbols. If this is a variable symbol, this caches the variable value's fragment. FIXME: We might be able to simplify this by having the asm streamer create dummy fragments. If this is a section, then it gives the symbol is defined in. This is null for undefined symbols.
If this is a fragment, then it gives the fragment this symbol's value is relative to, if any.
Definition at line 79 of file MCSymbol.h.
Referenced by getFragment(), setFragment(), and setUndefined().
|
protected |
True if this symbol is named.
A named symbol will have a pointer to the name allocated in the bytes immediately prior to the MCSymbol.
Definition at line 83 of file MCSymbol.h.
Referenced by getName(), and MCSymbol().
|
mutableprotected |
Index field, for use by the object file implementation.
Definition at line 138 of file MCSymbol.h.
Referenced by getIndex().
|
mutableprotected |
True if this symbol is visible outside this translation unit.
Note: ELF uses binding instead of this bit.
Definition at line 100 of file MCSymbol.h.
Referenced by isExternal(), and setExternal().
|
mutableprotected |
Mach-O specific: This symbol is private extern.
Definition at line 103 of file MCSymbol.h.
Referenced by llvm::MCSymbolMachO::isPrivateExtern(), and llvm::MCSymbolMachO::setPrivateExtern().
|
protected |
True if this symbol can be redefined.
Definition at line 91 of file MCSymbol.h.
Referenced by isRedefinable(), redefineIfPossible(), and setRedefinable().
|
mutableprotected |
Definition at line 96 of file MCSymbol.h.
Referenced by isRegistered(), and setIsRegistered().
|
protected |
IsTemporary - True if this is an assembler temporary label, which typically does not survive in the .o file's symbol table.
Usually "Lfoo" or ".foo".
Definition at line 88 of file MCSymbol.h.
Referenced by isTemporary().
|
mutableprotected |
IsUsed - True if this symbol has been used.
Definition at line 94 of file MCSymbol.h.
Referenced by getVariableValue(), isUsed(), and setVariableValue().
|
mutableprotected |
True if we have created a relocation that uses this symbol.
Definition at line 113 of file MCSymbol.h.
Referenced by isUsedInReloc(), and setUsedInReloc().
|
mutableprotected |
This symbol is weak external.
Definition at line 106 of file MCSymbol.h.
Referenced by isWeakExternal(), and llvm::MCSymbolCOFF::setIsWeakExternal().
|
protected |
uint64_t llvm::MCSymbol::Offset |
The offset to apply to the fragment address to form this symbol's value.
Definition at line 142 of file MCSymbol.h.
Referenced by getOffset(), MCSymbol(), and setOffset().
|
protected |
This is actually a Contents enumerator, but is unsigned to avoid sign extension and achieve better bitpacking with MSVC.
Definition at line 117 of file MCSymbol.h.
Referenced by getOffset(), isCommon(), isTargetCommon(), isUnset(), isVariable(), redefineIfPossible(), setCommon(), setOffset(), and setVariableValue().
If non-null, the value for a variable symbol.
Definition at line 148 of file MCSymbol.h.
Referenced by getVariableValue(), setExternal(), setFlags(), setIndex(), setIsRegistered(), setOffset(), llvm::MCSymbolMachO::setPrivateExtern(), setRedefinable(), and setVariableValue().