diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index 3e89fc1062711..4086424615ad8 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -273,9 +273,6 @@ namespace swift { /// Emit a remark when indexing a system module. bool EnableIndexingSystemModuleRemarks = false; - /// Emit a remark on early exit in explicit interface build - bool EnableSkipExplicitInterfaceModuleBuildRemarks = false; - /// /// Support for alternate usage modes /// diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index cd8f06de95917..d2f488fb6c5d0 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1478,8 +1478,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args, Opts.EnableMacroLoadingRemarks = Args.hasArg(OPT_remark_macro_loading); Opts.EnableIndexingSystemModuleRemarks = Args.hasArg(OPT_remark_indexing_system_module); - Opts.EnableSkipExplicitInterfaceModuleBuildRemarks = Args.hasArg(OPT_remark_skip_explicit_interface_build); - if (Args.hasArg(OPT_experimental_skip_non_exportable_decls)) { // Only allow -experimental-skip-non-exportable-decls if either library // evolution is enabled (in which case the module's ABI is independent of diff --git a/lib/Frontend/ModuleInterfaceLoader.cpp b/lib/Frontend/ModuleInterfaceLoader.cpp index ec3a53d8ec57f..8175222beb496 100644 --- a/lib/Frontend/ModuleInterfaceLoader.cpp +++ b/lib/Frontend/ModuleInterfaceLoader.cpp @@ -1609,27 +1609,6 @@ bool ModuleInterfaceLoader::buildExplicitSwiftModuleFromSwiftInterface( StringRef outputPath, bool ShouldSerializeDeps, ArrayRef CompiledCandidates, DependencyTracker *tracker) { - - if (!Instance.getInvocation().getIRGenOptions().AlwaysCompile) { - // First, check if the expected output already exists and possibly - // up-to-date w.r.t. all of the dependencies it was built with. If so, early - // exit. - UpToDateModuleCheker checker( - Instance.getASTContext()); - ModuleRebuildInfo rebuildInfo; - SmallVector allDeps; - std::unique_ptr moduleBuffer; - if (checker.swiftModuleIsUpToDate(outputPath, rebuildInfo, allDeps, - moduleBuffer)) { - if (Instance.getASTContext() - .LangOpts.EnableSkipExplicitInterfaceModuleBuildRemarks) { - Instance.getDiags().diagnose( - SourceLoc(), diag::explicit_interface_build_skipped, outputPath); - } - return false; - } - } - // Read out the compiler version. llvm::BumpPtrAllocator alloc; llvm::StringSaver ArgSaver(alloc); diff --git a/test/Frontend/output_determinism_check.swift b/test/Frontend/output_determinism_check.swift index 1502fb264376f..f1e36c5c0ac55 100644 --- a/test/Frontend/output_determinism_check.swift +++ b/test/Frontend/output_determinism_check.swift @@ -14,11 +14,9 @@ // RUN: %target-swift-frontend -scan-dependencies -module-name test -o %t/test.json %s -enable-deterministic-check 2>&1 | %FileCheck %s --check-prefix=DEPSCAN_OUTPUT /// TODO: Implicit module build use a different compiler instance so it doesn't support checking yet. // RUN: %target-swift-frontend -typecheck -emit-module-interface-path %t/test.swiftinterface %s -O -enable-deterministic-check 2>&1 | %FileCheck %s --check-prefix=INTERFACE_OUTPUT + /// Hit cache and not emit the second time. -// RUN: rm %t/test.swiftmodule -// RUN: not %target-swift-frontend -compile-module-from-interface %t/test.swiftinterface -explicit-interface-module-build -o %t/test.swiftmodule -enable-deterministic-check 2>&1 | %FileCheck --check-prefix=MODULE_MISMATCH %s -/// Force swiftmodule generation. -// RUN: %target-swift-frontend -compile-module-from-interface %t/test.swiftinterface -explicit-interface-module-build -o %t/test.swiftmodule -enable-deterministic-check -always-compile-output-files 2>&1 | %FileCheck --check-prefix=MODULE_OUTPUT %s +// RUN: %target-swift-frontend -compile-module-from-interface %t/test.swiftinterface -explicit-interface-module-build -o %t/test.swiftmodule -enable-deterministic-check 2>&1 | %FileCheck --check-prefix=MODULE_OUTPUT %s // RUN: %target-swift-frontend -emit-pcm -module-name UserClangModule -o %t/test.pcm %S/Inputs/dependencies/module.modulemap -enable-deterministic-check 2>&1 | %FileCheck %s --check-prefix=PCM_OUTPUT @@ -34,7 +32,6 @@ // OBJECT_MISMATCH: error: output file '{{.*}}{{/|\\}}test.o' is missing from second compilation for deterministic check // DEPSCAN_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.json' // INTERFACE_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.swiftinterface' -// MODULE_MISMATCH: error: output file '{{.*}}{{/|\\}}test.swiftmodule' is missing from second compilation for deterministic check // PCM_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.pcm' public var x = 1 diff --git a/test/ModuleInterface/repeated-explicit-interface-build-nop.swiftinterface b/test/ModuleInterface/repeated-explicit-interface-build-nop.swiftinterface deleted file mode 100644 index 61ea233981188..0000000000000 --- a/test/ModuleInterface/repeated-explicit-interface-build-nop.swiftinterface +++ /dev/null @@ -1,14 +0,0 @@ -// swift-interface-format-version: 1.0 -// swift-module-flags: -parse-stdlib - -// RUN: %empty-directory(%t) -// RUN: %target-swift-frontend -compile-module-from-interface -module-name ExplicitModule -explicit-interface-module-build -o %/t/ExplicitModule.swiftmodule %s - -// RUN: %target-swift-frontend -compile-module-from-interface -module-name ExplicitModule -explicit-interface-module-build -o %/t/ExplicitModule.swiftmodule %s -Rskip-explicit-interface-build 2>&1 | %FileCheck %s - -import Swift -extension Int { - public static var fortytwo: Int = 42 -} - -// CHECK: :0: remark: Skipped rebuilding module at {{.*}}ExplicitModule.swiftmodule - up-to-date \ No newline at end of file diff --git a/test/ScanDependencies/explicit-interface-build.swift b/test/ScanDependencies/explicit-interface-build.swift new file mode 100644 index 0000000000000..228e535d759fc --- /dev/null +++ b/test/ScanDependencies/explicit-interface-build.swift @@ -0,0 +1,25 @@ +// RUN: %empty-directory(%t) +// RUN: %empty-directory(%t/module-cache) +// RUN: %empty-directory(%t/Foo.swiftmodule) +// RUN: split-file %s %t + +// Build module from interface +// RUN: %target-swift-frontend -compile-module-from-interface -o %t/Foo.swiftmodule/Foo.swiftmodule -module-name Foo %t/Foo.swiftmodule/Foo.swiftinterface -explicit-interface-module-build + +// Add to the textual interface +// RUN: echo "struct GoodBye {}" >> %t/Foo.swiftmodule/Foo.swiftinterface + +// Build module from interface +// RUN: %target-swift-frontend -compile-module-from-interface -o %t/Foo.swiftmodule/Foo.swiftmodule -module-name Foo %t/Foo.swiftmodule/Foo.swiftinterface -explicit-interface-module-build + +// Get the list of strings and ensure the binary module reflects the new addition +// RUN: %llvm-strings %t/Foo.swiftmodule/Foo.swiftmodule > %t/module_strings.txt + +// RUN: cat %t/module_strings.txt | %FileCheck %s +// CHECK-DAG: Hello +// CHECK-DAG: GoodBye + +//--- Foo.swiftmodule/Foo.swiftinterface +// swift-interface-format-version: 1.0 +// swift-module-flags: -module-name Foo +struct Hello {}