mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-19 04:26:05 +00:00
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
This commit is contained in:
@@ -833,11 +833,12 @@ static void DumpInput(StringRef file) {
|
||||
}
|
||||
|
||||
// Attempt to open the binary.
|
||||
OwningPtr<Binary> binary;
|
||||
if (error_code ec = createBinary(file, binary)) {
|
||||
errs() << ToolName << ": '" << file << "': " << ec.message() << ".\n";
|
||||
ErrorOr<Binary *> BinaryOrErr = createBinary(file);
|
||||
if (error_code EC = BinaryOrErr.getError()) {
|
||||
errs() << ToolName << ": '" << file << "': " << EC.message() << ".\n";
|
||||
return;
|
||||
}
|
||||
OwningPtr<Binary> binary(BinaryOrErr.get());
|
||||
|
||||
if (Archive *a = dyn_cast<Archive>(binary.get()))
|
||||
DumpArchive(a);
|
||||
|
Reference in New Issue
Block a user