Remove some calls to std::move.
Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get
a reference to it.
Thanks to David Blaikie for the suggestion.
llvm-svn: 214516
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index 33bb766..4e65d44 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -80,12 +80,12 @@
errs() << Filename << ": " << EC.message() << '\n';
return;
}
- std::unique_ptr<ObjectFile> Obj = std::move(ObjOrErr.get());
+ ObjectFile &Obj = *ObjOrErr.get();
- std::unique_ptr<DIContext> DICtx(DIContext::getDWARFContext(*Obj));
+ std::unique_ptr<DIContext> DICtx(DIContext::getDWARFContext(Obj));
outs() << Filename
- << ":\tfile format " << Obj->getFileFormatName() << "\n\n";
+ << ":\tfile format " << Obj.getFileFormatName() << "\n\n";
// Dump the complete DWARF structure.
DICtx->dump(outs(), DumpType);
}