Skip to content

Commit 14d7e60

Browse files
committed
Eat -experimental-emit-module-separately
SourceKit invokes the legacy driver. Providing this flag in the IDE means the command lines SourceKit forms to run semantic requests in the editor are all invalid. Teach the legacy driver to eat this flag. rdar://80811565
1 parent 032de59 commit 14d7e60

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

include/swift/Option/Options.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ def experimental_cxx_stdlib :
579579
Separate<["-"], "experimental-cxx-stdlib">,
580580
HelpText<"C++ standard library to use; forwarded to Clang's -stdlib flag">;
581581

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

583587
// Diagnostic control options
584588
def suppress_warnings : Flag<["-"], "suppress-warnings">,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: touch %t/file1.swift %t/file2.swift %t/file3.swift
3+
// RUN: echo 'public func main() {}' >%t/main.swift
4+
//
5+
// 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
6+
// 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
7+
8+
// Just test that we eat this argument. Only the new driver knows what to do
9+
// here. The legacy driver will just fall back to a merge-modules job as usual.
10+
// NORMAL: swift
11+
// NORMAL-NOT: -experimental-emit-module-separately
12+
13+
// INCREMENTAL: swift
14+
// INCREMENTAL: -merge-modules
15+
// INCREMENTAL-NOT: -experimental-emit-module-separately

0 commit comments

Comments
 (0)