summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2017-07-18 18:24:42 +0000
committerRaphael Isemann <teemperor@gmail.com>2017-07-18 18:24:42 +0000
commite21c0578a4f55d52c54f2d71761f58cb5318565a (patch)
tree985ed5b36e9899168efb5caf9f8325e9dc5ef09d /lib
parent8856048c38146fac48a691610b440343e2c1a669 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/Sema.cpp3
1 files changed, 2 insertions, 1 deletions
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;
}