[PrefixMap] Remap clang cc1 args when building swift interfaces

Fix a bug that swift clang importer is not setup correctly when prefix
map is used. There are two separate issues:
* CC1 args used to setup clang import when building swift (interface and
  sources) are not correctly remapped.
* When loading SDKInfo from SDK path, the SDKSettings.json is not
  loading from VFS, thus the file cannot be loaded from remapped path.

rdar://134458611
This commit is contained in:
Steven Wu
2024-08-23 10:25:58 -07:00
parent 4921eaf92f
commit 7ed9a52633
4 changed files with 33 additions and 8 deletions

View File

@@ -1787,6 +1787,9 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
genericSubInvocation.getClangImporterOptions().ClangImporterDirectCC1Scan =
clangImporterOpts.ClangImporterDirectCC1Scan;
genericSubInvocation.getSearchPathOptions().ScannerPrefixMapper =
SearchPathOpts.ScannerPrefixMapper;
// Validate Clang modules once per-build session flags must be consistent
// across all module sub-invocations
if (clangImporterOpts.ValidateModulesOnce) {