summaryrefslogtreecommitdiffstats
path: root/clang/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
commitf25faaaffbd9c6d3ffeccb333d0338e5bcb796b1 (patch)
tree70ae0540bfd7a3e2623f0d9c62ff3670d8d31a1d /clang/lib/Lex/PTHLexer.cpp
parentd47180e45e96411c69dad778752988fed336ac4f (diff)
downloadbcm5719-llvm-f25faaaffbd9c6d3ffeccb333d0338e5bcb796b1.tar.gz
bcm5719-llvm-f25faaaffbd9c6d3ffeccb333d0338e5bcb796b1.zip
Use error_code instead of std::string* for MemoryBuffer.
llvm-svn: 121378
Diffstat (limited to 'clang/lib/Lex/PTHLexer.cpp')
-rw-r--r--clang/lib/Lex/PTHLexer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp
index b6bc7ce4887..aeec3fcc257 100644
--- a/clang/lib/Lex/PTHLexer.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud