diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Object/COFF.h | 1 | ||||
-rw-r--r-- | include/llvm/Object/MachO.h | 1 | ||||
-rw-r--r-- | include/llvm/Object/ObjectFile.h | 9 | ||||
-rw-r--r-- | include/llvm/Support/MachO.h | 3 |
4 files changed, 13 insertions, 1 deletions
diff --git a/include/llvm/Object/COFF.h b/include/llvm/Object/COFF.h index 321bceee64..5cb87edca4 100644 --- a/include/llvm/Object/COFF.h +++ b/include/llvm/Object/COFF.h @@ -106,6 +106,7 @@ protected: virtual error_code getSymbolNMTypeChar(DataRefImpl Symb, char &Res) const; virtual error_code isSymbolInternal(DataRefImpl Symb, bool &Res) const; virtual error_code isSymbolGlobal(DataRefImpl Symb, bool &Res) const; + virtual error_code isSymbolWeak(DataRefImpl Symb, bool &Res) const; virtual error_code getSymbolType(DataRefImpl Symb, SymbolRef::Type &Res) const; virtual error_code getSectionNext(DataRefImpl Sec, SectionRef &Res) const; diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h index 147987e8f1..fe1c4ded07 100644 --- a/include/llvm/Object/MachO.h +++ b/include/llvm/Object/MachO.h @@ -54,6 +54,7 @@ protected: virtual error_code getSymbolNMTypeChar(DataRefImpl Symb, char &Res) const; virtual error_code isSymbolInternal(DataRefImpl Symb, bool &Res) const; virtual error_code isSymbolGlobal(DataRefImpl Symb, bool &Res) const; + virtual error_code isSymbolWeak(DataRefImpl Symb, bool &Res) const; virtual error_code getSymbolType(DataRefImpl Symb, SymbolRef::Type &Res) const; virtual error_code getSectionNext(DataRefImpl Sec, SectionRef &Res) const; diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h index a0be264fe7..4fd73c667a 100644 --- a/include/llvm/Object/ObjectFile.h +++ b/include/llvm/Object/ObjectFile.h @@ -121,6 +121,9 @@ public: /// such as library functions error_code isGlobal(bool &Result) const; + /// Returns true for weak symbols. + error_code isWeak(bool &Result) const; + DataRefImpl getRawDataRefImpl() const; }; typedef content_iterator<SymbolRef> symbol_iterator; @@ -234,7 +237,7 @@ protected: virtual error_code getSymbolNMTypeChar(DataRefImpl Symb, char &Res) const = 0; virtual error_code isSymbolInternal(DataRefImpl Symb, bool &Res) const = 0; virtual error_code isSymbolGlobal(DataRefImpl Symb, bool &Res) const = 0; - + virtual error_code isSymbolWeak(DataRefImpl Symb, bool &Res) const = 0; // Same as above for SectionRef. friend class SectionRef; @@ -345,6 +348,10 @@ inline error_code SymbolRef::isGlobal(bool &Result) const { return OwningObject->isSymbolGlobal(SymbolPimpl, Result); } +inline error_code SymbolRef::isWeak(bool &Result) const { + return OwningObject->isSymbolWeak(SymbolPimpl, Result); +} + inline error_code SymbolRef::getType(SymbolRef::Type &Result) const { return OwningObject->getSymbolType(SymbolPimpl, Result); } diff --git a/include/llvm/Support/MachO.h b/include/llvm/Support/MachO.h index 5b6858613f..493491aab8 100644 --- a/include/llvm/Support/MachO.h +++ b/include/llvm/Support/MachO.h @@ -240,6 +240,9 @@ namespace llvm { NListSectionNoSection = 0u, // NO_SECT NListSectionMaxSection = 0xffu, // MAX_SECT + NListDescWeakRef = 0x40u, + NListDescWeakDef = 0x80u, + // Constant values for the "n_type" field in llvm::MachO::nlist and // llvm::MachO::nlist_64 when "(n_type & NlistMaskStab) != 0" StabGlobalSymbol = 0x20u, // N_GSYM |