mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ossa][frontend] Separately namespace enable-ossa-modules in the prebuilt module cache so that the flag causes recompilation of imported resilient modules when the flag is enabled.
This will enable users to try out the '-enable-ossa-modules' flag if their compiler supports it and get OSSA code on all inlinable code that they use. The idea is that this is a nice way to stage this in and get more testing. The specific implementation is that the module interface loader: 1. Knows if enable ossa modules is enabled not to search for any compiled modules. We always rebuild from the interface file on the system. 2. Knows that if enable ossa modules is enabled to mixin a bit into the module interface loader cache hash to ensure that we consider the specialized ossa compiled modules to be different than the modules in that cache from the system. This ensures that when said flag is enabled, the user transparently gets all their code in OSSA form from transparent libraries.
This commit is contained in:
@@ -100,13 +100,15 @@ protected:
|
||||
langOpts.Target = llvm::Triple(llvm::sys::getDefaultTargetTriple());
|
||||
SearchPathOptions searchPathOpts;
|
||||
ClangImporterOptions clangImpOpts;
|
||||
SILOptions silOpts;
|
||||
auto ctx =
|
||||
ASTContext::get(langOpts, typeckOpts, searchPathOpts, clangImpOpts,
|
||||
sourceMgr, diags);
|
||||
|
||||
ctx->addModuleInterfaceChecker(
|
||||
std::make_unique<ModuleInterfaceCheckerImpl>(*ctx, cacheDir,
|
||||
prebuiltCacheDir, ModuleInterfaceLoaderOptions()));
|
||||
prebuiltCacheDir, ModuleInterfaceLoaderOptions(),
|
||||
swift::RequireOSSAModules_t(silOpts)));
|
||||
|
||||
auto loader = ModuleInterfaceLoader::create(
|
||||
*ctx, *static_cast<ModuleInterfaceCheckerImpl*>(
|
||||
|
||||
Reference in New Issue
Block a user