Merge pull request #61649 from xymus/index-swiftinterfaces

[Index] Force indexing of system modules to read only from swiftinterfaces
This commit is contained in:
Alexis Laferrière
2022-10-31 14:18:45 -07:00
committed by GitHub
28 changed files with 268 additions and 50 deletions

View File

@@ -422,6 +422,8 @@ static bool buildModuleFromInterface(CompilerInstance &Instance) {
ModuleInterfaceLoaderOptions LoaderOpts(FEOpts);
StringRef ABIPath = Instance.getPrimarySpecificPathsForAtMostOnePrimary()
.SupplementaryOutputs.ABIDescriptorOutputPath;
bool IgnoreAdjacentModules = Instance.hasASTContext() &&
Instance.getASTContext().IgnoreAdjacentModules;
// If an explicit interface build was requested, bypass the creation of a new
// sub-instance from the interface which will build it in a separate thread,
@@ -443,7 +445,8 @@ static bool buildModuleFromInterface(CompilerInstance &Instance) {
Invocation.getOutputFilename(), ABIPath,
FEOpts.SerializeModuleInterfaceDependencyHashes,
FEOpts.shouldTrackSystemDependencies(), LoaderOpts,
RequireOSSAModules_t(Invocation.getSILOptions()));
RequireOSSAModules_t(Invocation.getSILOptions()),
IgnoreAdjacentModules);
}
static bool compileLLVMIR(CompilerInstance &Instance) {