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 /utils/FileCheck | |
parent | 908b6ddad6dac40c4c0453d690f0db9422b48b10 (diff) | |
download | external_llvm-333fb04506233255f10d8095c9e2de5e5f0fdc6f.zip external_llvm-333fb04506233255f10d8095c9e2de5e5f0fdc6f.tar.gz external_llvm-333fb04506233255f10d8095c9e2de5e5f0fdc6f.tar.bz2 |
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 'utils/FileCheck')
-rw-r--r-- | utils/FileCheck/FileCheck.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp index 9343617..b8c14f0 100644 --- a/utils/FileCheck/FileCheck.cpp +++ b/utils/FileCheck/FileCheck.cpp @@ -23,6 +23,7 @@ #include "llvm/Support/SourceMgr.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Signals.h" +#include "llvm/Support/system_error.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringMap.h" #include <algorithm> @@ -488,12 +489,11 @@ static MemoryBuffer *CanonicalizeInputFile(MemoryBuffer *MB) { static bool ReadCheckFile(SourceMgr &SM, std::vector<CheckString> &CheckStrings) { // Open the check file, and tell SourceMgr about it. - std::string ErrorStr; - MemoryBuffer *F = - MemoryBuffer::getFileOrSTDIN(CheckFilename.c_str(), &ErrorStr); + error_code ec; + MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(CheckFilename.c_str(), ec); if (F == 0) { errs() << "Could not open check file '" << CheckFilename << "': " - << ErrorStr << '\n'; + << ec.message() << '\n'; return true; } @@ -648,12 +648,11 @@ int main(int argc, char **argv) { return 2; // Open the file to check and add it to SourceMgr. - std::string ErrorStr; - MemoryBuffer *F = - MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), &ErrorStr); + error_code ec; + MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), ec); if (F == 0) { errs() << "Could not open input file '" << InputFilename << "': " - << ErrorStr << '\n'; + << ec.message() << '\n'; return true; } |