Skip to content

Commit fd0f148

Browse files
authored
Merge pull request #64518 from artemcm/NoExtraClangPCMSearchPaths
[Dependency Scanning] Do not add extra search paths to the Clang's explicit PCM prebuild commands
2 parents 7505a8a + 4ed874c commit fd0f148

File tree

5 files changed

+2
-19
lines changed

5 files changed

+2
-19
lines changed

lib/AST/ModuleDependencies.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ SwiftDependencyScanningService::SwiftDependencyScanningService()
237237
/* CAS (llvm::cas::ObjectStore) */ nullptr,
238238
/* Cache (llvm::cas::ActionCache) */ nullptr,
239239
/* SharedFS */ nullptr,
240-
/* OptimizeArgs */ false) {
240+
/* OptimizeArgs */ true) {
241241
SharedFilesystemCache.emplace();
242242
}
243243

lib/ClangImporter/ClangModuleDependencyScanner.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -178,20 +178,6 @@ void ClangImporter::recordModuleDependencies(
178178
// Add args reported by the scanner.
179179
llvm::for_each(clangModuleDep.BuildArguments, addClangArg);
180180

181-
// Pass down search paths to the -emit-module action.
182-
// Unlike building Swift modules, we need to include all search paths to
183-
// the clang invocation to build PCMs because transitive headers can only
184-
// be found via search paths. Passing these headers as explicit inputs can
185-
// be quite challenging.
186-
for (const auto &path :
187-
Impl.SwiftContext.SearchPathOpts.getImportSearchPaths()) {
188-
addClangArg("-I" + path);
189-
}
190-
for (const auto &path :
191-
Impl.SwiftContext.SearchPathOpts.getFrameworkSearchPaths()) {
192-
addClangArg((path.IsSystem ? "-Fsystem": "-F") + path.Path);
193-
}
194-
195181
// Module-level dependencies.
196182
llvm::StringSet<> alreadyAddedModules;
197183
auto dependencies = ModuleDependencyInfo::forClangModule(

test/ModuleInterface/clang-args-transitive-availability.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ import ImportsMacroSpecificClangModule
4848
// CHECK-NEXT: "contextHash": "{{.*}}",
4949
// CHECK-NEXT: "commandLine": [
5050

51-
// CHECK: "TANGERINE=1",
51+
// CHECK: "TANGERINE=1"

test/ScanDependencies/batch_module_scan.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
// CHECK-PCM-NEXT: },
2929
// CHECK-PCM-NEXT: {
3030
// CHECK-PCM-NEXT: "modulePath": "{{.*}}{{/|\\}}F-{{.*}}.pcm",
31-
// CHECK-PCM: "-I
3231

3332
// CHECK-SWIFT: {
3433
// CHECK-SWIFT-NEXT: "mainModuleName": "F",

test/ScanDependencies/batch_module_scan_versioned.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
// CHECK-PCM109-NEXT: "clang": "X"
3434
// CHECK-PCM109-NEXT: }
3535
// CHECK-PCM109-NEXT: ],
36-
// CHECK-PCM109: "-I
3736

3837
// CHECK-PCM110: {
3938
// CHECK-PCM110-NEXT: "mainModuleName": "G",
@@ -46,4 +45,3 @@
4645
// CHECK-PCM110: "directDependencies": [
4746
// CHECK-PCM110-NEXT: ],
4847
// CHECK-PCM110-NOT: "clang": "X"
49-
// CHECK-PCM110: "-I

0 commit comments

Comments
 (0)