From 333fb04506233255f10d8095c9e2de5e5f0fdc6f Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Thu, 9 Dec 2010 17:36:48 +0000 Subject: Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp') diff --git a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp index 36b0deb07e..f11fdb893f 100644 --- a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp +++ b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp @@ -38,6 +38,7 @@ #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Signals.h" +#include "llvm/Support/system_error.h" #include #include #include @@ -473,10 +474,12 @@ static void PrintSize(uint64_t Bits) { /// AnalyzeBitcode - Analyze the bitcode file specified by InputFilename. static int AnalyzeBitcode() { // Read the input file. - MemoryBuffer *MemBuf = MemoryBuffer::getFileOrSTDIN(InputFilename.c_str()); + error_code ec; + MemoryBuffer *MemBuf = + MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), ec); if (MemBuf == 0) - return Error("Error reading '" + InputFilename + "'."); + return Error("Error reading '" + InputFilename + "': " + ec.message()); if (MemBuf->getBufferSize() & 3) return Error("Bitcode stream should be a multiple of 4 bytes in length"); -- cgit v1.2.3