1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

Use object::Archive::create instead of new object::Archive.

Also fix the error handling. No testcaes, issue found by inspection.

Thanks to David Blaikie for the suggestion.

llvm-svn: 214535
This commit is contained in:
Rafael Espindola 2014-08-01 18:31:17 +00:00
parent 9ca9533b96
commit 17009931ab

View File

@ -544,15 +544,14 @@ int main(int argc, char **argv, char * const *envp) {
Err.print(argv[0], errs());
return 1;
}
std::error_code EC;
std::unique_ptr<object::Archive> Ar =
llvm::make_unique<object::Archive>(std::move(ArBuf.get()), EC);
assert(Ar);
if (EC) {
Err.print(argv[0], errs());
ErrorOr<std::unique_ptr<object::Archive>> ArOrErr =
object::Archive::create(std::move(ArBuf.get()));
if (std::error_code EC = ArOrErr.getError()) {
errs() << EC.message();
return 1;
}
EE->addArchive(std::move(Ar));
EE->addArchive(std::move(ArOrErr.get()));
}
// If the target is Cygwin/MingW and we are generating remote code, we