aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-nm
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-06-25 17:54:59 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-06-25 17:54:59 +0000
commit76fb9b0e5f553f03321777ff634eb245dd8a821e (patch)
treefff6c4bec7e04c1e96dc934aae1fd860bca9af1a /tools/llvm-nm
parent001c9205fca2220480589ec355cb6ec701a37e08 (diff)
downloadexternal_llvm-76fb9b0e5f553f03321777ff634eb245dd8a821e.zip
external_llvm-76fb9b0e5f553f03321777ff634eb245dd8a821e.tar.gz
external_llvm-76fb9b0e5f553f03321777ff634eb245dd8a821e.tar.bz2
Modify llvm-nm to use new Binary creation method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-nm')
-rw-r--r--tools/llvm-nm/llvm-nm.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp
index 5315b6c..f6eb33c 100644
--- a/tools/llvm-nm/llvm-nm.cpp
+++ b/tools/llvm-nm/llvm-nm.cpp
@@ -317,13 +317,13 @@ static void DumpSymbolNamesFromFile(std::string &Filename) {
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";