aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CacheTokens.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-17 15:44:30 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-17 15:44:30 +0000
commitdbf8ee630e4c86e5150492eaf8dbceea3c718ee1 (patch)
tree62f4e996cfce0d2ba21cd732b442c1c1a74b583c /lib/Frontend/CacheTokens.cpp
parent0419a2375f16821e40ea48e5437fefe6a803f26d (diff)
Entering the main source file in the preprocessor can fail if the
source file has been changed. Handle that failure more gracefully. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98727 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CacheTokens.cpp')
-rw-r--r--lib/Frontend/CacheTokens.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Frontend/CacheTokens.cpp b/lib/Frontend/CacheTokens.cpp
index 02d6cec8fc..199be3d543 100644
--- a/lib/Frontend/CacheTokens.cpp
+++ b/lib/Frontend/CacheTokens.cpp
@@ -549,7 +549,8 @@ void clang::CacheTokens(Preprocessor &PP, llvm::raw_fd_ostream* OS) {
// Lex through the entire file. This will populate SourceManager with
// all of the header information.
Token Tok;
- PP.EnterMainSourceFile();
+ if (PP.EnterMainSourceFile())
+ return;
do { PP.Lex(Tok); } while (Tok.isNot(tok::eof));
// Generate the PTH file.