13#ifndef LLVM_MC_MCSYMBOL_H
14#define LLVM_MC_MCSYMBOL_H
172 getNameEntryPtr() =
Name;
180 void operator delete(
void *);
182 void operator delete(
void*,
unsigned) {
194 return (*(
Name - 1)).NameEntry;
197 return const_cast<MCSymbol*
>(
this)->getNameEntryPtr();
209 return getNameEntryPtr()->
first();
330 "Cannot get offset for a common/variable symbol");
336 "Cannot set offset for a common/variable symbol");
357 unsigned Log2Align =
encode(Alignment);
359 "Out of range alignment");
437 Sym.print(
OS,
nullptr);
This file defines the StringMapEntry class - it is intended to be a low dependency implementation det...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class is intended to be used as a base class for asm properties and features specific to the tar...
Context object for machine code objects.
Base class for the full range of assembler expressions which are needed for parsing.
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
MCSection * getParent() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool isAbsolute() const
isAbsolute - Check if this is an absolute symbol.
unsigned IsWeakExternal
This symbol is weak external.
MCSymbol(const MCSymbol &)=delete
const MCExpr * getVariableValue(bool SetUsed=true) const
getVariableValue - Get the value for variable symbols.
bool isTargetCommon() const
Is this a target-specific common-like symbol.
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
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).
void setCommon(uint64_t Size, Align Alignment, bool Target=false)
Mark this symbol as being 'common'.
void setExternal(bool Value) const
unsigned IsUsed
IsUsed - True if this symbol has been used.
bool isCommon() const
Is this a 'common' symbol.
void modifyFlags(uint32_t Value, uint32_t Mask) const
Modify the flags via a mask.
unsigned IsPrivateExtern
Mach-O specific: This symbol is private extern.
StringRef getName() const
getName - Get the symbol name.
void setFragment(MCFragment *F) const
Mark the symbol as defined in the fragment F.
unsigned IsUsedInReloc
True if we have created a relocation that uses this symbol.
bool isWeakExternal() const
bool isVariable() const
isVariable - Check if this is a variable symbol.
MCSymbol(SymbolKind Kind, const MCSymbolTableEntry *Name, bool isTemporary)
unsigned IsRedefinable
True if this symbol can be redefined.
union { const MCSymbolTableEntry *NameEntry NameEntryStorageTy
The name for a symbol.
void setFlags(uint32_t Value) const
Set the (implementation defined) symbol flags.
uint32_t getFlags() const
Get the (implementation defined) symbol flags.
unsigned IsExternal
True if this symbol is visible outside this translation unit.
bool isRedefinable() const
Check if this symbol is redefinable.
void setVariableValue(const MCExpr *Value)
MaybeAlign getCommonAlignment() const
Return the alignment of a 'common' symbol.
uint32_t Index
Index field, for use by the object file implementation.
uint64_t AlignmentPadding
bool isUsed() const
isUsed - Check if this is used.
unsigned HasName
True if this symbol is named.
bool isRegistered() const
void setIndex(uint32_t Value) const
Set the (implementation defined) index.
bool isUndefined(bool SetUsed=true) const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
void setRedefinable(bool Value)
Mark this symbol as redefinable.
void setUsedInReloc() const
unsigned SymbolContents
This is actually a Contents enumerator, but is unsigned to avoid sign extension and achieve better bi...
uint32_t getIndex() const
Get the (implementation defined) index.
MCFragment * Fragment
If a symbol has a Fragment, the section is implied, so we only need one pointer.
Contents
A symbol can contain an Offset, or Value, or be Common, but never more than one of these.
@ SymContentsTargetCommon
void setUndefined()
Mark the symbol as undefined.
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
static MCFragment * AbsolutePseudoFragment
SymbolKind
The kind of the symbol.
void setOffset(uint64_t Value)
void redefineIfPossible()
Prepare this symbol to be redefined.
uint64_t getCommonSize() const
Return the size of a 'common' symbol.
unsigned IsTemporary
IsTemporary - True if this is an assembler temporary label, which typically does not survive in the ....
void dump() const
dump - Print the value to stderr.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
bool declareCommon(uint64_t Size, Align Alignment, bool Target=false)
Declare this symbol as being 'common'.
const MCExpr * Value
If non-null, the value for a variable symbol.
void setIsRegistered(bool Value) const
uint64_t CommonSize
The size of the symbol, if it is 'common'.
uint64_t Offset
The offset to apply to the fragment address to form this symbol's value.
uint64_t getOffset() const
bool isUsedInReloc() const
MCSymbol & operator=(const MCSymbol &)=delete
unsigned Kind
LLVM RTTI discriminator.
MCFragment * getFragment(bool SetUsed=true) const
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
StringRef - Represent a constant reference to a string, i.e.
Target - Wrapper for Target specific information.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
StringMapEntry< MCSymbolTableValue > MCSymbolTableEntry
MCContext stores MCSymbolTableValue in a string map (see MCSymbol::operator new).
unsigned encode(MaybeAlign A)
Returns a representation of the alignment that encodes undefined as 0.
MaybeAlign decodeMaybeAlign(unsigned Value)
Dual operation of the encode function above.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
This struct is a compact representation of a valid (non-zero power of two) alignment.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.