diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-17 15:44:30 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-17 15:44:30 +0000 |
commit | 4ad3da2843da1e8c8da6a87548ae8ec393512c23 (patch) | |
tree | a995f0aeb35ca1d6a9d92dd4a94404032388111c /clang/lib/Frontend/CacheTokens.cpp | |
parent | 22fde23b6e125317828d7c07b86c8e7be16440a5 (diff) | |
download | bcm5719-llvm-4ad3da2843da1e8c8da6a87548ae8ec393512c23.tar.gz bcm5719-llvm-4ad3da2843da1e8c8da6a87548ae8ec393512c23.zip |
Entering the main source file in the preprocessor can fail if the
source file has been changed. Handle that failure more gracefully.
llvm-svn: 98727
Diffstat (limited to 'clang/lib/Frontend/CacheTokens.cpp')
-rw-r--r-- | clang/lib/Frontend/CacheTokens.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CacheTokens.cpp b/clang/lib/Frontend/CacheTokens.cpp index 02d6cec8fca..199be3d5438 100644 --- a/clang/lib/Frontend/CacheTokens.cpp +++ b/clang/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. |