diff --git a/lib/ClangImporter/ClangModuleDependencyScanner.cpp b/lib/ClangImporter/ClangModuleDependencyScanner.cpp index cea3f120bdd..a0600cffa06 100644 --- a/lib/ClangImporter/ClangModuleDependencyScanner.cpp +++ b/lib/ClangImporter/ClangModuleDependencyScanner.cpp @@ -238,7 +238,7 @@ void ClangImporter::recordModuleDependencies( clangModuleDep.IncludeTreeID ? *clangModuleDep.IncludeTreeID : ""; if (ctx.ClangImporterOpts.CASOpts) { - swiftArgs.push_back("-enable-cas"); + swiftArgs.push_back("-cache-compile-job"); if (!ctx.ClangImporterOpts.CASOpts->CASPath.empty()) { swiftArgs.push_back("-cas-path"); swiftArgs.push_back(ctx.ClangImporterOpts.CASOpts->CASPath); @@ -345,7 +345,7 @@ void ClangImporter::recordBridgingHeaderOptions( llvm::for_each(clangArgs, addClangArg); if (ctx.ClangImporterOpts.CASOpts) { - swiftArgs.push_back("-enable-cas"); + swiftArgs.push_back("-cache-compile-job"); if (!ctx.ClangImporterOpts.CASOpts->CASPath.empty()) { swiftArgs.push_back("-cas-path"); swiftArgs.push_back(ctx.ClangImporterOpts.CASOpts->CASPath); diff --git a/lib/DependencyScan/ScanDependencies.cpp b/lib/DependencyScan/ScanDependencies.cpp index b10180b8f54..43b1542eb54 100644 --- a/lib/DependencyScan/ScanDependencies.cpp +++ b/lib/DependencyScan/ScanDependencies.cpp @@ -1016,20 +1016,6 @@ static void writeJSON(llvm::raw_ostream &out, 5, /*trailingComma=*/true); out.indent(5 * 2); - out << "\"commandLine\": [\n"; - for (int i = 0, count = swiftTextualDeps->command_line->count; - i < count; ++i) { - const auto &arg = - get_C_string(swiftTextualDeps->command_line->strings[i]); - out.indent(6 * 2); - out << "\"" << quote(arg) << "\""; - if (i != count - 1) - out << ","; - out << "\n"; - } - out.indent(5 * 2); - out << "],\n"; - out.indent(5 * 2); out << "\"compiledModuleCandidates\": [\n"; for (int i = 0, count = swiftTextualDeps->compiled_module_candidates->count; @@ -1045,6 +1031,20 @@ static void writeJSON(llvm::raw_ostream &out, out.indent(5 * 2); out << "],\n"; } + out.indent(5 * 2); + out << "\"commandLine\": [\n"; + for (int i = 0, count = swiftTextualDeps->command_line->count; i < count; + ++i) { + const auto &arg = + get_C_string(swiftTextualDeps->command_line->strings[i]); + out.indent(6 * 2); + out << "\"" << quote(arg) << "\""; + if (i != count - 1) + out << ","; + out << "\n"; + } + out.indent(5 * 2); + out << "],\n"; bool hasBridgingHeaderPath = swiftTextualDeps->bridging_header_path.data && get_C_string(swiftTextualDeps->bridging_header_path)[0] != '\0'; diff --git a/lib/Frontend/ModuleInterfaceLoader.cpp b/lib/Frontend/ModuleInterfaceLoader.cpp index 7d4e311dc5a..ea3f90f4154 100644 --- a/lib/Frontend/ModuleInterfaceLoader.cpp +++ b/lib/Frontend/ModuleInterfaceLoader.cpp @@ -1604,7 +1604,7 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface( if (clangImporterOpts.CASOpts) { genericSubInvocation.getClangImporterOptions().CASOpts = clangImporterOpts.CASOpts; - GenericArgs.push_back("-enable-cas"); + GenericArgs.push_back("-cache-compile-job"); if (!clangImporterOpts.CASOpts->CASPath.empty()) { GenericArgs.push_back("-cas-path"); GenericArgs.push_back(clangImporterOpts.CASOpts->CASPath); diff --git a/test/CAS/module_deps.swift b/test/CAS/module_deps.swift index e7bbdb39797..90d92fd74f9 100644 --- a/test/CAS/module_deps.swift +++ b/test/CAS/module_deps.swift @@ -66,7 +66,8 @@ import SubE // CHECK-DAG: "swift": "_Concurrency" // CHECK-DAG: "swift": "_cross_import_E" // CHECK: ], - +// CHECK: "commandLine": +// CHECK: "casFSRootID": // CHECK: "extraPcmArgs": [ // CHECK-NEXT: "-Xcc", // CHECK-NEXT: "-target", @@ -124,6 +125,8 @@ import SubE // CHECK: "commandLine": [ // CHECK: "-compile-module-from-interface" // CHECK: "-target" +// CHECK: "-cache-compile-job" +// CHECK: "-cas-path" // CHECK: "-module-name" // CHECK: "G" // CHECK: "-swift-version" diff --git a/test/CAS/module_deps_include_tree.swift b/test/CAS/module_deps_include_tree.swift index 75231ed9e33..cca45e28b85 100644 --- a/test/CAS/module_deps_include_tree.swift +++ b/test/CAS/module_deps_include_tree.swift @@ -119,6 +119,8 @@ import SubE // CHECK: "commandLine": [ // CHECK: "-compile-module-from-interface" // CHECK: "-target" +// CHECK: "-cache-compile-job" +// CHECK: "-cas-path" // CHECK: "-module-name" // CHECK: "G" // CHECK: "-swift-version" diff --git a/test/ModuleInterface/clang-session-transitive.swift b/test/ModuleInterface/clang-session-transitive.swift index bc4ac51f7da..345e71f7798 100644 --- a/test/ModuleInterface/clang-session-transitive.swift +++ b/test/ModuleInterface/clang-session-transitive.swift @@ -33,6 +33,9 @@ import TestModule // CHECK-NEXT: "swift": { // CHECK-NEXT: "moduleInterfacePath": // CHECK-NEXT: "contextHash": + // CHECK-NEXT: "compiledModuleCandidates": [ + // CHECK-NEXT: TestModule.swiftmodule + // CHECK-NEXT: ], // CHECK-NEXT: "commandLine": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-compile-module-from-interface", diff --git a/test/ModuleInterface/extension-transitive-availability.swift b/test/ModuleInterface/extension-transitive-availability.swift index aebbae9b9af..4c9bb681530 100644 --- a/test/ModuleInterface/extension-transitive-availability.swift +++ b/test/ModuleInterface/extension-transitive-availability.swift @@ -42,6 +42,8 @@ func foo() { // CHECK-NEXT: "swift": { // CHECK-NEXT: "moduleInterfacePath": // CHECK-NEXT: "contextHash": +// CHECK-NEXT: "compiledModuleCandidates": [ +// CHECK-NEXT: ], // CHECK-NEXT: "commandLine": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-compile-module-from-interface",