9 #ifndef LLVM_MC_MCSYMBOLMACHO_H
10 #define LLVM_MC_MCSYMBOLMACHO_H
18 enum MachOSymbolFlags : uint16_t {
19 SF_DescFlagsMask = 0xFFFF,
22 SF_ReferenceTypeMask = 0x0007,
23 SF_ReferenceTypeUndefinedNonLazy = 0x0000,
24 SF_ReferenceTypeUndefinedLazy = 0x0001,
25 SF_ReferenceTypeDefined = 0x0002,
26 SF_ReferenceTypePrivateDefined = 0x0003,
27 SF_ReferenceTypePrivateUndefinedNonLazy = 0x0004,
28 SF_ReferenceTypePrivateUndefinedLazy = 0x0005,
31 SF_ThumbFunc = 0x0008,
32 SF_NoDeadStrip = 0x0020,
33 SF_WeakReference = 0x0040,
34 SF_WeakDefinition = 0x0080,
35 SF_SymbolResolver = 0x0100,
38 SF_CommonAlignmentMask = 0xF0FF,
39 SF_CommonAlignmentShift = 8
53 modifyFlags(Value ? SF_ReferenceTypeUndefinedLazy : 0,
54 SF_ReferenceTypeUndefinedLazy);
71 return getFlags() & SF_WeakReference;
78 return getFlags() & SF_WeakDefinition;
85 return getFlags() & SF_SymbolResolver;
92 assert(Value == (Value & SF_DescFlagsMask) &&
93 "Invalid .desc value!");
106 assert((1U << Log2Size) ==
Align &&
"Invalid 'common' alignment!");
111 Flags = (Flags & SF_CommonAlignmentMask) |
112 (Log2Size << SF_CommonAlignmentShift);
bool isSymbolResolver() const
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
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
Reports a serious error, calling any installed error handler.
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
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
uint16_t getEncodedFlags() const
Get the encoded value of the flags as they will be emitted in to the MachO binary.
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.
bool isCommon() const
Is this a 'common' symbol.
MCSymbolMachO(const StringMapEntry< bool > *Name, bool isTemporary)
LLVM Value Representation.