summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/ObjectFile.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-10-18 05:17:23 +0000
committerJustin Bogner <mail@justinbogner.com>2016-10-18 05:17:23 +0000
commitb7c9deb5870358b9a7a655053e27d20b5c6ba442 (patch)
tree89fce34dd99496b6d1391a3a8e5056afb07a0790 /llvm/lib/Object/ObjectFile.cpp
parent448358b5f1f5db2e821641302aec4eba4d0a1df0 (diff)
downloadbcm5719-llvm-b7c9deb5870358b9a7a655053e27d20b5c6ba442.tar.gz
bcm5719-llvm-b7c9deb5870358b9a7a655053e27d20b5c6ba442.zip
Object: Add a missing return in ObjectFile::createObjectFile
When Error was threaded through these APIs back in r265606 the "return" was missed here, which triggers a warning if/when I add LLVM_NODISCARD to the Error type. llvm-svn: 284454
Diffstat (limited to 'llvm/lib/Object/ObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ObjectFile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp
index 92f9c1f4f0a..bd50773417c 100644
--- a/llvm/lib/Object/ObjectFile.cpp
+++ b/llvm/lib/Object/ObjectFile.cpp
@@ -118,8 +118,8 @@ ObjectFile::createObjectFile(StringRef ObjectPath) {
Expected<std::unique_ptr<ObjectFile>> ObjOrErr =
createObjectFile(Buffer->getMemBufferRef());
- if (!ObjOrErr)
- ObjOrErr.takeError();
+ if (Error Err = ObjOrErr.takeError())
+ return std::move(Err);
std::unique_ptr<ObjectFile> Obj = std::move(ObjOrErr.get());
return OwningBinary<ObjectFile>(std::move(Obj), std::move(Buffer));
OpenPOWER on IntegriCloud