aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/ObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ObjectFile.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp
index 31ec22b..27a9368 100644
--- a/llvm/lib/Object/ObjectFile.cpp
+++ b/llvm/lib/Object/ObjectFile.cpp
@@ -46,9 +46,9 @@ uint64_t ObjectFile::getSymbolValue(DataRefImpl Ref) const {
std::error_code ObjectFile::printSymbolName(raw_ostream &OS,
DataRefImpl Symb) const {
- ErrorOr<StringRef> Name = getSymbolName(Symb);
- if (std::error_code EC = Name.getError())
- return EC;
+ Expected<StringRef> Name = getSymbolName(Symb);
+ if (!Name)
+ return errorToErrorCode(Name.takeError());
OS << *Name;
return std::error_code();
}