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. https://reviews.llvm.org/D25602 Files: lib/Sema/Sema.cpp 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; return; } @@ -909,7 +910,8 @@ assert(ParsingInitForAutoVars.empty() && "Didn't unmark var as having its initializer parsed"); - TUScope = nullptr; + if (!PP.isIncrementalProcessingEnabled()) + TUScope = nullptr; }
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; return; } @@ -909,7 +910,8 @@ assert(ParsingInitForAutoVars.empty() && "Didn't unmark var as having its initializer parsed"); - TUScope = nullptr; + if (!PP.isIncrementalProcessingEnabled()) + TUScope = nullptr; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits