From: Vassil Vassilev Date: Mon, 17 Oct 2016 10:15:25 +0000 (+0000) Subject: Do not reset TUScope when we are in incremental processing mode. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4498e81843bd29dce14538959ea56a29f9c33b69;p=clang Do not reset TUScope when we are in incremental processing mode. Patch by Axel Naumann! Reviewed by Richard Smith and me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284372 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index fac608de6f..2a3be84263 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -708,7 +708,8 @@ void Sema::ActOnEndOfTranslationUnit() { if (TUKind == TU_Prefix) { // Translation unit prefixes don't need any of the checking below. - TUScope = nullptr; + if (!PP.isIncrementalProcessingEnabled()) + TUScope = nullptr; return; } @@ -908,7 +909,8 @@ void Sema::ActOnEndOfTranslationUnit() { assert(ParsingInitForAutoVars.empty() && "Didn't unmark var as having its initializer parsed"); - TUScope = nullptr; + if (!PP.isIncrementalProcessingEnabled()) + TUScope = nullptr; }