Go to the documentation of this file.
13 #ifndef LLVM_MC_MCSYMBOL_H
14 #define LLVM_MC_MCSYMBOL_H
164 getNameEntryPtr() =
Name;
173 void operator delete(
void *);
175 void operator delete(
void*, unsigned) {
179 void operator delete(
void*, unsigned, bool) {
184 const StringMapEntry<bool> *&getNameEntryPtr() {
187 return (*(
Name - 1)).NameEntry;
189 const StringMapEntry<bool> *&getNameEntryPtr()
const {
190 return const_cast<MCSymbol*
>(
this)->getNameEntryPtr();
202 return getNameEntryPtr()->first();
323 "Cannot get offset for a common/variable symbol");
329 "Cannot set offset for a common/variable symbol");
351 "Alignment must be a power of 2");
354 "Out of range alignment");
431 Sym.
print(OS,
nullptr);
437 #endif // LLVM_MC_MCSYMBOL_H
This is an optimization pass for GlobalISel generic memory operations.
void setOffset(uint64_t Value)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
Context object for machine code objects.
uint64_t getOffset() const
void setFlags(uint32_t Value) const
Set the (implementation defined) symbol flags.
@ SymContentsTargetCommon
This class is intended to be used as a base class for asm properties and features specific to the tar...
Target - Wrapper for Target specific information.
static MCFragment * AbsolutePseudoFragment
bool isUndefined(bool SetUsed=true) const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
void setUndefined()
Mark the symbol as undefined.
MCFragment * getFragment(bool SetUsed=true) const
unsigned IsUsed
IsUsed - True if this symbol has been used.
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
bool isUsed() const
isUsed - Check if this is used.
unsigned IsExternal
True if this symbol is visible outside this translation unit.
bool isAbsolute() const
isAbsolute - Check if this is an absolute symbol.
MCSection * getParent() const
unsigned SymbolContents
This is actually a Contents enumerator, but is unsigned to avoid sign extension and achieve better bi...
void setIsRegistered(bool Value) const
bool isRegistered() const
void setVariableValue(const MCExpr *Value)
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
void dump() const
dump - Print the value to stderr.
unsigned IsRedefinable
True if this symbol can be redefined.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
bool isUsedInReloc() const
Contents
A symbol can contain an Offset, or Value, or be Common, but never more than one of these.
const MCExpr * getVariableValue(bool SetUsed=true) const
getVariableValue - Get the value for variable symbols.
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
bool isPrivateExtern() const
MCSymbol & operator=(const MCSymbol &)=delete
bool isTargetCommon() const
Is this a target-specific common-like symbol.
This class implements an extremely fast bulk output stream that can only output to a stream.
void setIndex(uint32_t Value) const
Set the (implementation defined) index.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
StringRef getName() const
getName - Get the symbol name.
This struct is a compact representation of a valid (non-zero power of two) alignment.
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
MCSymbol(SymbolKind Kind, const StringMapEntry< bool > *Name, bool isTemporary)
const MCExpr * Value
If non-null, the value for a variable symbol.
uint32_t getIndex() const
Get the (implementation defined) index.
void setPrivateExtern(bool Value)
uint64_t AlignmentPadding
PointerIntPair< MCFragment *, 1 > FragmentAndHasName
If a symbol has a Fragment, the section is implied, so we only need one pointer.
union { const StringMapEntry< bool > *NameEntry NameEntryStorageTy
The name for a symbol.
multiplies can be turned into SHL s
void modifyFlags(uint32_t Value, uint32_t Mask) const
Modify the flags via a mask.
unsigned IsTemporary
IsTemporary - True if this is an assembler temporary label, which typically does not survive in the ....
uint32_t getFlags() const
Get the (implementation defined) symbol flags.
bool isVariable() const
isVariable - Check if this is a variable symbol.
void setUsedInReloc() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isCommon() const
Is this a 'common' symbol.
bool isRedefinable() const
Check if this symbol is redefinable.
void redefineIfPossible()
Prepare this symbol to be redefined.
void setCommon(uint64_t Size, unsigned Align, bool Target=false)
Mark this symbol as being 'common'.
StringRef - Represent a constant reference to a string, i.e.
unsigned IsPrivateExtern
This symbol is private extern.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
SymbolKind
The kind of the symbol.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
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.
uint64_t CommonSize
The size of the symbol, if it is 'common'.
void setExternal(bool Value) const
PointerIntPair - This class implements a pair of a pointer and small integer.
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 isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
uint32_t Index
Index field, for use by the object file implementation.
uint64_t Offset
The offset to apply to the fragment address to form this symbol's value.
uint64_t getCommonSize() const
Return the size of a 'common' symbol.
unsigned Kind
LLVM RTTI discriminator.
void setRedefinable(bool Value)
Mark this symbol as redefinable.
LLVM Value Representation.
Base class for the full range of assembler expressions which are needed for parsing.