diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-06-13 11:53:31 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-06-13 11:53:31 +0000 |
commit | 5e45dc40d329829ad23bf444f32dca221215e239 (patch) | |
tree | 717bb23e6e1af2314d66495c62843a8a8725a5f1 /tools/llvm-nm | |
parent | bc437ebbca77cf8a7e2e47e3666c4a0114ccc2d1 (diff) | |
download | external_llvm-5e45dc40d329829ad23bf444f32dca221215e239.zip external_llvm-5e45dc40d329829ad23bf444f32dca221215e239.tar.gz external_llvm-5e45dc40d329829ad23bf444f32dca221215e239.tar.bz2 |
Revert the last two commits in the series. r132911, r132912.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-nm')
-rw-r--r-- | tools/llvm-nm/llvm-nm.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp index f6eb33c..1afa503 100644 --- a/tools/llvm-nm/llvm-nm.cpp +++ b/tools/llvm-nm/llvm-nm.cpp @@ -277,7 +277,7 @@ static void DumpSymbolNamesFromObject(ObjectFile *obj) { SymbolList.push_back(s); } - CurrentFilename = obj->getFileName(); + CurrentFilename = obj->getFilename(); SortAndPrintSymbolList(); } @@ -317,13 +317,13 @@ static void DumpSymbolNamesFromFile(std::string &Filename) { MultipleFiles = true; std::for_each (Modules.begin(), Modules.end(), DumpSymbolNamesFromModule); } else if (aPath.isObjectFile()) { - OwningPtr<Binary> obj; - if (error_code ec = object::createBinary(aPath.str(), obj)) { - errs() << ToolName << ": " << Filename << ": " << ec.message() << ".\n"; + std::auto_ptr<ObjectFile> obj(ObjectFile::createObjectFile(aPath.str())); + if (!obj.get()) { + errs() << ToolName << ": " << Filename << ": " + << "Failed to open object file\n"; return; } - if (object::ObjectFile *o = dyn_cast<ObjectFile>(obj.get())) - DumpSymbolNamesFromObject(o); + DumpSymbolNamesFromObject(obj.get()); } else { errs() << ToolName << ": " << Filename << ": " << "unrecognizable file type\n"; |