diff options
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Object/COFF.h | 3 | ||||
| -rw-r--r-- | llvm/include/llvm/Object/ELFObjectFile.h | 11 | ||||
| -rw-r--r-- | llvm/include/llvm/Object/MachO.h | 3 | ||||
| -rw-r--r-- | llvm/include/llvm/Object/ObjectFile.h | 9 |
4 files changed, 10 insertions, 16 deletions
diff --git a/llvm/include/llvm/Object/COFF.h b/llvm/include/llvm/Object/COFF.h index ce12aab6fba..21feebd339e 100644 --- a/llvm/include/llvm/Object/COFF.h +++ b/llvm/include/llvm/Object/COFF.h @@ -678,8 +678,7 @@ protected: uint64_t &Res) const override; uint64_t getRelocationOffset(DataRefImpl Rel) const override; symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override; - std::error_code getRelocationType(DataRefImpl Rel, - uint64_t &Res) const override; + uint64_t getRelocationType(DataRefImpl Rel) const override; std::error_code getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl<char> &Result) const override; diff --git a/llvm/include/llvm/Object/ELFObjectFile.h b/llvm/include/llvm/Object/ELFObjectFile.h index b21a1a1c99c..e7b3ce18ae5 100644 --- a/llvm/include/llvm/Object/ELFObjectFile.h +++ b/llvm/include/llvm/Object/ELFObjectFile.h @@ -233,8 +233,7 @@ protected: uint64_t &Res) const override; uint64_t getRelocationOffset(DataRefImpl Rel) const override; symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override; - std::error_code getRelocationType(DataRefImpl Rel, - uint64_t &Res) const override; + uint64_t getRelocationType(DataRefImpl Rel) const override; std::error_code getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl<char> &Result) const override; @@ -725,14 +724,12 @@ uint64_t ELFObjectFile<ELFT>::getROffset(DataRefImpl Rel) const { } template <class ELFT> -std::error_code ELFObjectFile<ELFT>::getRelocationType(DataRefImpl Rel, - uint64_t &Result) const { +uint64_t ELFObjectFile<ELFT>::getRelocationType(DataRefImpl Rel) const { const Elf_Shdr *sec = getRelSection(Rel); if (sec->sh_type == ELF::SHT_REL) - Result = getRel(Rel)->getType(EF.isMips64EL()); + return getRel(Rel)->getType(EF.isMips64EL()); else - Result = getRela(Rel)->getType(EF.isMips64EL()); - return std::error_code(); + return getRela(Rel)->getType(EF.isMips64EL()); } template <class ELFT> diff --git a/llvm/include/llvm/Object/MachO.h b/llvm/include/llvm/Object/MachO.h index 43f8b0a11e2..c067a7023c1 100644 --- a/llvm/include/llvm/Object/MachO.h +++ b/llvm/include/llvm/Object/MachO.h @@ -240,8 +240,7 @@ public: uint64_t getRelocationOffset(DataRefImpl Rel) const override; symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override; section_iterator getRelocationSection(DataRefImpl Rel) const; - std::error_code getRelocationType(DataRefImpl Rel, - uint64_t &Res) const override; + uint64_t getRelocationType(DataRefImpl Rel) const override; std::error_code getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl<char> &Result) const override; diff --git a/llvm/include/llvm/Object/ObjectFile.h b/llvm/include/llvm/Object/ObjectFile.h index ba7a5c4f2ef..3fcafc966e5 100644 --- a/llvm/include/llvm/Object/ObjectFile.h +++ b/llvm/include/llvm/Object/ObjectFile.h @@ -53,7 +53,7 @@ public: std::error_code getAddress(uint64_t &Result) const; uint64_t getOffset() const; symbol_iterator getSymbol() const; - std::error_code getType(uint64_t &Result) const; + uint64_t getType() const; /// @brief Indicates whether this relocation should hidden when listing /// relocations, usually because it is the trailing part of a multipart @@ -242,8 +242,7 @@ protected: uint64_t &Res) const = 0; virtual uint64_t getRelocationOffset(DataRefImpl Rel) const = 0; virtual symbol_iterator getRelocationSymbol(DataRefImpl Rel) const = 0; - virtual std::error_code getRelocationType(DataRefImpl Rel, - uint64_t &Res) const = 0; + virtual uint64_t getRelocationType(DataRefImpl Rel) const = 0; virtual std::error_code getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl<char> &Result) const = 0; @@ -464,8 +463,8 @@ inline symbol_iterator RelocationRef::getSymbol() const { return OwningObject->getRelocationSymbol(RelocationPimpl); } -inline std::error_code RelocationRef::getType(uint64_t &Result) const { - return OwningObject->getRelocationType(RelocationPimpl, Result); +inline uint64_t RelocationRef::getType() const { + return OwningObject->getRelocationType(RelocationPimpl); } inline std::error_code |

