9 #ifndef LLVM_MC_MCSYMBOLMACHO_H
10 #define LLVM_MC_MCSYMBOLMACHO_H
19 enum MachOSymbolFlags : uint16_t {
20 SF_DescFlagsMask = 0xFFFF,
23 SF_ReferenceTypeMask = 0x0007,
24 SF_ReferenceTypeUndefinedNonLazy = 0x0000,
25 SF_ReferenceTypeUndefinedLazy = 0x0001,
26 SF_ReferenceTypeDefined = 0x0002,
27 SF_ReferenceTypePrivateDefined = 0x0003,
28 SF_ReferenceTypePrivateUndefinedNonLazy = 0x0004,
29 SF_ReferenceTypePrivateUndefinedLazy = 0x0005,
32 SF_ThumbFunc = 0x0008,
33 SF_NoDeadStrip = 0x0020,
34 SF_WeakReference = 0x0040,
35 SF_WeakDefinition = 0x0080,
36 SF_SymbolResolver = 0x0100,
40 SF_CommonAlignmentMask = 0xF0FF,
41 SF_CommonAlignmentShift = 8
55 modifyFlags(Value ? SF_ReferenceTypeUndefinedLazy : 0,
56 SF_ReferenceTypeUndefinedLazy);
73 return getFlags() & SF_WeakReference;
80 return getFlags() & SF_WeakDefinition;
87 return getFlags() & SF_SymbolResolver;
102 assert(Value == (Value & SF_DescFlagsMask) &&
103 "Invalid .desc value!");
115 unsigned Log2Size =
Log2_32(Align);
116 assert((1U << Log2Size) == Align &&
"Invalid 'common' alignment!");
121 Flags = (Flags & SF_CommonAlignmentMask) |
122 (Log2Size << SF_CommonAlignmentShift);
126 if (EncodeAsAltEntry)
127 Flags |= SF_AltEntry;
bool isSymbolResolver() const
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
static bool classof(const MCSymbol *S)
void clearReferenceType() const
bool isNoDeadStrip() const
void setFlags(uint32_t Value) const
Set the (implementation defined) symbol flags.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void setWeakReference() const
void setWeakDefinition() const
bool isWeakReference() const
uint32_t getFlags() const
Get the (implementation defined) symbol flags.
bool isWeakDefinition() const
void modifyFlags(uint32_t Value, uint32_t Mask) const
Modify the flags via a mask.
void setDesc(unsigned Value) const
unsigned getCommonAlignment() const
Return the alignment of a 'common' symbol.
void setThumbFunc() const
void setReferenceTypeUndefinedLazy(bool Value) const
void setSymbolResolver() const
unsigned Log2_32(uint32_t Value)
Log2_32 - This function returns the floor log base 2 of the specified value, -1 if the value is zero...
void setNoDeadStrip() const
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
StringRef getName() const
getName - Get the symbol name.
uint16_t getEncodedFlags(bool EncodeAsAltEntry) const
Get the encoded value of the flags as they will be emitted in to the MachO binary.
bool isCommon() const
Is this a 'common' symbol.
MCSymbolMachO(const StringMapEntry< bool > *Name, bool isTemporary)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.