diff options
Diffstat (limited to 'include/llvm/Object/MachO.h')
-rw-r--r-- | include/llvm/Object/MachO.h | 106 |
1 files changed, 60 insertions, 46 deletions
diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h index ab5b462e01..6e1ab253ec 100644 --- a/include/llvm/Object/MachO.h +++ b/include/llvm/Object/MachO.h @@ -40,9 +40,9 @@ public: void moveNext(); - error_code getOffset(uint32_t &Result) const; - error_code getLength(uint16_t &Result) const; - error_code getKind(uint16_t &Result) const; + std::error_code getOffset(uint32_t &Result) const; + std::error_code getLength(uint16_t &Result) const; + std::error_code getKind(uint16_t &Result) const; DataRefImpl getRawDataRefImpl() const; const ObjectFile *getObjectFile() const; @@ -57,60 +57,74 @@ public: }; MachOObjectFile(MemoryBuffer *Object, bool IsLittleEndian, bool Is64Bits, - error_code &EC, bool BufferOwned = true); + std::error_code &EC, bool BufferOwned = true); void moveSymbolNext(DataRefImpl &Symb) const override; - error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const override; + std::error_code getSymbolName(DataRefImpl Symb, + StringRef &Res) const override; // MachO specific. - error_code getIndirectName(DataRefImpl Symb, StringRef &Res) const; - - error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const override; - error_code getSymbolAlignment(DataRefImpl Symb, uint32_t &Res) const override; - error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override; - error_code getSymbolType(DataRefImpl Symb, - SymbolRef::Type &Res) const override; + std::error_code getIndirectName(DataRefImpl Symb, StringRef &Res) const; + + std::error_code getSymbolAddress(DataRefImpl Symb, + uint64_t &Res) const override; + std::error_code getSymbolAlignment(DataRefImpl Symb, + uint32_t &Res) const override; + std::error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override; + std::error_code getSymbolType(DataRefImpl Symb, + SymbolRef::Type &Res) const override; uint32_t getSymbolFlags(DataRefImpl Symb) const override; - error_code getSymbolSection(DataRefImpl Symb, - section_iterator &Res) const override; + std::error_code getSymbolSection(DataRefImpl Symb, + section_iterator &Res) const override; void moveSectionNext(DataRefImpl &Sec) const override; - error_code getSectionName(DataRefImpl Sec, StringRef &Res) const override; - error_code getSectionAddress(DataRefImpl Sec, uint64_t &Res) const override; - error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override; - error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const override; - error_code getSectionAlignment(DataRefImpl Sec, uint64_t &Res) const override; - error_code isSectionText(DataRefImpl Sec, bool &Res) const override; - error_code isSectionData(DataRefImpl Sec, bool &Res) const override; - error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override; - error_code isSectionRequiredForExecution(DataRefImpl Sec, - bool &Res) const override; - error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const override; - error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override; - error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const override; - error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb, - bool &Result) const override; + std::error_code getSectionName(DataRefImpl Sec, + StringRef &Res) const override; + std::error_code getSectionAddress(DataRefImpl Sec, + uint64_t &Res) const override; + std::error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override; + std::error_code getSectionContents(DataRefImpl Sec, + StringRef &Res) const override; + std::error_code getSectionAlignment(DataRefImpl Sec, + uint64_t &Res) const override; + std::error_code isSectionText(DataRefImpl Sec, bool &Res) const override; + std::error_code isSectionData(DataRefImpl Sec, bool &Res) const override; + std::error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override; + std::error_code isSectionRequiredForExecution(DataRefImpl Sec, + bool &Res) const override; + std::error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const override; + std::error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override; + std::error_code isSectionReadOnlyData(DataRefImpl Sec, + bool &Res) const override; + std::error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb, + bool &Result) const override; relocation_iterator section_rel_begin(DataRefImpl Sec) const override; relocation_iterator section_rel_end(DataRefImpl Sec) const override; void moveRelocationNext(DataRefImpl &Rel) const override; - error_code getRelocationAddress(DataRefImpl Rel, - uint64_t &Res) const override; - error_code getRelocationOffset(DataRefImpl Rel, uint64_t &Res) const override; + std::error_code getRelocationAddress(DataRefImpl Rel, + uint64_t &Res) const override; + std::error_code getRelocationOffset(DataRefImpl Rel, + uint64_t &Res) const override; symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override; - error_code getRelocationType(DataRefImpl Rel, uint64_t &Res) const override; - error_code getRelocationTypeName(DataRefImpl Rel, - SmallVectorImpl<char> &Result) const override; - error_code getRelocationValueString(DataRefImpl Rel, - SmallVectorImpl<char> &Result) const override; - error_code getRelocationHidden(DataRefImpl Rel, bool &Result) const override; - - error_code getLibraryNext(DataRefImpl LibData, - LibraryRef &Res) const override; - error_code getLibraryPath(DataRefImpl LibData, StringRef &Res) const override; + std::error_code getRelocationType(DataRefImpl Rel, + uint64_t &Res) const override; + std::error_code + getRelocationTypeName(DataRefImpl Rel, + SmallVectorImpl<char> &Result) const override; + std::error_code + getRelocationValueString(DataRefImpl Rel, + SmallVectorImpl<char> &Result) const override; + std::error_code getRelocationHidden(DataRefImpl Rel, + bool &Result) const override; + + std::error_code getLibraryNext(DataRefImpl LibData, + LibraryRef &Res) const override; + std::error_code getLibraryPath(DataRefImpl LibData, + StringRef &Res) const override; // MachO specific. - error_code getLibraryShortNameByIndex(unsigned Index, StringRef &Res); + std::error_code getLibraryShortNameByIndex(unsigned Index, StringRef &Res); // TODO: Would be useful to have an iterator based version // of the load command interface too. @@ -248,7 +262,7 @@ inline void DiceRef::moveNext() { // the OwningObject ObjectFile is a MachOObjectFile a static_cast<> is used for // the methods that get the values of the fields of the reference. -inline error_code DiceRef::getOffset(uint32_t &Result) const { +inline std::error_code DiceRef::getOffset(uint32_t &Result) const { const MachOObjectFile *MachOOF = static_cast<const MachOObjectFile *>(OwningObject); MachO::data_in_code_entry Dice = MachOOF->getDice(DicePimpl); @@ -256,7 +270,7 @@ inline error_code DiceRef::getOffset(uint32_t &Result) const { return object_error::success; } -inline error_code DiceRef::getLength(uint16_t &Result) const { +inline std::error_code DiceRef::getLength(uint16_t &Result) const { const MachOObjectFile *MachOOF = static_cast<const MachOObjectFile *>(OwningObject); MachO::data_in_code_entry Dice = MachOOF->getDice(DicePimpl); @@ -264,7 +278,7 @@ inline error_code DiceRef::getLength(uint16_t &Result) const { return object_error::success; } -inline error_code DiceRef::getKind(uint16_t &Result) const { +inline std::error_code DiceRef::getKind(uint16_t &Result) const { const MachOObjectFile *MachOOF = static_cast<const MachOObjectFile *>(OwningObject); MachO::data_in_code_entry Dice = MachOOF->getDice(DicePimpl); |