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/TableGen/TableGen.cpp | |
parent | 908b6ddad6dac40c4c0453d690f0db9422b48b10 (diff) |
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/TableGen/TableGen.cpp')
-rw-r--r-- | utils/TableGen/TableGen.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp index e6d000a1e2..e8815da35c 100644 --- a/utils/TableGen/TableGen.cpp +++ b/utils/TableGen/TableGen.cpp @@ -42,6 +42,7 @@ #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/ToolOutputFile.h" #include "llvm/Support/Signals.h" +#include "llvm/Support/system_error.h" #include <algorithm> #include <cstdio> using namespace llvm; @@ -188,11 +189,11 @@ void llvm::PrintError(SMLoc ErrorLoc, const Twine &Msg) { static bool ParseFile(const std::string &Filename, const std::vector<std::string> &IncludeDirs, SourceMgr &SrcMgr) { - std::string ErrorStr; - MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrorStr); + error_code ec; + MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), ec); if (F == 0) { errs() << "Could not open input file '" << Filename << "': " - << ErrorStr <<"\n"; + << ec.message() <<"\n"; return true; } |