diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-09 17:36:48 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-09 17:36:48 +0000 |
commit | 7b6fef82d43a4e121a284ebabf5de94c3485b29a (patch) | |
tree | 09a49a4bb8f4c8c8b5a13d4d328b82f442a26969 /llvm/tools/llvm-prof/llvm-prof.cpp | |
parent | f25faaaffbd9c6d3ffeccb333d0338e5bcb796b1 (diff) | |
download | bcm5719-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-prof/llvm-prof.cpp')
-rw-r--r-- | llvm/tools/llvm-prof/llvm-prof.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/tools/llvm-prof/llvm-prof.cpp b/llvm/tools/llvm-prof/llvm-prof.cpp index 3351bd27350..aa9cf004c74 100644 --- a/llvm/tools/llvm-prof/llvm-prof.cpp +++ b/llvm/tools/llvm-prof/llvm-prof.cpp @@ -30,6 +30,7 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Format.h" #include "llvm/Support/Signals.h" +#include "llvm/Support/system_error.h" #include <algorithm> #include <iomanip> #include <map> @@ -263,12 +264,13 @@ int main(int argc, char **argv) { // Read in the bitcode file... std::string ErrorMessage; + error_code ec; Module *M = 0; - if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BitcodeFile, - &ErrorMessage)) { + if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BitcodeFile, ec)) { M = ParseBitcodeFile(Buffer, Context, &ErrorMessage); delete Buffer; - } + } else + ErrorMessage = ec.message(); if (M == 0) { errs() << argv[0] << ": " << BitcodeFile << ": " << ErrorMessage << "\n"; |