13 #ifndef LLVM_MC_MCSYMBOL_H 14 #define LLVM_MC_MCSYMBOL_H 160 FragmentAndHasName.
setInt(!!Name);
162 getNameEntryPtr() =
Name;
171 void operator delete(
void *);
173 void operator delete(
void*,
unsigned) {
183 assert(FragmentAndHasName.
getInt() &&
"Name is required");
185 return (*(Name - 1)).NameEntry;
188 return const_cast<MCSymbol*
>(
this)->getNameEntryPtr();
197 if (!FragmentAndHasName.
getInt())
200 return getNameEntryPtr()->first();
319 "Cannot get offset for a common/variable symbol");
325 "Cannot set offset for a common/variable symbol");
347 "Alignment must be a power of 2");
348 unsigned Log2Align =
Log2_32(Align) + 1;
350 "Out of range alignment");
427 Sym.
print(OS,
nullptr);
433 #endif // LLVM_MC_MCSYMBOL_H
Instances of this class represent a uniqued identifier for a section in the current translation unit...
union { const StringMapEntry< bool > *NameEntry NameEntryStorageTy
The name for a symbol.
void setInt(IntType IntVal) LLVM_LVALUE_FUNCTION
void setPrivateExtern(bool Value)
uint32_t getIndex() const
Get the (implementation defined) index.
void setUsedInReloc() const
This class represents lattice values for constants.
PointerTy getPointer() const
bool isVariable() const
isVariable - Check if this is a variable symbol.
void setCommon(uint64_t Size, unsigned Align, bool Target=false)
Mark this symbol as being 'common'.
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void redefineIfPossible()
Prepare this symbol to be redefined.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
bool declareCommon(uint64_t Size, unsigned Align, bool Target=false)
Declare this symbol as being 'common'.
unsigned getCommonAlignment() const
Return the alignment of a 'common' symbol.
SymbolKind
The kind of the symbol.
uint64_t CommonSize
The size of the symbol, if it is 'common'.
bool isCommon() const
Is this a 'common' symbol.
unsigned IsPrivateExtern
This symbol is private extern.
bool isRedefinable() const
Check if this symbol is redefinable.
void setExternal(bool Value) const
Base class for the full range of assembler expressions which are needed for parsing.
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute)...
void setFragment(MCFragment *F) const
Mark the symbol as defined in the fragment F.
Context object for machine code objects.
unsigned IsUsedInReloc
True if we have created a relocation that uses this symbol.
uint64_t Offset
The offset to apply to the fragment address to form this symbol's value.
void setPointer(PointerTy PtrVal) LLVM_LVALUE_FUNCTION
This class is intended to be used as a base class for asm properties and features specific to the tar...
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
PointerIntPair - This class implements a pair of a pointer and small integer.
void setRedefinable(bool Value)
Mark this symbol as redefinable.
uint32_t Index
Index field, for use by the object file implementation.
unsigned Kind
LLVM RTTI discriminator.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
uint64_t getCommonSize() const
Return the size of a 'common' symbol.
uint64_t getOffset() const
void setOffset(uint64_t Value)
void setFlags(uint32_t Value) const
Set the (implementation defined) symbol flags.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This struct is a compact representation of a valid (non-zero power of two) alignment.
static MCFragment * AbsolutePseudoFragment
void setUndefined()
Mark the symbol as undefined.
bool isUndefined(bool SetUsed=true) const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
MCFragment * getFragment(bool SetUsed=true) const
bool isRegistered() const
unsigned IsUsed
IsUsed - True if this symbol has been used.
unsigned IsExternal
This symbol is visible outside this translation unit.
bool isUsed() const
isUsed - Check if this is used.
unsigned SymbolContents
This is actually a Contents enumerator, but is unsigned to avoid sign extension and achieve better bi...
void setVariableValue(const MCExpr *Value)
void dump() const
dump - Print the value to stderr.
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
Target - Wrapper for Target specific information.
MCSection * getParent() const
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
bool isAbsolute() const
isAbsolute - Check if this is an absolute symbol.
void setIsRegistered(bool Value) const
bool isUsedInReloc() const
unsigned IsRedefinable
True if this symbol can be redefined.
bool isTargetCommon() const
Is this a target-specific common-like symbol.
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
StringRef getName() const
getName - Get the symbol name.
uint64_t AlignmentPadding
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const MCExpr * getVariableValue(bool SetUsed=true) const
getVariableValue - Get the value for variable symbols.
MCSymbol & operator=(const MCSymbol &)=delete
LLVM Value Representation.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
This class implements an extremely fast bulk output stream that can only output to a stream...
const MCExpr * Value
If non-null, the value for a variable symbol.
StringRef - Represent a constant reference to a string, i.e.
MCSymbol(SymbolKind Kind, const StringMapEntry< bool > *Name, bool isTemporary)
PointerIntPair< MCFragment *, 1 > FragmentAndHasName
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...
bool isPrivateExtern() const
void setIndex(uint32_t Value) const
Set the (implementation defined) index.
void modifyFlags(uint32_t Value, uint32_t Mask) const
Modify the flags via a mask.
uint32_t getFlags() const
Get the (implementation defined) symbol flags.
unsigned IsTemporary
IsTemporary - True if this is an assembler temporary label, which typically does not survive in the ...
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.