summaryrefslogtreecommitdiff
path: root/tools/macho-dump
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-15 19:37:43 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-15 19:37:43 +0000
commit1fca78a9b1d78ac2e05174e8b8b0eda5fe4ab8b3 (patch)
tree442cb69d47dec1c6c5ba601e847365ee625328a7 /tools/macho-dump
parent0893113a05af8b67799965685e96c11a59908a95 (diff)
Return an ErrorOr<Binary *> from createBinary.
I did write a version returning ErrorOr<OwningPtr<Binary> >, but it is too cumbersome to use without std::move. I will keep the patch locally and submit when we switch to c++11. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199326 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/macho-dump')
-rw-r--r--tools/macho-dump/macho-dump.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/macho-dump/macho-dump.cpp b/tools/macho-dump/macho-dump.cpp
index 0dfbd5fa09a..4e7a0b875f1 100644
--- a/tools/macho-dump/macho-dump.cpp
+++ b/tools/macho-dump/macho-dump.cpp
@@ -379,9 +379,10 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, "llvm Mach-O dumping tool\n");
- OwningPtr<Binary> Binary;
- if (error_code EC = createBinary(InputFile, Binary))
+ ErrorOr<Binary *> BinaryOrErr = createBinary(InputFile);
+ if (error_code EC = BinaryOrErr.getError())
return Error("unable to read input: '" + EC.message() + "'");
+ OwningPtr<Binary> Binary(BinaryOrErr.get());
const MachOObjectFile *InputObject = dyn_cast<MachOObjectFile>(Binary.get());
if (!InputObject)