mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SyntaxParser: avoid evaluating pound conditions in the new in-process parser.
This commit is contained in:
@@ -284,6 +284,8 @@ swiftparse_client_node_t SynParser::parse(const char *source) {
|
||||
ParserUnit PU(SM, SourceFileKind::Main, bufID, langOpts,
|
||||
"syntax_parse_module", std::move(parseActions),
|
||||
/*SyntaxCache=*/nullptr);
|
||||
// Evaluating pound conditions may lead to unknown syntax.
|
||||
PU.getParser().State->PerformConditionEvaluation = false;
|
||||
std::unique_ptr<SynParserDiagConsumer> pConsumer;
|
||||
if (DiagHandler) {
|
||||
pConsumer = llvm::make_unique<SynParserDiagConsumer>(*this, bufID);
|
||||
|
||||
Reference in New Issue
Block a user