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
This symbol is visible outside this translation unit.
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

Methods

MCSymbol(const llvm::MCSymbol&)

Declared at: llvm/include/llvm/MC/MCSymbol.h:192

Parameters

const llvm::MCSymbol&

MCSymbol(llvm::MCSymbol::SymbolKind Kind,
         const StringMapEntry<bool>* Name,
         bool isTemporary)

Declared at: llvm/include/llvm/MC/MCSymbol.h:154

Parameters

llvm::MCSymbol::SymbolKind Kind
const StringMapEntry<bool>* Name
bool isTemporary

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:366

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

Description

dump - Print the value to stderr.

Declared at: llvm/include/llvm/MC/MCSymbol.h:407

unsigned int getCommonAlignment() const

Description

Return the alignment of a 'common' symbol.

Declared at: llvm/include/llvm/MC/MCSymbol.h:355

uint64_t getCommonSize() const

Description

Return the size of a 'common' symbol.

Declared at: llvm/include/llvm/MC/MCSymbol.h:331

uint32_t getFlags() const

Description

Get the (implementation defined) symbol flags.

Declared at: llvm/include/llvm/MC/MCSymbol.h:411

llvm::MCFragment* getFragment(
    bool SetUsed = true) const

Declared at: llvm/include/llvm/MC/MCSymbol.h:388

Parameters

bool SetUsed = true

uint32_t getIndex() const

Description

Get the (implementation defined) index.

Declared at: llvm/include/llvm/MC/MCSymbol.h:305

llvm::StringRef getName() const

Description

getName - Get the symbol name.

Declared at: llvm/include/llvm/MC/MCSymbol.h:196

uint64_t getOffset() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:316

llvm::MCSection& getSection() const

Description

Get the section associated with a defined, non-absolute symbol.

Declared at: llvm/include/llvm/MC/MCSymbol.h:260

const llvm::MCExpr* getVariableValue(
    bool SetUsed = true) const

Description

getVariableValue - Get the value for variable symbols.

Declared at: llvm/include/llvm/MC/MCSymbol.h:294

Parameters

bool SetUsed = true

bool isAbsolute() const

Description

isAbsolute - Check if this is an absolute symbol.

Declared at: llvm/include/llvm/MC/MCSymbol.h:255

bool isCOFF() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:276

bool isCommon() const

Description

Is this a 'common' symbol.

Declared at: llvm/include/llvm/MC/MCSymbol.h:378

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:241

bool isELF() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:274

bool isExternal() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:397

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:245

bool isMachO() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:278

bool isPrivateExtern() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:400

bool isRedefinable() const

Description

Check if this symbol is redefinable.

Declared at: llvm/include/llvm/MC/MCSymbol.h:219

bool isRegistered() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:203

bool isTargetCommon() const

Description

Is this a target-specific common-like symbol.

Declared at: llvm/include/llvm/MC/MCSymbol.h:384

bool isTemporary() const

Description

isTemporary - Check if this is an assembler temporary symbol.

Declared at: llvm/include/llvm/MC/MCSymbol.h:213

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:250

Parameters

bool SetUsed = true

bool isUnset() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:314

bool isUsed() const

Description

isUsed - Check if this is used.

Declared at: llvm/include/llvm/MC/MCSymbol.h:216

bool isUsedInReloc() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:207

bool isVariable() const

Description

isVariable - Check if this is a variable symbol.

Declared at: llvm/include/llvm/MC/MCSymbol.h:289

bool isWasm() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:280

bool isXCOFF() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:282

void modifyFlags(uint32_t Value,
                 uint32_t Mask) const

Description

Modify the flags via a mask

Declared at: llvm/include/llvm/MC/MCSymbol.h:420

Parameters

uint32_t Value
uint32_t Mask

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:404

Parameters

llvm::raw_ostream& OS
const llvm::MCAsmInfo* MAI

void redefineIfPossible()

Description

Prepare this symbol to be redefined.

Declared at: llvm/include/llvm/MC/MCSymbol.h:223

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:341

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

Declared at: llvm/include/llvm/MC/MCSymbol.h:398

Parameters

bool Value

void setFlags(uint32_t Value) const

Description

Set the (implementation defined) symbol flags.

Declared at: llvm/include/llvm/MC/MCSymbol.h:414

Parameters

uint32_t Value

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:266

Parameters

llvm::MCFragment* F

void setIndex(uint32_t Value) const

Description

Set the (implementation defined) index.

Declared at: llvm/include/llvm/MC/MCSymbol.h:310

Parameters

uint32_t Value

void setIsRegistered(bool Value) const

Declared at: llvm/include/llvm/MC/MCSymbol.h:204

Parameters

bool Value

void setOffset(uint64_t Value)

Declared at: llvm/include/llvm/MC/MCSymbol.h:322

Parameters

uint64_t Value

void setPrivateExtern(bool Value)

Declared at: llvm/include/llvm/MC/MCSymbol.h:401

Parameters

bool Value

void setRedefinable(bool Value)

Description

Mark this symbol as redefinable.

Declared at: llvm/include/llvm/MC/MCSymbol.h:221

Parameters

bool Value

void setUndefined()

Description

Mark the symbol as undefined.

Declared at: llvm/include/llvm/MC/MCSymbol.h:272

void setUsedInReloc() const

Declared at: llvm/include/llvm/MC/MCSymbol.h:206

void setVariableValue(const llvm::MCExpr* Value)

Declared at: llvm/include/llvm/MC/MCSymbol.h:300

Parameters

const llvm::MCExpr* Value