diff --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp --- a/clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp +++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp @@ -24,8 +24,6 @@ ClangModuleDeps, LookupPCMPath, LookupModuleDeps, PCMPaths, ModMapPaths); for (const std::string &PCMPath : PCMPaths) Ret.push_back("-fmodule-file=" + PCMPath); - for (const std::string &ModMapPath : ModMapPaths) - Ret.push_back("-fmodule-map-file=" + ModMapPath); return Ret; } @@ -37,10 +35,8 @@ "-fno-implicit-module-maps", }; - for (const PrebuiltModuleDep &PMD : PrebuiltModuleDeps) { + for (const PrebuiltModuleDep &PMD : PrebuiltModuleDeps) Args.push_back("-fmodule-file=" + PMD.PCMFile); - Args.push_back("-fmodule-map-file=" + PMD.ModuleMapFile); - } return Args; } diff --git a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp --- a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp +++ b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp @@ -48,10 +48,8 @@ CI.getLangOpts()->ImplicitModules = false; // Report the prebuilt modules this module uses. - for (const auto &PrebuiltModule : Deps.PrebuiltModuleDeps) { + for (const auto &PrebuiltModule : Deps.PrebuiltModuleDeps) CI.getFrontendOpts().ModuleFiles.push_back(PrebuiltModule.PCMFile); - CI.getFrontendOpts().ModuleMapFiles.push_back(PrebuiltModule.ModuleMapFile); - } Optimize(CI); diff --git a/clang/test/ClangScanDeps/modules-fmodule-name-no-module-built.m b/clang/test/ClangScanDeps/modules-fmodule-name-no-module-built.m --- a/clang/test/ClangScanDeps/modules-fmodule-name-no-module-built.m +++ b/clang/test/ClangScanDeps/modules-fmodule-name-no-module-built.m @@ -46,7 +46,6 @@ // CHECK-NEXT: "-fno-implicit-modules" // CHECK-NEXT: "-fno-implicit-module-maps" // CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H2]]/header2-{{[A-Z0-9]+}}.pcm" -// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" // CHECK-NEXT: ], // CHECK-NEXT: "file-deps": [ // CHECK-NEXT: "[[PREFIX]]/modules-fmodule-name-no-module-built.m" diff --git a/clang/test/ClangScanDeps/modules-full.cpp b/clang/test/ClangScanDeps/modules-full.cpp --- a/clang/test/ClangScanDeps/modules-full.cpp +++ b/clang/test/ClangScanDeps/modules-full.cpp @@ -46,9 +46,6 @@ // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/Inputs/module.modulemap", // CHECK-NEXT: "command-line": [ // CHECK-NEXT: "-cc1" -// CHECK-NO-ABS-NOT: "-fmodule-map-file={{.*}}" -// CHECK-ABS: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" -// CHECK-CUSTOM: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" // CHECK: "-emit-module" // CHECK-NO-ABS-NOT: "-fmodule-file={{.*}}" // CHECK-ABS: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H2_DINCLUDE]]/header2-{{[A-Z0-9]+}}.pcm" @@ -111,9 +108,6 @@ // CHECK-NO-ABS-NOT: "-fmodule-file={{.*}}" // CHECK-ABS-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm" // CHECK-CUSTOM-NEXT: "-fmodule-file=[[PREFIX]]/custom/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm" -// CHECK-NO-ABS-NOT: "-fmodule-map-file={{.*}}" -// CHECK-ABS-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" -// CHECK-CUSTOM-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" // CHECK-NEXT: ], // CHECK-NEXT: "file-deps": [ // CHECK-NEXT: "[[PREFIX]]/modules_cdb_input.cpp" @@ -134,9 +128,6 @@ // CHECK-NO-ABS-NOT: "-fmodule-file={{.*}}, // CHECK-ABS-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm" // CHECK-CUSTOM-NEXT: "-fmodule-file=[[PREFIX]]/custom/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm" -// CHECK-NO-ABS-NOT: "-fmodule-map-file={{.*}} -// CHECK-ABS-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" -// CHECK-CUSTOM-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" // CHECK-NEXT: ], // CHECK-NEXT: "file-deps": [ // CHECK-NEXT: "[[PREFIX]]/modules_cdb_input.cpp" @@ -157,9 +148,6 @@ // CHECK-NO-ABS-NOT: "-fmodule-file={{.*}}" // CHECK-ABS-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm" // CHECK-CUSTOM-NEXT: "-fmodule-file=[[PREFIX]]/custom/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm" -// CHECK-NO-ABS-NOT: "-fmodule-map-file={{.*}}" -// CHECK-ABS-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" -// CHECK-CUSTOM-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" // CHECK-NEXT: ], // CHECK-NEXT: "file-deps": [ // CHECK-NEXT: "[[PREFIX]]/modules_cdb_input.cpp" @@ -182,11 +170,6 @@ // CHECK-ABS-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H1_DINCLUDE]]/header1-{{[A-Z0-9]+}}.pcm" // CHECK-CUSTOM-NEXT: "-fmodule-file=[[PREFIX]]/custom/[[HASH_H2_DINCLUDE]]/header2-{{[A-Z0-9]+}}.pcm" // CHECK-CUSTOM-NEXT: "-fmodule-file=[[PREFIX]]/custom/[[HASH_H1_DINCLUDE]]/header1-{{[A-Z0-9]+}}.pcm" -// CHECK-NO-ABS-NOT: "-fmodule-map-file={{.*}}" -// CHECK-ABS-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" -// CHECK-ABS-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" -// CHECK-CUSTOM-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" -// CHECK-CUSTOM-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap" // CHECK-NEXT: ], // CHECK-NEXT: "file-deps": [ // CHECK-NEXT: "[[PREFIX]]/modules_cdb_input2.cpp" diff --git a/clang/test/ClangScanDeps/modules-inferred.m b/clang/test/ClangScanDeps/modules-inferred.m --- a/clang/test/ClangScanDeps/modules-inferred.m +++ b/clang/test/ClangScanDeps/modules-inferred.m @@ -49,8 +49,7 @@ // CHECK-NEXT: "command-line": [ // CHECK-NEXT: "-fno-implicit-modules", // CHECK-NEXT: "-fno-implicit-module-maps", -// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[HASH_INFERRED]]/Inferred-{{[A-Z0-9]+}}.pcm", -// CHECK-NEXT: "-fmodule-map-file=[[SOURCEDIR]]/Inputs/frameworks/module.modulemap" +// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[HASH_INFERRED]]/Inferred-{{[A-Z0-9]+}}.pcm" // CHECK-NEXT: ], // CHECK-NEXT: "file-deps": [ // CHECK-NEXT: "[[PREFIX]]/modules_cdb_input.cpp" diff --git a/clang/test/ClangScanDeps/modules-pch-common-submodule.c b/clang/test/ClangScanDeps/modules-pch-common-submodule.c --- a/clang/test/ClangScanDeps/modules-pch-common-submodule.c +++ b/clang/test/ClangScanDeps/modules-pch-common-submodule.c @@ -50,7 +50,6 @@ // CHECK-PCH-NEXT: "-fno-implicit-modules" // CHECK-PCH-NEXT: "-fno-implicit-module-maps" // CHECK-PCH-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_COMMON]]/ModCommon-{{.*}}.pcm" -// CHECK-PCH-NEXT: "-fmodule-map-file=[[PREFIX]]/module.modulemap" // CHECK-PCH-NEXT: ], // CHECK-PCH-NEXT: "file-deps": [ // CHECK-PCH-NEXT: "[[PREFIX]]/pch.h" @@ -88,7 +87,6 @@ // CHECK-TU-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap", // CHECK-TU-NEXT: "command-line": [ // CHECK-TU-NEXT: "-cc1" -// CHECK-TU: "-fmodule-map-file=[[PREFIX]]/module.modulemap" // CHECK-TU: "-emit-module" // CHECK-TU: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_COMMON:.*]]/ModCommon-{{.*}}.pcm" // CHECK-TU: "-fmodules" @@ -115,8 +113,7 @@ // CHECK-TU-NEXT: "command-line": [ // CHECK-TU-NEXT: "-fno-implicit-modules", // CHECK-TU-NEXT: "-fno-implicit-module-maps", -// CHECK-TU-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_TU:.*]]/ModTU-{{.*}}.pcm", -// CHECK-TU-NEXT: "-fmodule-map-file=[[PREFIX]]/module.modulemap" +// CHECK-TU-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_TU:.*]]/ModTU-{{.*}}.pcm" // CHECK-TU-NEXT: ], // CHECK-TU-NEXT: "file-deps": [ // CHECK-TU-NEXT: "[[PREFIX]]/tu.c", diff --git a/clang/test/ClangScanDeps/modules-pch-common-via-submodule.c b/clang/test/ClangScanDeps/modules-pch-common-via-submodule.c --- a/clang/test/ClangScanDeps/modules-pch-common-via-submodule.c +++ b/clang/test/ClangScanDeps/modules-pch-common-via-submodule.c @@ -47,7 +47,6 @@ // CHECK-PCH-NEXT: "-fno-implicit-modules" // CHECK-PCH-NEXT: "-fno-implicit-module-maps" // CHECK-PCH-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_COMMON]]/ModCommon-{{.*}}.pcm" -// CHECK-PCH-NEXT: "-fmodule-map-file=[[PREFIX]]/module.modulemap" // CHECK-PCH-NEXT: ], // CHECK-PCH-NEXT: "file-deps": [ // CHECK-PCH-NEXT: "[[PREFIX]]/pch.h" @@ -112,8 +111,7 @@ // CHECK-TU-NEXT: "command-line": [ // CHECK-TU-NEXT: "-fno-implicit-modules", // CHECK-TU-NEXT: "-fno-implicit-module-maps", -// CHECK-TU-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_TU:.*]]/ModTU-{{.*}}.pcm", -// CHECK-TU-NEXT: "-fmodule-map-file=[[PREFIX]]/module.modulemap" +// CHECK-TU-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_TU:.*]]/ModTU-{{.*}}.pcm" // CHECK-TU-NEXT: ], // CHECK-TU-NEXT: "file-deps": [ // CHECK-TU-NEXT: "[[PREFIX]]/tu.c", diff --git a/clang/test/ClangScanDeps/modules-pch.c b/clang/test/ClangScanDeps/modules-pch.c --- a/clang/test/ClangScanDeps/modules-pch.c +++ b/clang/test/ClangScanDeps/modules-pch.c @@ -59,7 +59,6 @@ // CHECK-PCH-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap", // CHECK-PCH-NEXT: "command-line": [ // CHECK-PCH-NEXT: "-cc1" -// CHECK-PCH: "-fmodule-map-file=[[PREFIX]]/module.modulemap" // CHECK-PCH: "-emit-module" // CHECK-PCH: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_COMMON_2]]/ModCommon2-{{.*}}.pcm" // CHECK-PCH: "-fmodules" @@ -92,10 +91,7 @@ // CHECK-PCH-NEXT: "-fno-implicit-module-maps", // CHECK-PCH-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_COMMON_1]]/ModCommon1-{{.*}}.pcm", // CHECK-PCH-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_COMMON_2]]/ModCommon2-{{.*}}.pcm", -// CHECK-PCH-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_PCH]]/ModPCH-{{.*}}.pcm", -// CHECK-PCH-NEXT: "-fmodule-map-file=[[PREFIX]]/module.modulemap", -// CHECK-PCH-NEXT: "-fmodule-map-file=[[PREFIX]]/module.modulemap", -// CHECK-PCH-NEXT: "-fmodule-map-file=[[PREFIX]]/module.modulemap" +// CHECK-PCH-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_PCH]]/ModPCH-{{.*}}.pcm" // CHECK-PCH-NEXT: ], // CHECK-PCH-NEXT: "file-deps": [ // CHECK-PCH-NEXT: "[[PREFIX]]/pch.h" @@ -163,8 +159,7 @@ // CHECK-TU-NEXT: "command-line": [ // CHECK-TU-NEXT: "-fno-implicit-modules", // CHECK-TU-NEXT: "-fno-implicit-module-maps", -// CHECK-TU-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_TU]]/ModTU-{{.*}}.pcm", -// CHECK-TU-NEXT: "-fmodule-map-file=[[PREFIX]]/module.modulemap" +// CHECK-TU-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_TU]]/ModTU-{{.*}}.pcm" // CHECK-TU-NEXT: ], // CHECK-TU-NEXT: "file-deps": [ // CHECK-TU-NEXT: "[[PREFIX]]/tu.c", @@ -203,7 +198,6 @@ // CHECK-TU-WITH-COMMON-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap", // CHECK-TU-WITH-COMMON-NEXT: "command-line": [ // CHECK-TU-WITH-COMMON-NEXT: "-cc1", -// CHECK-TU-WITH-COMMON: "-fmodule-map-file=[[PREFIX]]/module.modulemap" // CHECK-TU-WITH-COMMON: "-emit-module", // CHECK-TU-WITH-COMMON: "-fmodule-file=[[PREFIX]]/build/{{.*}}/ModCommon1-{{.*}}.pcm", // CHECK-TU-WITH-COMMON: "-fmodule-name=ModTUWithCommon", @@ -230,9 +224,7 @@ // CHECK-TU-WITH-COMMON-NEXT: "-fno-implicit-modules", // CHECK-TU-WITH-COMMON-NEXT: "-fno-implicit-module-maps", // CHECK-TU-WITH-COMMON-NEXT: "-fmodule-file=[[PREFIX]]/build/{{.*}}/ModCommon2-{{.*}}.pcm", -// CHECK-TU-WITH-COMMON-NEXT: "-fmodule-map-file=[[PREFIX]]/module.modulemap" -// CHECK-TU-WITH-COMMON-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_TU_WITH_COMMON]]/ModTUWithCommon-{{.*}}.pcm", -// CHECK-TU-WITH-COMMON-NEXT: "-fmodule-map-file=[[PREFIX]]/module.modulemap" +// CHECK-TU-WITH-COMMON-NEXT: "-fmodule-file=[[PREFIX]]/build/[[HASH_MOD_TU_WITH_COMMON]]/ModTUWithCommon-{{.*}}.pcm" // CHECK-TU-WITH-COMMON-NEXT: ], // CHECK-TU-WITH-COMMON-NEXT: "file-deps": [ // CHECK-TU-WITH-COMMON-NEXT: "[[PREFIX]]/tu_with_common.c",