summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-30 04:18:44 +0000
committerChris Lattner <sabre@nondot.org>2009-11-30 04:18:44 +0000
commit710bb871478ff60ae81c424218c0ec264beb3e96 (patch)
tree8fa87a6532c170e184a5cc3dcadf39f702cc509c /clang/lib/Frontend/FrontendActions.cpp
parent031cb0024656d7c8ec8da0a58a2ccfa98746149a (diff)
downloadbcm5719-llvm-710bb871478ff60ae81c424218c0ec264beb3e96.tar.gz
bcm5719-llvm-710bb871478ff60ae81c424218c0ec264beb3e96.zip
Fix PR5633 by making the preprocessor handle the case where we can
stat a file but where mmaping it fails. In this case, we emit an error like: t.c:1:10: fatal error: error opening file '../../foo.h' instead of "cannot find file". llvm-svn: 90110
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 6cb3928d51d..8092b715e36 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -192,7 +192,8 @@ void DumpRawTokensAction::ExecuteAction() {
SourceManager &SM = PP.getSourceManager();
// Start lexing the specified input file.
- Lexer RawLex(SM.getMainFileID(), SM, PP.getLangOptions());
+ const llvm::MemoryBuffer *FromFile = SM.getBuffer(SM.getMainFileID());
+ Lexer RawLex(SM.getMainFileID(), FromFile, SM, PP.getLangOptions());
RawLex.SetKeepWhitespaceMode(true);
Token RawTok;
OpenPOWER on IntegriCloud