From: Raphael Isemann Date: Tue, 18 Jul 2017 18:24:42 +0000 (+0000) Subject: Don't set TUScope to null when generating a module in incremental processing mode. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e21c0578a4f55d52c54f2d71761f58cb5318565a;p=clang Don't set TUScope to null when generating a module in incremental processing mode. 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 --- diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index dc9f977d41..6f0db6ce1c 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -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; }