]> granicus.if.org Git - clang/commitdiff
Don't set TUScope to null when generating a module in incremental processing mode.
authorRaphael Isemann <teemperor@gmail.com>
Tue, 18 Jul 2017 18:24:42 +0000 (18:24 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Tue, 18 Jul 2017 18:24:42 +0000 (18:24 +0000)
Summary: When in incremental processing mode, we should never set `TUScope` to a nullptr otherwise any future lookups fail. We already have similar checks in the rest of the code, but we never hit this one because so far we didn't try to generate a module from the AST that Cling generates.

Reviewers: rsmith, v.g.vassilev

Reviewed By: v.g.vassilev

Subscribers: cfe-commits, v.g.vassilev

Differential Revision: https://reviews.llvm.org/D35536

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308333 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp

index dc9f977d41ac2a4a35a3077057984ceb6639fa3d..6f0db6ce1c6a8b357eef10ba72b0a8fae19bc826 100644 (file)
@@ -850,7 +850,8 @@ void Sema::ActOnEndOfTranslationUnit() {
     emitAndClearUnusedLocalTypedefWarnings();
 
     // Modules don't need any of the checking below.
-    TUScope = nullptr;
+    if (!PP.isIncrementalProcessingEnabled())
+      TUScope = nullptr;
     return;
   }