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 | 333fb04506233255f10d8095c9e2de5e5f0fdc6f (patch) | |
tree | 29b15348801de3482b07a438b1fb1f2ba094d3d2 /tools/llvm-prof | |
parent | 908b6ddad6dac40c4c0453d690f0db9422b48b10 (diff) | |
download | llvm-333fb04506233255f10d8095c9e2de5e5f0fdc6f.tar.gz llvm-333fb04506233255f10d8095c9e2de5e5f0fdc6f.tar.bz2 llvm-333fb04506233255f10d8095c9e2de5e5f0fdc6f.tar.xz |
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
Diffstat (limited to 'tools/llvm-prof')
-rw-r--r-- | tools/llvm-prof/llvm-prof.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp index 3351bd2735..aa9cf004c7 100644 --- a/tools/llvm-prof/llvm-prof.cpp +++ b/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"; |