From 76fb9b0e5f553f03321777ff634eb245dd8a821e Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Sat, 25 Jun 2011 17:54:59 +0000 Subject: 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 --- tools/llvm-nm/llvm-nm.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/llvm-nm') 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 obj(ObjectFile::createObjectFile(aPath.str())); - if (!obj.get()) { - errs() << ToolName << ": " << Filename << ": " - << "Failed to open object file\n"; + OwningPtr 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(obj.get())) + DumpSymbolNamesFromObject(o); } else { errs() << ToolName << ": " << Filename << ": " << "unrecognizable file type\n"; -- cgit v1.1