[llvm-commits] [llvm] r132912 - /llvm/trunk/tools/llvm-nm/llvm-nm.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Mon Jun 13 04:12:42 PDT 2011
Author: mspencer
Date: Mon Jun 13 06:12:42 2011
New Revision: 132912
URL: http://llvm.org/viewvc/llvm-project?rev=132912&view=rev
Log:
Modify llvm-nm to use new Binary creation method.
Modified:
llvm/trunk/tools/llvm-nm/llvm-nm.cpp
Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=132912&r1=132911&r2=132912&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Mon Jun 13 06:12:42 2011
@@ -317,13 +317,13 @@
MultipleFiles = true;
std::for_each (Modules.begin(), Modules.end(), DumpSymbolNamesFromModule);
} else if (aPath.isObjectFile()) {
- std::auto_ptr<ObjectFile> obj(ObjectFile::createObjectFile(aPath.str()));
- if (!obj.get()) {
- errs() << ToolName << ": " << Filename << ": "
- << "Failed to open object file\n";
+ OwningPtr<Binary> obj;
+ if (error_code ec = object::createBinary(aPath.str(), obj)) {
+ errs() << ToolName << ": " << Filename << ": " << ec.message() << ".\n";
return;
}
- DumpSymbolNamesFromObject(obj.get());
+ if (object::ObjectFile *o = dyn_cast<ObjectFile>(obj.get()))
+ DumpSymbolNamesFromObject(o);
} else {
errs() << ToolName << ": " << Filename << ": "
<< "unrecognizable file type\n";
More information about the llvm-commits
mailing list