diff options
Diffstat (limited to 'include/llvm/MC/MCSymbolMachO.h')
-rw-r--r-- | include/llvm/MC/MCSymbolMachO.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/llvm/MC/MCSymbolMachO.h b/include/llvm/MC/MCSymbolMachO.h index 5b0321fe9f732..25220e4a81090 100644 --- a/include/llvm/MC/MCSymbolMachO.h +++ b/include/llvm/MC/MCSymbolMachO.h @@ -9,6 +9,7 @@ #ifndef LLVM_MC_MCSYMBOLMACHO_H #define LLVM_MC_MCSYMBOLMACHO_H +#include "llvm/ADT/Twine.h" #include "llvm/MC/MCSymbol.h" namespace llvm { @@ -33,6 +34,7 @@ class MCSymbolMachO : public MCSymbol { SF_WeakReference = 0x0040, SF_WeakDefinition = 0x0080, SF_SymbolResolver = 0x0100, + SF_AltEntry = 0x0200, // Common alignment SF_CommonAlignmentMask = 0xF0FF, @@ -88,6 +90,14 @@ public: modifyFlags(SF_SymbolResolver, SF_SymbolResolver); } + void setAltEntry() const { + modifyFlags(SF_AltEntry, SF_AltEntry); + } + + bool isAltEntry() const { + return getFlags() & SF_AltEntry; + } + void setDesc(unsigned Value) const { assert(Value == (Value & SF_DescFlagsMask) && "Invalid .desc value!"); @@ -96,7 +106,7 @@ public: /// \brief Get the encoded value of the flags as they will be emitted in to /// the MachO binary - uint16_t getEncodedFlags() const { + uint16_t getEncodedFlags(bool EncodeAsAltEntry) const { uint16_t Flags = getFlags(); // Common alignment is packed into the 'desc' bits. @@ -113,6 +123,9 @@ public: } } + if (EncodeAsAltEntry) + Flags |= SF_AltEntry; + return Flags; } |