14 #ifndef LLVM_MC_MCSYMBOL_H 15 #define LLVM_MC_MCSYMBOL_H 159 FragmentAndHasName.
setInt(!!Name);
161 getNameEntryPtr() =
Name;
170 void operator delete(
void *);
172 void operator delete(
void*,
unsigned) {
182 assert(
F != AbsolutePseudoFragment);
183 return F->getParent();
190 assert(FragmentAndHasName.
getInt() &&
"Name is required");
192 return (*(Name - 1)).NameEntry;
195 return const_cast<MCSymbol*
>(
this)->getNameEntryPtr();
204 if (!FragmentAndHasName.
getInt())
207 return getNameEntryPtr()->first();
269 return *getSectionPtr();
324 "Cannot get offset for a common/variable symbol");
330 "Cannot set offset for a common/variable symbol");
351 "Alignment must be a power of 2");
352 unsigned Log2Align =
Log2_32(Align) + 1;
354 "Out of range alignment");
423 Sym.
print(OS,
nullptr);
429 #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.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
void setInt(IntType IntVal)
void setPrivateExtern(bool Value)
uint32_t getIndex() const
Get the (implementation defined) index.
void setUsedInReloc() const
Compute iterated dominance frontiers using a linear time algorithm.
PointerTy getPointer() const
bool isVariable() const
isVariable - Check if this is a variable symbol.
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.
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 setPointer(PointerTy PtrVal)
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.
void setCommon(uint64_t Size, unsigned Align)
Mark this symbol as being 'common'.
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.
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.
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).
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.
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.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
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 declareCommon(uint64_t Size, unsigned Align)
Declare this symbol as being 'common'.
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.