13#ifndef LLVM_MC_MCSYMBOL_H
14#define LLVM_MC_MCSYMBOL_H
154 getNameEntryPtr() =
Name;
166 void operator delete(
void *);
168 void operator delete(
void*,
unsigned) {
180 return (*(
Name - 1)).NameEntry;
183 return const_cast<MCSymbol*
>(
this)->getNameEntryPtr();
192 return getNameEntryPtr()->
first();
291 "Cannot get offset for a common/variable symbol");
296 "Cannot set offset for a common/variable symbol");
316 unsigned Log2Align =
encode(Alignment);
318 "Out of range alignment");
382 Sym.print(
OS,
nullptr);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the StringMapEntry class - it is intended to be a low dependency implementation det...
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.
LLVM_ABI 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 MCSymbolTableEntry *Name, bool isTemporary)
void setCommon(uint64_t Size, Align Alignment)
Mark this symbol as being 'common'.
LLVM_ABI 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).
void setIsResolving(bool V)
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
bool isUndefined() const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
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.
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.
LLVM_ABI 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
unsigned HasName
True if this symbol is named.
bool isRegistered() const
void setIndex(uint32_t Value) const
Set the (implementation defined) index.
void setRedefinable(bool Value)
Mark this symbol as redefinable.
bool declareCommon(uint64_t Size, Align Alignment)
Declare this symbol as being 'common'.
void setUsedInReloc() const
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.
unsigned IsResolving
Used to detect cyclic dependency like a = a + 1 and a = b; b = a.
MCSymbol(const MCSymbol &)=default
unsigned kind
The symbol kind.
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
static LLVM_ABI MCFragment * AbsolutePseudoFragment
void setOffset(uint64_t Value)
void redefineIfPossible()
Prepare this symbol to be redefined.
uint64_t getCommonSize() const
Return the size of a 'common' symbol.
const MCExpr * getVariableValue() const
Get the expression of the variable symbol.
unsigned IsTemporary
IsTemporary - True if this is an assembler temporary label, which typically does not survive in the ....
LLVM_ABI void dump() const
dump - Print the value to stderr.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
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.
MCFragment * getFragment() const
uint64_t getOffset() const
bool isUsedInReloc() const
MCSymbol & operator=(const MCSymbol &)=delete
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
StringRef - Represent a constant reference to a string, i.e.
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.