mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 01:25:10 +00:00
Use std::unique_ptr to make the ownership explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -74,12 +74,13 @@ static void DumpInput(const StringRef &Filename) {
|
||||
return;
|
||||
}
|
||||
|
||||
ErrorOr<ObjectFile *> ObjOrErr(ObjectFile::createObjectFile(Buff.get()));
|
||||
ErrorOr<std::unique_ptr<ObjectFile>> ObjOrErr =
|
||||
ObjectFile::createObjectFile(Buff.get());
|
||||
if (std::error_code EC = ObjOrErr.getError()) {
|
||||
errs() << Filename << ": " << EC.message() << '\n';
|
||||
return;
|
||||
}
|
||||
std::unique_ptr<ObjectFile> Obj(ObjOrErr.get());
|
||||
std::unique_ptr<ObjectFile> Obj = std::move(ObjOrErr.get());
|
||||
|
||||
std::unique_ptr<DIContext> DICtx(DIContext::getDWARFContext(Obj.get()));
|
||||
|
||||
|
Reference in New Issue
Block a user