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 | dbf8ee630e4c86e5150492eaf8dbceea3c718ee1 (patch) | |
tree | 62f4e996cfce0d2ba21cd732b442c1c1a74b583c /lib/Frontend/RewriteMacros.cpp | |
parent | 0419a2375f16821e40ea48e5437fefe6a803f26d (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/RewriteMacros.cpp')
-rw-r--r-- | lib/Frontend/RewriteMacros.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Frontend/RewriteMacros.cpp b/lib/Frontend/RewriteMacros.cpp index 954e8e23ca..4ffb2978db 100644 --- a/lib/Frontend/RewriteMacros.cpp +++ b/lib/Frontend/RewriteMacros.cpp @@ -101,7 +101,8 @@ void clang::RewriteMacrosInInput(Preprocessor &PP, llvm::raw_ostream *OS) { // Get the first preprocessing token. - PP.EnterMainSourceFile(); + if (PP.EnterMainSourceFile()) + return; Token PPTok; PP.Lex(PPTok); |