Index: tools/clang/lib/Sema/Sema.cpp
===================================================================
--- tools/clang/lib/Sema/Sema.cpp	(revision 47812)
+++ tools/clang/lib/Sema/Sema.cpp	(working copy)
@@ -572,7 +572,8 @@
 
   if (TUKind == TU_Prefix) {
     // Translation unit prefixes don't need any of the checking below.
-    TUScope = 0;
+    if (!PP.isIncrementalProcessingEnabled())
+       TUScope = 0;
     return;
   }
 
@@ -754,7 +755,8 @@
   assert(ParsingInitForAutoVars.empty() &&
          "Didn't unmark var as having its initializer parsed");
 
-  TUScope = 0;
+  if (!PP.isIncrementalProcessingEnabled())
+     TUScope = 0;
 }
 
 
Index: tools/clang/lib/Parse/Parser.cpp
===================================================================
--- tools/clang/lib/Parse/Parser.cpp	(revision 47812)
+++ tools/clang/lib/Parse/Parser.cpp	(working copy)
@@ -564,8 +564,7 @@
     // Late template parsing can begin.
     if (getLangOpts().DelayedTemplateParsing)
       Actions.SetLateTemplateParser(LateTemplateParserCallback, this);
-    if (!PP.isIncrementalProcessingEnabled())
-      Actions.ActOnEndOfTranslationUnit();
+    Actions.ActOnEndOfTranslationUnit();
     //else don't tell Sema that we ended parsing: more input might come.
 
     return true;

Add correspoding patch ready to go in clang's mainline.
Add correspoding patch ready to go in clang's mainline.


git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@47820 27541ba8-7e3a-0410-8455-c3a389f83636
