diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-30 03:33:18 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-30 03:33:18 +0000 |
commit | f69ac42ac401aa0b0f17d47eea9531ec0d566e98 (patch) | |
tree | cb3856e96102866765f89bc38e347b835a03fcc1 /llvm/lib/Object/MachOObjectFile.cpp | |
parent | 149e6031323d6507860909a5cbb449fb2d0e0210 (diff) | |
download | bcm5719-llvm-f69ac42ac401aa0b0f17d47eea9531ec0d566e98.tar.gz bcm5719-llvm-f69ac42ac401aa0b0f17d47eea9531ec0d566e98.zip |
Don't return error_code from a function that doesn't fail.
llvm-svn: 241039
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 5de72125afe..14f74c70a66 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -770,17 +770,15 @@ MachOObjectFile::getRelocationTypeName(DataRefImpl Rel, return std::error_code(); } -std::error_code MachOObjectFile::getRelocationHidden(DataRefImpl Rel, - bool &Result) const { +bool MachOObjectFile::getRelocationHidden(DataRefImpl Rel) const { unsigned Arch = getArch(); uint64_t Type = getRelocationType(Rel); - Result = false; - // On arches that use the generic relocations, GENERIC_RELOC_PAIR // is always hidden. if (Arch == Triple::x86 || Arch == Triple::arm || Arch == Triple::ppc) { - if (Type == MachO::GENERIC_RELOC_PAIR) Result = true; + if (Type == MachO::GENERIC_RELOC_PAIR) + return true; } else if (Arch == Triple::x86_64) { // On x86_64, X86_64_RELOC_UNSIGNED is hidden only when it follows // an X86_64_RELOC_SUBTRACTOR. @@ -789,11 +787,11 @@ std::error_code MachOObjectFile::getRelocationHidden(DataRefImpl Rel, RelPrev.d.a--; uint64_t PrevType = getRelocationType(RelPrev); if (PrevType == MachO::X86_64_RELOC_SUBTRACTOR) - Result = true; + return true; } } - return std::error_code(); + return false; } uint8_t MachOObjectFile::getRelocationLength(DataRefImpl Rel) const { |