mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag (#39516)
* Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag This includes a bit in the module format to represent if the module was compiled with -enable-ossa-modules flag. When compiling a client module with -enable-ossa-modules flag, all dependent modules are checked for this bit, if not on, recompilation is triggered with -enable-ossa-modules. * Updated tests
This commit is contained in:
@@ -481,7 +481,6 @@ swiftparse_client_node_t SynParser::parse(const char *source, size_t len) {
|
||||
SourceManager SM;
|
||||
unsigned bufID = SM.addNewSourceBuffer(llvm::MemoryBuffer::getMemBuffer(
|
||||
StringRef(source, len), "syntax_parse_source"));
|
||||
TypeCheckerOptions tyckOpts;
|
||||
LangOptions langOpts;
|
||||
langOpts.BuildSyntaxTree = true;
|
||||
langOpts.ParseForSyntaxTreeOnly = true;
|
||||
@@ -494,8 +493,8 @@ swiftparse_client_node_t SynParser::parse(const char *source, size_t len) {
|
||||
std::make_shared<CLibParseActions>(*this, SM, bufID);
|
||||
// We have to use SourceFileKind::Main to avoid diagnostics like
|
||||
// illegal_top_level_expr
|
||||
ParserUnit PU(SM, SourceFileKind::Main, bufID, langOpts, tyckOpts,
|
||||
"syntax_parse_module", std::move(parseActions),
|
||||
ParserUnit PU(SM, SourceFileKind::Main, bufID, langOpts, TypeCheckerOptions(),
|
||||
SILOptions(), "syntax_parse_module", std::move(parseActions),
|
||||
/*SyntaxCache=*/nullptr);
|
||||
std::unique_ptr<SynParserDiagConsumer> pConsumer;
|
||||
if (DiagHandler) {
|
||||
|
||||
Reference in New Issue
Block a user