class MCSymbol
Declaration
class MCSymbol { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/MC/MCSymbol.h:41
Member Variables
- protected PointerIntPair<llvm::MCFragment*, 1> FragmentAndHasName
- For the 'HasName' integer, this is 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.
- protected unsigned int IsTemporary
- 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".
- protected unsigned int IsRedefinable
- True if this symbol can be redefined.
- protected unsigned int IsUsed
- IsUsed - True if this symbol has been used.
- protected unsigned int IsRegistered
- protected unsigned int IsExternal
- True if this symbol is visible outside this translation unit. Note: ELF uses binding instead of this bit.
- protected unsigned int IsPrivateExtern
- This symbol is private extern.
- protected unsigned int Kind
- LLVM RTTI discriminator. This is actually a SymbolKind enumerator, but is unsigned to avoid sign extension and achieve better bitpacking with MSVC.
- protected unsigned int IsUsedInReloc
- True if we have created a relocation that uses this symbol.
- protected unsigned int SymbolContents
- This is actually a Contents enumerator, but is unsigned to avoid sign extension and achieve better bitpacking with MSVC.
- protected unsigned int CommonAlignLog2
- protected uint32_t Flags
- protected uint32_t Index = 0
- Index field, for use by the object file implementation.
- protected anonymous struct / union
- protected static llvm::MCFragment* AbsolutePseudoFragment
Method Overview
- public MCSymbol(const llvm::MCSymbol &)
- protected MCSymbol(llvm::MCSymbol::SymbolKind Kind, const StringMapEntry<bool> * Name, bool isTemporary)
- public bool declareCommon(uint64_t Size, unsigned int Align, bool Target = false)
- public void dump() const
- public unsigned int getCommonAlignment() const
- public uint64_t getCommonSize() const
- protected uint32_t getFlags() const
- public llvm::MCFragment * getFragment(bool SetUsed = true) const
- public uint32_t getIndex() const
- public llvm::StringRef getName() const
- private const StringMapEntry<bool> *& getNameEntryPtr()
- private const StringMapEntry<bool> *& getNameEntryPtr() const
- public uint64_t getOffset() const
- public llvm::MCSection & getSection() const
- public const llvm::MCExpr * getVariableValue(bool SetUsed = true) const
- public bool isAbsolute() const
- public bool isCOFF() const
- public bool isCommon() const
- public bool isDefined() const
- public bool isELF() const
- public bool isExternal() const
- public bool isGOFF() const
- public bool isInSection() const
- public bool isMachO() const
- public bool isPrivateExtern() const
- public bool isRedefinable() const
- public bool isRegistered() const
- public bool isTargetCommon() const
- public bool isTemporary() const
- public bool isUndefined(bool SetUsed = true) const
- public bool isUnset() const
- public bool isUsed() const
- public bool isUsedInReloc() const
- public bool isVariable() const
- public bool isWasm() const
- public bool isXCOFF() const
- protected void modifyFlags(uint32_t Value, uint32_t Mask) const
- public void print(llvm::raw_ostream & OS, const llvm::MCAsmInfo * MAI) const
- public void redefineIfPossible()
- public void setCommon(uint64_t Size, unsigned int Align, bool Target = false)
- public void setExternal(bool Value) const
- protected void setFlags(uint32_t Value) const
- public void setFragment(llvm::MCFragment * F) const
- public void setIndex(uint32_t Value) const
- public void setIsRegistered(bool Value) const
- public void setOffset(uint64_t Value)
- public void setPrivateExtern(bool Value)
- public void setRedefinable(bool Value)
- public void setUndefined()
- public void setUsedInReloc() const
- public void setVariableValue(const llvm::MCExpr * Value)
Methods
¶MCSymbol(const llvm::MCSymbol&)
MCSymbol(const llvm::MCSymbol&)
Declared at: llvm/include/llvm/MC/MCSymbol.h:194
Parameters
- const llvm::MCSymbol&
¶MCSymbol(llvm::MCSymbol::SymbolKind Kind,
const StringMapEntry<bool>* Name,
bool isTemporary)
MCSymbol(llvm::MCSymbol::SymbolKind Kind,
const StringMapEntry<bool>* Name,
bool isTemporary)
Declared at: llvm/include/llvm/MC/MCSymbol.h:156
Parameters
- llvm::MCSymbol::SymbolKind Kind
- const StringMapEntry<bool>* Name
- bool isTemporary
¶bool declareCommon(uint64_t Size,
unsigned int Align,
bool Target = false)
bool declareCommon(uint64_t Size,
unsigned int Align,
bool Target = false)
Description
Declare this symbol as being 'common'.
Declared at: llvm/include/llvm/MC/MCSymbol.h:370
Parameters
- uint64_t Size
- - The size of the symbol.
- unsigned int Align
- - The alignment of the symbol.
- bool Target = false
- - Is the symbol a target-specific common-like symbol.
Returns
True if symbol was already declared as a different type
¶void dump() const
void dump() const
Description
dump - Print the value to stderr.
Declared at: llvm/include/llvm/MC/MCSymbol.h:411
¶unsigned int getCommonAlignment() const
unsigned int getCommonAlignment() const
Description
Return the alignment of a 'common' symbol.
Declared at: llvm/include/llvm/MC/MCSymbol.h:359
¶uint64_t getCommonSize() const
uint64_t getCommonSize() const
Description
Return the size of a 'common' symbol.
Declared at: llvm/include/llvm/MC/MCSymbol.h:335
¶uint32_t getFlags() const
uint32_t getFlags() const
Description
Get the (implementation defined) symbol flags.
Declared at: llvm/include/llvm/MC/MCSymbol.h:415
¶llvm::MCFragment* getFragment(
bool SetUsed = true) const
llvm::MCFragment* getFragment(
bool SetUsed = true) const
Declared at: llvm/include/llvm/MC/MCSymbol.h:392
Parameters
- bool SetUsed = true
¶uint32_t getIndex() const
uint32_t getIndex() const
Description
Get the (implementation defined) index.
Declared at: llvm/include/llvm/MC/MCSymbol.h:309
¶llvm::StringRef getName() const
llvm::StringRef getName() const
Description
getName - Get the symbol name.
Declared at: llvm/include/llvm/MC/MCSymbol.h:198
¶const StringMapEntry<bool>*& getNameEntryPtr()
const StringMapEntry<bool>*& getNameEntryPtr()
Description
Get a reference to the name field. Requires that we have a name
Declared at: llvm/include/llvm/MC/MCSymbol.h:184
¶const StringMapEntry<bool>*& getNameEntryPtr()
const
const StringMapEntry<bool>*& getNameEntryPtr()
const
Declared at: llvm/include/llvm/MC/MCSymbol.h:189
¶uint64_t getOffset() const
uint64_t getOffset() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:320
¶llvm::MCSection& getSection() const
llvm::MCSection& getSection() const
Description
Get the section associated with a defined, non-absolute symbol.
Declared at: llvm/include/llvm/MC/MCSymbol.h:262
¶const llvm::MCExpr* getVariableValue(
bool SetUsed = true) const
const llvm::MCExpr* getVariableValue(
bool SetUsed = true) const
Description
getVariableValue - Get the value for variable symbols.
Declared at: llvm/include/llvm/MC/MCSymbol.h:298
Parameters
- bool SetUsed = true
¶bool isAbsolute() const
bool isAbsolute() const
Description
isAbsolute - Check if this is an absolute symbol.
Declared at: llvm/include/llvm/MC/MCSymbol.h:257
¶bool isCOFF() const
bool isCOFF() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:278
¶bool isCommon() const
bool isCommon() const
Description
Is this a 'common' symbol.
Declared at: llvm/include/llvm/MC/MCSymbol.h:382
¶bool isDefined() const
bool isDefined() const
Description
isDefined - Check if this symbol is defined (i.e., it has an address). Defined symbols are either absolute or in some section.
Declared at: llvm/include/llvm/MC/MCSymbol.h:243
¶bool isELF() const
bool isELF() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:276
¶bool isExternal() const
bool isExternal() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:401
¶bool isGOFF() const
bool isGOFF() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:280
¶bool isInSection() const
bool isInSection() const
Description
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
Declared at: llvm/include/llvm/MC/MCSymbol.h:247
¶bool isMachO() const
bool isMachO() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:282
¶bool isPrivateExtern() const
bool isPrivateExtern() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:404
¶bool isRedefinable() const
bool isRedefinable() const
Description
Check if this symbol is redefinable.
Declared at: llvm/include/llvm/MC/MCSymbol.h:221
¶bool isRegistered() const
bool isRegistered() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:205
¶bool isTargetCommon() const
bool isTargetCommon() const
Description
Is this a target-specific common-like symbol.
Declared at: llvm/include/llvm/MC/MCSymbol.h:388
¶bool isTemporary() const
bool isTemporary() const
Description
isTemporary - Check if this is an assembler temporary symbol.
Declared at: llvm/include/llvm/MC/MCSymbol.h:215
¶bool isUndefined(bool SetUsed = true) const
bool isUndefined(bool SetUsed = true) const
Description
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
Declared at: llvm/include/llvm/MC/MCSymbol.h:252
Parameters
- bool SetUsed = true
¶bool isUnset() const
bool isUnset() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:318
¶bool isUsed() const
bool isUsed() const
Description
isUsed - Check if this is used.
Declared at: llvm/include/llvm/MC/MCSymbol.h:218
¶bool isUsedInReloc() const
bool isUsedInReloc() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:209
¶bool isVariable() const
bool isVariable() const
Description
isVariable - Check if this is a variable symbol.
Declared at: llvm/include/llvm/MC/MCSymbol.h:293
¶bool isWasm() const
bool isWasm() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:284
¶bool isXCOFF() const
bool isXCOFF() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:286
¶void modifyFlags(uint32_t Value,
uint32_t Mask) const
void modifyFlags(uint32_t Value,
uint32_t Mask) const
Description
Modify the flags via a mask
Declared at: llvm/include/llvm/MC/MCSymbol.h:424
Parameters
- uint32_t Value
- uint32_t Mask
¶void print(llvm::raw_ostream& OS,
const llvm::MCAsmInfo* MAI) const
void print(llvm::raw_ostream& OS,
const llvm::MCAsmInfo* MAI) const
Description
print - Print the value to the stream \p OS.
Declared at: llvm/include/llvm/MC/MCSymbol.h:408
Parameters
- llvm::raw_ostream& OS
- const llvm::MCAsmInfo* MAI
¶void redefineIfPossible()
void redefineIfPossible()
Description
Prepare this symbol to be redefined.
Declared at: llvm/include/llvm/MC/MCSymbol.h:225
¶void setCommon(uint64_t Size,
unsigned int Align,
bool Target = false)
void setCommon(uint64_t Size,
unsigned int Align,
bool Target = false)
Description
Mark this symbol as being 'common'.
Declared at: llvm/include/llvm/MC/MCSymbol.h:345
Parameters
- uint64_t Size
- - The size of the symbol.
- unsigned int Align
- - The alignment of the symbol.
- bool Target = false
- - Is the symbol a target-specific common-like symbol.
¶void setExternal(bool Value) const
void setExternal(bool Value) const
Declared at: llvm/include/llvm/MC/MCSymbol.h:402
Parameters
- bool Value
¶void setFlags(uint32_t Value) const
void setFlags(uint32_t Value) const
Description
Set the (implementation defined) symbol flags.
Declared at: llvm/include/llvm/MC/MCSymbol.h:418
Parameters
- uint32_t Value
¶void setFragment(llvm::MCFragment* F) const
void setFragment(llvm::MCFragment* F) const
Description
Mark the symbol as defined in the fragment \p F.
Declared at: llvm/include/llvm/MC/MCSymbol.h:268
Parameters
¶void setIndex(uint32_t Value) const
void setIndex(uint32_t Value) const
Description
Set the (implementation defined) index.
Declared at: llvm/include/llvm/MC/MCSymbol.h:314
Parameters
- uint32_t Value
¶void setIsRegistered(bool Value) const
void setIsRegistered(bool Value) const
Declared at: llvm/include/llvm/MC/MCSymbol.h:206
Parameters
- bool Value
¶void setOffset(uint64_t Value)
void setOffset(uint64_t Value)
Declared at: llvm/include/llvm/MC/MCSymbol.h:326
Parameters
- uint64_t Value
¶void setPrivateExtern(bool Value)
void setPrivateExtern(bool Value)
Declared at: llvm/include/llvm/MC/MCSymbol.h:405
Parameters
- bool Value
¶void setRedefinable(bool Value)
void setRedefinable(bool Value)
Description
Mark this symbol as redefinable.
Declared at: llvm/include/llvm/MC/MCSymbol.h:223
Parameters
- bool Value
¶void setUndefined()
void setUndefined()
Description
Mark the symbol as undefined.
Declared at: llvm/include/llvm/MC/MCSymbol.h:274
¶void setUsedInReloc() const
void setUsedInReloc() const
Declared at: llvm/include/llvm/MC/MCSymbol.h:208
¶void setVariableValue(const llvm::MCExpr* Value)
void setVariableValue(const llvm::MCExpr* Value)
Declared at: llvm/include/llvm/MC/MCSymbol.h:304
Parameters
- const llvm::MCExpr* Value