aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PTHLexer.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:36:38 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:36:38 +0000
commit3a321e23f66128dbb986343927456ff6702af617 (patch)
tree058f1f5a8a7e4044f51dfbdc62a46b80693b94a9 /lib/Lex/PTHLexer.cpp
parent8f1509446fc51db0473ea1241910c06353a153b8 (diff)
Use error_code instead of std::string* for MemoryBuffer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PTHLexer.cpp')
-rw-r--r--lib/Lex/PTHLexer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp
index b6bc7ce488..aeec3fcc25 100644
--- a/lib/Lex/PTHLexer.cpp
+++ b/lib/Lex/PTHLexer.cpp
@@ -26,6 +26,7 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/system_error.h"
using namespace clang;
using namespace clang::io;
@@ -436,9 +437,12 @@ static void InvalidPTH(Diagnostic &Diags, const char *Msg) {
PTHManager *PTHManager::Create(const std::string &file, Diagnostic &Diags) {
// Memory map the PTH file.
- llvm::OwningPtr<llvm::MemoryBuffer> File(llvm::MemoryBuffer::getFile(file));
+ llvm::error_code ec;
+ llvm::OwningPtr<llvm::MemoryBuffer> File(
+ llvm::MemoryBuffer::getFile(file, ec));
if (!File) {
+ // FIXME: Add ec.message() to this diag.
Diags.Report(diag::err_invalid_pth_file) << file;
return 0;
}