summaryrefslogtreecommitdiffstats
path: root/llvm/utils/FileCheck/FileCheck.cpp
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/utils/FileCheck/FileCheck.cpp
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/utils/FileCheck/FileCheck.cpp')
-rw-r--r--llvm/utils/FileCheck/FileCheck.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index 9343617c3c1..b8c14f0e9b5 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud