Skip to content

[5.5] Eat -experimental-emit-module-separately #38610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/swift/Option/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,10 @@ def experimental_cxx_stdlib :
Separate<["-"], "experimental-cxx-stdlib">,
HelpText<"C++ standard library to use; forwarded to Clang's -stdlib flag">;

def experimental_emit_module_separately:
Flag<["-"], "experimental-emit-module-separately">,
Flags<[FrontendOption, NoInteractiveOption, HelpHidden]>,
HelpText<"Schedule a swift module emission job instead of a merge-modules job (new Driver only)">;

// Diagnostic control options
def suppress_warnings : Flag<["-"], "suppress-warnings">,
Expand Down
15 changes: 15 additions & 0 deletions test/Driver/emit_module_separately.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// RUN: %empty-directory(%t)
// RUN: touch %t/file1.swift %t/file2.swift %t/file3.swift
// RUN: echo 'public func main() {}' >%t/main.swift
//
// RUN: %target-swiftc_driver -driver-skip-execution -c -emit-module -module-name main -driver-print-jobs %s -experimental-emit-module-separately %t/file1.swift %t/file2.swift %t/file3.swift %t/main.swift 2>^1 | %FileCheck -check-prefix NORMAL %s
// RUN: %target-swiftc_driver -driver-skip-execution -c -emit-module -module-name main -driver-print-jobs -incremental %s -experimental-emit-module-separately %t/file1.swift %t/file2.swift %t/file3.swift %t/main.swift 2>^1 | %FileCheck -check-prefix INCREMENTAL %s

// Just test that we eat this argument. Only the new driver knows what to do
// here. The legacy driver will just fall back to a merge-modules job as usual.
// NORMAL: swift
// NORMAL-NOT: -experimental-emit-module-separately

// INCREMENTAL: swift
// INCREMENTAL: -merge-modules
// INCREMENTAL-NOT: -experimental-emit-module-separately