aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-07-03 18:19:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-07-03 18:19:00 +0000
commited067c45d4b668db740fbb1728200fc51f4b9b51 (patch)
treecc50ae3d78954ad1e634cbd4278eec6095a50bdb /llvm/lib/Object/MachOObjectFile.cpp
parente2df87f24b0af7fa80789e8da15c9cef9e6996f7 (diff)
downloadllvm-ed067c45d4b668db740fbb1728200fc51f4b9b51.zip
llvm-ed067c45d4b668db740fbb1728200fc51f4b9b51.tar.gz
llvm-ed067c45d4b668db740fbb1728200fc51f4b9b51.tar.bz2
Return ErrorOr from getSymbolAddress.
It can fail trying to get the section on ELF and COFF. This makes sure the error is handled. llvm-svn: 241366
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 53ea444..9671833 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -376,10 +376,8 @@ uint64_t MachOObjectFile::getSymbolValue(DataRefImpl Sym) const {
return NValue;
}
-std::error_code MachOObjectFile::getSymbolAddress(DataRefImpl Sym,
- uint64_t &Res) const {
- Res = getSymbolValue(Sym);
- return std::error_code();
+ErrorOr<uint64_t> MachOObjectFile::getSymbolAddress(DataRefImpl Sym) const {
+ return getSymbolValue(Sym);
}
uint32_t MachOObjectFile::getSymbolAlignment(DataRefImpl DRI) const {