summaryrefslogtreecommitdiff
path: root/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
commit333fb04506233255f10d8095c9e2de5e5f0fdc6f (patch)
tree29b15348801de3482b07a438b1fb1f2ba094d3d2 /utils/FileCheck/FileCheck.cpp
parent908b6ddad6dac40c4c0453d690f0db9422b48b10 (diff)
downloadllvm-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 'utils/FileCheck/FileCheck.cpp')
-rw-r--r--utils/FileCheck/FileCheck.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp
index 9343617c3c..b8c14f0e9b 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;
}