diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-29 23:29:12 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-29 23:29:12 +0000 |
commit | 96d071cd0ccc53bbf94bcd6ed4b52c9006b17e15 (patch) | |
tree | 23fbac45fb7ee7c71bcb7d3207e4ee6bea0c14b4 /llvm/lib/Object/MachOObjectFile.cpp | |
parent | 79cfd437b5fcb71d4b748831db888c700231c0c4 (diff) | |
download | bcm5719-llvm-96d071cd0ccc53bbf94bcd6ed4b52c9006b17e15.tar.gz bcm5719-llvm-96d071cd0ccc53bbf94bcd6ed4b52c9006b17e15.zip |
Don't return error_code from function that never fails.
llvm-svn: 241021
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index bb914eea29b..ef8daacee14 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -612,8 +612,7 @@ void MachOObjectFile::moveRelocationNext(DataRefImpl &Rel) const { std::error_code MachOObjectFile::getRelocationAddress(DataRefImpl Rel, uint64_t &Res) const { - uint64_t Offset; - getRelocationOffset(Rel, Offset); + uint64_t Offset = getRelocationOffset(Rel); DataRefImpl Sec; Sec.d.a = Rel.d.a; @@ -622,13 +621,11 @@ std::error_code MachOObjectFile::getRelocationAddress(DataRefImpl Rel, return std::error_code(); } -std::error_code MachOObjectFile::getRelocationOffset(DataRefImpl Rel, - uint64_t &Res) const { +uint64_t MachOObjectFile::getRelocationOffset(DataRefImpl Rel) const { assert(getHeader().filetype == MachO::MH_OBJECT && "Only implemented for MH_OBJECT"); MachO::any_relocation_info RE = getRelocation(Rel); - Res = getAnyRelocationAddress(RE); - return std::error_code(); + return getAnyRelocationAddress(RE); } symbol_iterator |