summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-06-24 18:24:42 +0000
committerKevin Enderby <enderby@apple.com>2016-06-24 18:24:42 +0000
commit931cb65df27d07f83c06f5a001a5368edf1655f9 (patch)
tree3dcdeca438903084244e98d5fd57711d3591998c /llvm/lib/Object/MachOObjectFile.cpp
parent267164df0ab6d1e61f1420feddee96b1938cb577 (diff)
downloadbcm5719-llvm-931cb65df27d07f83c06f5a001a5368edf1655f9.tar.gz
bcm5719-llvm-931cb65df27d07f83c06f5a001a5368edf1655f9.zip
Thread Expected<...> up from libObject’s getSymbolAddress() for symbols to allow
a good error message to be produced. This is nearly the last libObject interface that used ErrorOr and the last one that appears in llvm/include/llvm/Object/MachO.h . For Mach-O objects this is just a clean up because it’s version of getSymbolAddress() can’t return an error. I will leave it to the experts on COFF and ELF to actually add meaning full error messages in their tests if they wish. And also leave it to these experts to change the last two ErrorOr interfaces in llvm/include/llvm/Object/ObjectFile.h for createCOFFObjectFile() and createELFObjectFile() if they wish. Since there are no test cases for COFF and ELF error cases with respect to getSymbolAddress() in the test suite this is no functional change (NFC). llvm-svn: 273701
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index d7ec3e57a58..3c88f9fb382 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -473,7 +473,7 @@ uint64_t MachOObjectFile::getSymbolValueImpl(DataRefImpl Sym) const {
return getNValue(Sym);
}
-ErrorOr<uint64_t> MachOObjectFile::getSymbolAddress(DataRefImpl Sym) const {
+Expected<uint64_t> MachOObjectFile::getSymbolAddress(DataRefImpl Sym) const {
return getSymbolValue(Sym);
}
OpenPOWER on IntegriCloud