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:
@@ -103,9 +103,8 @@ protected:
|
||||
ClangImporterOptions clangImpOpts;
|
||||
symbolgraphgen::SymbolGraphOptions symbolGraphOpts;
|
||||
SILOptions silOpts;
|
||||
auto ctx =
|
||||
ASTContext::get(langOpts, typeckOpts, searchPathOpts, clangImpOpts,
|
||||
symbolGraphOpts, sourceMgr, diags);
|
||||
auto ctx = ASTContext::get(langOpts, typeckOpts, silOpts, searchPathOpts,
|
||||
clangImpOpts, symbolGraphOpts, sourceMgr, diags);
|
||||
|
||||
ctx->addModuleInterfaceChecker(
|
||||
std::make_unique<ModuleInterfaceCheckerImpl>(*ctx, cacheDir,
|
||||
@@ -149,7 +148,8 @@ protected:
|
||||
ASSERT_TRUE(bufOrErr);
|
||||
|
||||
auto bufData = (*bufOrErr)->getBuffer();
|
||||
auto validationInfo = serialization::validateSerializedAST(bufData);
|
||||
auto validationInfo = serialization::validateSerializedAST(
|
||||
bufData, silOpts.EnableOSSAModules);
|
||||
ASSERT_EQ(serialization::Status::Valid, validationInfo.status);
|
||||
ASSERT_EQ(bufData, moduleBuffer->getBuffer());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user