mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ScanDependency] Pass crossimport overlay file to swift-frontend
Teach dependency scanner to pass cross import overlay file to swift-frontend for main module compilation. This allows swift-frontend not to repeat the file system search for overlay files when loading modules. This also fixes the issue when caching is enabled, the cross import doesn't work when the first module is a clang module because the module built with caching using clang include tree does not preserve DefinitionLoc which is used to inferred the modulemap location for cross import overlay search. rdar://127844120
This commit is contained in:
@@ -2068,6 +2068,12 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts, ArgList &Args,
|
||||
*forceModuleLoadingMode);
|
||||
}
|
||||
|
||||
for (auto *A : Args.filtered(OPT_swift_module_cross_import))
|
||||
Opts.CrossImportInfo[A->getValue(0)].push_back(A->getValue(1));
|
||||
|
||||
Opts.DisableCrossImportOverlaySearch |=
|
||||
Args.hasArg(OPT_disable_cross_import_overlay_search);
|
||||
|
||||
// Opts.RuntimeIncludePath is set by calls to
|
||||
// setRuntimeIncludePath() or setMainExecutablePath().
|
||||
// Opts.RuntimeImportPath is set by calls to
|
||||
|
||||
Reference in New Issue
Block a user