aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorBen Barham <ben_barham@apple.com>2023-09-11 17:40:43 -0700
committerGitHub <noreply@github.com>2023-09-11 17:40:43 -0700
commit4c264c26d726f594c4618e4bfeac93d403de893f (patch)
tree0762d973bdf64617b8b20df3251071b56293440d /clang/lib/Lex/Preprocessor.cpp
parent8ee0874eca0dd636cd623504a298ad4ed888631c (diff)
downloadllvm-4c264c26d726f594c4618e4bfeac93d403de893f.zip
llvm-4c264c26d726f594c4618e4bfeac93d403de893f.tar.gz
llvm-4c264c26d726f594c4618e4bfeac93d403de893f.tar.bz2
[Parse] Split incremental-extensions (#65683)
The preprocessor `IncrementalProcessing` option was being used to control whether or not to teardown the lexer or run the end of translation unit action. In D127284 this was merged with `-fincremental-extensions`, which also changes top level parsing. Split these again so that the former behavior can be achieved without the latter (ie. to allow managing lifetime without also changing parsing). Resolves rdar://113406310.
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 8de78a1..f0381c1 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -146,6 +146,10 @@ Preprocessor::Preprocessor(std::shared_ptr<PreprocessorOptions> PPOpts,
Ident_AbnormalTermination = nullptr;
}
+ // Default incremental processing to -fincremental-extensions, clients can
+ // override with `enableIncrementalProcessing` if desired.
+ IncrementalProcessing = LangOpts.IncrementalExtensions;
+
// If using a PCH where a #pragma hdrstop is expected, start skipping tokens.
if (usingPCHWithPragmaHdrStop())
SkippingUntilPragmaHdrStop = true;