From e21c0578a4f55d52c54f2d71761f58cb5318565a Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Tue, 18 Jul 2017 18:24:42 +0000 Subject: [PATCH] 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 --- lib/Sema/Sema.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.50.1