diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-30 01:53:01 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-30 01:53:01 +0000 |
commit | 99c041b72f5ac450cc80a95f61ee64bff6e32b82 (patch) | |
tree | 1e7bfc780dc730c25fb4bdbac2905c12fef0721f /llvm/lib/Object/MachOObjectFile.cpp | |
parent | 9ba0fec83e7f2eb76cbe53c899126a69827fa78d (diff) | |
download | bcm5719-llvm-99c041b72f5ac450cc80a95f61ee64bff6e32b82.tar.gz bcm5719-llvm-99c041b72f5ac450cc80a95f61ee64bff6e32b82.zip |
Don't return error_code from a function that doesn't fail.
llvm-svn: 241033
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index ef8daacee14..5de72125afe 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -654,19 +654,16 @@ MachOObjectFile::getRelocationSection(DataRefImpl Rel) const { return section_iterator(getAnyRelocationSection(getRelocation(Rel))); } -std::error_code MachOObjectFile::getRelocationType(DataRefImpl Rel, - uint64_t &Res) const { +uint64_t MachOObjectFile::getRelocationType(DataRefImpl Rel) const { MachO::any_relocation_info RE = getRelocation(Rel); - Res = getAnyRelocationType(RE); - return std::error_code(); + return getAnyRelocationType(RE); } std::error_code MachOObjectFile::getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl<char> &Result) const { StringRef res; - uint64_t RType; - getRelocationType(Rel, RType); + uint64_t RType = getRelocationType(Rel); unsigned Arch = this->getArch(); @@ -776,8 +773,7 @@ MachOObjectFile::getRelocationTypeName(DataRefImpl Rel, std::error_code MachOObjectFile::getRelocationHidden(DataRefImpl Rel, bool &Result) const { unsigned Arch = getArch(); - uint64_t Type; - getRelocationType(Rel, Type); + uint64_t Type = getRelocationType(Rel); Result = false; @@ -791,8 +787,7 @@ std::error_code MachOObjectFile::getRelocationHidden(DataRefImpl Rel, if (Type == MachO::X86_64_RELOC_UNSIGNED && Rel.d.a > 0) { DataRefImpl RelPrev = Rel; RelPrev.d.a--; - uint64_t PrevType; - getRelocationType(RelPrev, PrevType); + uint64_t PrevType = getRelocationType(RelPrev); if (PrevType == MachO::X86_64_RELOC_SUBTRACTOR) Result = true; } |