summaryrefslogtreecommitdiff
path: root/tools/llvm-cxxdump
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
commit317de7ce5b4a6c3dfbc24c3234c1082a8dcf9130 (patch)
tree764bab7eee74593d319c0d77b526a9edac64208a /tools/llvm-cxxdump
parent546c8eba34ca4d7227c003a916438436337147d3 (diff)
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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-cxxdump')
-rw-r--r--tools/llvm-cxxdump/llvm-cxxdump.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/llvm-cxxdump/llvm-cxxdump.cpp b/tools/llvm-cxxdump/llvm-cxxdump.cpp
index 16ea629260d..0c408ccb5ba 100644
--- a/tools/llvm-cxxdump/llvm-cxxdump.cpp
+++ b/tools/llvm-cxxdump/llvm-cxxdump.cpp
@@ -190,8 +190,8 @@ static void dumpCXXData(const ObjectFile *Obj) {
continue;
StringRef SecContents;
error(Sec.getContents(SecContents));
- ErrorOr<uint64_t> SymAddressOrErr = Sym.getAddress();
- error(SymAddressOrErr.getError());
+ Expected<uint64_t> SymAddressOrErr = Sym.getAddress();
+ error(errorToErrorCode(SymAddressOrErr.takeError()));
uint64_t SymAddress = *SymAddressOrErr;
uint64_t SecAddress = Sec.getAddress();
uint64_t SecSize = Sec.getSize();