diff options
Diffstat (limited to 'include/llvm/Object/MachO.h')
-rw-r--r-- | include/llvm/Object/MachO.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h index 489ecef5c996..e02ce3b21416 100644 --- a/include/llvm/Object/MachO.h +++ b/include/llvm/Object/MachO.h @@ -100,7 +100,7 @@ private: }; typedef content_iterator<ExportEntry> export_iterator; -/// MachORebaseEntry encapsulates the current state in the decompression of +/// MachORebaseEntry encapsulates the current state in the decompression of /// rebasing opcodes. This allows you to iterate through the compressed table of /// rebasing using: /// for (const llvm::object::MachORebaseEntry &Entry : Obj->rebaseTable()) { @@ -116,7 +116,7 @@ public: bool operator==(const MachORebaseEntry &) const; void moveNext(); - + private: friend class MachOObjectFile; void moveToFirst(); @@ -210,8 +210,7 @@ public: uint64_t getCommonSymbolSizeImpl(DataRefImpl Symb) const override; SymbolRef::Type getSymbolType(DataRefImpl Symb) const override; uint32_t getSymbolFlags(DataRefImpl Symb) const override; - std::error_code getSymbolSection(DataRefImpl Symb, - section_iterator &Res) const override; + ErrorOr<section_iterator> getSymbolSection(DataRefImpl Symb) const override; unsigned getSymbolSectionID(SymbolRef Symb) const; unsigned getSectionID(SectionRef Sec) const; @@ -423,6 +422,24 @@ public: return v->isMachO(); } + static uint32_t + getVersionMinMajor(MachO::version_min_command &C, bool SDK) { + uint32_t VersionOrSDK = (SDK) ? C.sdk : C.version; + return (VersionOrSDK >> 16) & 0xffff; + } + + static uint32_t + getVersionMinMinor(MachO::version_min_command &C, bool SDK) { + uint32_t VersionOrSDK = (SDK) ? C.sdk : C.version; + return (VersionOrSDK >> 8) & 0xff; + } + + static uint32_t + getVersionMinUpdate(MachO::version_min_command &C, bool SDK) { + uint32_t VersionOrSDK = (SDK) ? C.sdk : C.version; + return VersionOrSDK & 0xff; + } + private: uint64_t getSymbolValueImpl(DataRefImpl Symb) const override; @@ -504,4 +521,3 @@ inline const ObjectFile *DiceRef::getObjectFile() const { } #endif - |