summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-nm
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:36:48 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:36:48 +0000
commit7b6fef82d43a4e121a284ebabf5de94c3485b29a (patch)
tree09a49a4bb8f4c8c8b5a13d4d328b82f442a26969 /llvm/tools/llvm-nm
parentf25faaaffbd9c6d3ffeccb333d0338e5bcb796b1 (diff)
downloadbcm5719-llvm-7b6fef82d43a4e121a284ebabf5de94c3485b29a.tar.gz
bcm5719-llvm-7b6fef82d43a4e121a284ebabf5de94c3485b29a.zip
Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
llvm-svn: 121379
Diffstat (limited to 'llvm/tools/llvm-nm')
-rw-r--r--llvm/tools/llvm-nm/llvm-nm.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp
index 132644d8d2f..16615964a30 100644
--- a/llvm/tools/llvm-nm/llvm-nm.cpp
+++ b/llvm/tools/llvm-nm/llvm-nm.cpp
@@ -26,6 +26,7 @@
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Signals.h"
+#include "llvm/Support/system_error.h"
#include <algorithm>
#include <cctype>
#include <cerrno>
@@ -143,8 +144,11 @@ static void DumpSymbolNamesFromFile(std::string &Filename) {
sys::Path aPath(Filename);
// Note: Currently we do not support reading an archive from stdin.
if (Filename == "-" || aPath.isBitcodeFile()) {
+ error_code ec;
std::auto_ptr<MemoryBuffer> Buffer(
- MemoryBuffer::getFileOrSTDIN(Filename, &ErrorMessage));
+ MemoryBuffer::getFileOrSTDIN(Filename, ec));
+ if (Buffer.get() == 0)
+ ErrorMessage = ec.message();
Module *Result = 0;
if (Buffer.get())
Result = ParseBitcodeFile(Buffer.get(), Context, &ErrorMessage);
OpenPOWER on IntegriCloud