[PATCH] D25602: Do not reset TUScope when we are in incremental processing mode.

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 14 03:00:50 PDT 2016

v.g.vassilev created this revision.
v.g.vassilev added a reviewer: rsmith.
v.g.vassilev added a subscriber: cfe-commits.

We are using this in the context of cling, where we keep the compiler instance alive after EOF.

The incremental processing part in clang was done mostly by me and this patch LGTM, but I'd like to go under a formal review procedure.



Index: lib/Sema/Sema.cpp
--- lib/Sema/Sema.cpp
+++ lib/Sema/Sema.cpp
@@ -710,7 +710,8 @@
   if (TUKind == TU_Prefix) {
     // Translation unit prefixes don't need any of the checking below.
-    TUScope = nullptr;
+    if (!PP.isIncrementalProcessingEnabled())
+      TUScope = nullptr;
@@ -909,7 +910,8 @@
   assert(ParsingInitForAutoVars.empty() &&
          "Didn't unmark var as having its initializer parsed");
-  TUScope = nullptr;
+  if (!PP.isIncrementalProcessingEnabled())
+    TUScope = nullptr;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25602.74641.patch
Type: text/x-patch
Size: 607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161014/30a35636/attachment.bin>

More information about the cfe-commits mailing list