diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-30 20:32:26 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-30 20:32:26 +0000 |
commit | 10fcac7b0768dfb1d9fb3030f2bb664ad8e4e65b (patch) | |
tree | 061af9263ce956b767a139713c0d8ab2862b06a2 /llvm/lib/Object/MachOObjectFile.cpp | |
parent | 391e53812a5ec4ad8ef8cc4b9a9b81b1a7caf762 (diff) | |
download | bcm5719-llvm-10fcac7b0768dfb1d9fb3030f2bb664ad8e4e65b.tar.gz bcm5719-llvm-10fcac7b0768dfb1d9fb3030f2bb664ad8e4e65b.zip |
Use ErrorOr in getRelocationAdress.
We can probably do better in this method, but this is an improvement and
enables further ErrorOr cleanups.
llvm-svn: 241114
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index d79b4df66bf..51d96770fd7 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -595,15 +595,13 @@ void MachOObjectFile::moveRelocationNext(DataRefImpl &Rel) const { ++Rel.d.b; } -std::error_code MachOObjectFile::getRelocationAddress(DataRefImpl Rel, - uint64_t &Res) const { +ErrorOr<uint64_t> MachOObjectFile::getRelocationAddress(DataRefImpl Rel) const { uint64_t Offset = getRelocationOffset(Rel); DataRefImpl Sec; Sec.d.a = Rel.d.a; uint64_t SecAddress = getSectionAddress(Sec); - Res = SecAddress + Offset; - return std::error_code(); + return SecAddress + Offset; } uint64_t MachOObjectFile::getRelocationOffset(DataRefImpl Rel) const { |