Skip to content

Commit f2b3f8f

Browse files
authored
Merge pull request swiftlang#31621 from davezarzycki/pr31621
Remove all uses of -force-single-frontend-invocation
2 parents 22d657c + 5dcc32f commit f2b3f8f

File tree

82 files changed

+104
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+104
-105
lines changed

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function (add_swift_benchmark_library objfile_out sibfile_out swiftmodule_out)
189189
DEPENDS ${stdlib_dependencies} ${sources} ${BENCHLIB_DEPENDS}
190190
COMMAND "${SWIFT_EXEC}"
191191
${BENCHLIB_LIBRARY_FLAGS}
192-
"-force-single-frontend-invocation"
192+
"-whole-module-optimization"
193193
"-parse-as-library"
194194
"-module-name" "${module_name}"
195195
"-emit-module" "-emit-module-path" "${swiftmodule}"
@@ -209,7 +209,7 @@ function (add_swift_benchmark_library objfile_out sibfile_out swiftmodule_out)
209209
${stdlib_dependencies} ${sources} ${BENCHLIB_DEPENDS}
210210
COMMAND "${SWIFT_EXEC}"
211211
${BENCHLIB_LIBRARY_FLAGS}
212-
"-force-single-frontend-invocation"
212+
"-whole-module-optimization"
213213
"-parse-as-library"
214214
"-module-name" "${module_name}"
215215
"-emit-sib"
@@ -574,7 +574,7 @@ function (swift_benchmark_compile_archopts)
574574
${SWIFT_BENCH_SIBFILES} "${source}"
575575
COMMAND "${SWIFT_EXEC}"
576576
${common_swift4_options}
577-
"-force-single-frontend-invocation"
577+
"-whole-module-optimization"
578578
"-emit-module" "-module-name" "${module_name}"
579579
"-I" "${objdir}"
580580
"-o" "${objdir}/${module_name}.o"

docs/CompilerPerformance.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ running in, and often to perform separate analysis for each mode. The
100100
significant modes are:
101101

102102
- **Primary-file** vs. **whole-module**: this varies depending on whether the
103-
driver is run with the flag `-wmo`, `-whole-module-optimization` or
104-
`-force-single-frontend-invocation` (all these options are synonymous).
103+
driver is run with the flag `-wmo` (a.k.a. `-whole-module-optimization`).
105104

106105
- **Batch** vs. **single-file** primary-file mode. This distinction refines
107106
the behaviour of primary-file mode, with the new batch mode added in the

lib/Driver/FrontendUtil.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ bool swift::driver::getSingleFrontendInvocationFromDriverArguments(
3232

3333
// When creating a CompilerInvocation, ensure that the driver creates a single
3434
// frontend command.
35-
Args.push_back("-force-single-frontend-invocation");
35+
Args.push_back("-whole-module-optimization");
3636

3737
// Explictly disable batch mode to avoid a spurious warning when combining
38-
// -enable-batch-mode with -force-single-frontend-invocation. This is an
38+
// -enable-batch-mode with -whole-module-optimization. This is an
3939
// implementation detail.
4040
Args.push_back("-disable-batch-mode");
4141

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function(handle_swift_sources
9090

9191
# FIXME: We shouldn't /have/ to build things in a single process.
9292
# <rdar://problem/15972329>
93-
list(APPEND swift_compile_flags "-force-single-frontend-invocation")
93+
list(APPEND swift_compile_flags "-whole-module-optimization")
9494

9595
_compile_swift_files(
9696
dependency_target

test/Driver/actions-dsym.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
// LINK-DEBUG-SWIFTMODULES: 7: link, {1, 2, 3, 4, 5, 6}, image
108108

109109
// RUN: touch %t/a.o %t/b.o
110-
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions -force-single-frontend-invocation 2>&1 | %FileCheck %s -check-prefix=WHOLE-MODULE
110+
// RUN: %swiftc_driver -driver-print-actions -target x86_64-apple-macosx10.9 -g %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions -whole-module-optimization 2>&1 | %FileCheck %s -check-prefix=WHOLE-MODULE
111111
// WHOLE-MODULE: 0: input, "{{.*}}Inputs/main.swift", swift
112112
// WHOLE-MODULE: 1: input, "{{.*}}Inputs/empty.swift", swift
113113
// WHOLE-MODULE: 2: input, "{{.*}}actions-dsym.swift", swift

test/Driver/actions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
// COMPILE-PLUS-OBJECT-MACHO: 3: link, {0, 2}, image
194194

195195

196-
// RUN: %swiftc_driver -driver-print-actions %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions -force-single-frontend-invocation 2>&1 | %FileCheck %s -check-prefix=WHOLE-MODULE -check-prefix WHOLE-MODULE-%target-object-format
196+
// RUN: %swiftc_driver -driver-print-actions %S/Inputs/main.swift %S/../Inputs/empty.swift %s -module-name actions -whole-module-optimization 2>&1 | %FileCheck %s -check-prefix=WHOLE-MODULE -check-prefix WHOLE-MODULE-%target-object-format
197197
// WHOLE-MODULE: 0: input, "{{.*}}Inputs/main.swift", swift
198198
// WHOLE-MODULE: 1: input, "{{.*}}Inputs/empty.swift", swift
199199
// WHOLE-MODULE: 2: input, "{{.*}}actions.swift", swift

test/Driver/embed-bitcode.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@
4444
// CHECK-MODULE-NOT: -fake-llvm-option
4545
// CHECK-MODULE-NOT: -emit-module-path
4646

47-
// RUN: %target-swiftc_driver -embed-bitcode -force-single-frontend-invocation %s 2>&1 -### | %FileCheck %s -check-prefix=CHECK-SINGLE
47+
// RUN: %target-swiftc_driver -embed-bitcode -whole-module-optimization %s 2>&1 -### | %FileCheck %s -check-prefix=CHECK-SINGLE
4848
// CHECK-SINGLE: -frontend
4949
// CHECK-SINGLE: -emit-bc
5050
// CHECK-SINGLE: -frontend
5151
// CHECK-SINGLE: -c
5252
// CHECK-SINGLE: -embed-bitcode
5353
// CHECK-SINGLE: -disable-llvm-optzns
5454

55-
// RUN: %target-swiftc_driver -embed-bitcode -force-single-frontend-invocation -O %s 2>&1 -### | %FileCheck %s -check-prefix=CHECK-SINGLE-OPT
55+
// RUN: %target-swiftc_driver -embed-bitcode -whole-module-optimization -O %s 2>&1 -### | %FileCheck %s -check-prefix=CHECK-SINGLE-OPT
5656
// CHECK-SINGLE-OPT: -frontend
5757
// CHECK-SINGLE-OPT-SAME: -emit-bc
5858
// CHECK-SINGLE-OPT-SAME: -O{{[" ]}}
@@ -62,7 +62,7 @@
6262
// CHECK-SINGLE-OPT-SAME: -O{{[" ]}}
6363
// CHECK-SINGLE-OPT-SAME: -disable-llvm-optzns
6464

65-
// RUN: %target-swiftc_driver -embed-bitcode -force-single-frontend-invocation -Osize %s 2>&1 -### | %FileCheck %s -check-prefix=CHECK-SINGLE-OPT-SIZE
65+
// RUN: %target-swiftc_driver -embed-bitcode -whole-module-optimization -Osize %s 2>&1 -### | %FileCheck %s -check-prefix=CHECK-SINGLE-OPT-SIZE
6666
// CHECK-SINGLE-OPT-SIZE: -frontend
6767
// CHECK-SINGLE-OPT-SIZE-SAME: -emit-bc
6868
// CHECK-SINGLE-OPT-SIZE-SAME: -Osize
@@ -72,7 +72,7 @@
7272
// CHECK-SINGLE-OPT-SIZE-SAME: -Osize
7373
// CHECK-SINGLE-OPT-SIZE-SAME: -disable-llvm-optzns
7474

75-
// RUN: %target-swiftc_driver -embed-bitcode -target-cpu abc -force-single-frontend-invocation %s 2>&1 -### | %FileCheck %s -check-prefix=CHECK-SINGLE-MISC
75+
// RUN: %target-swiftc_driver -embed-bitcode -target-cpu abc -whole-module-optimization %s 2>&1 -### | %FileCheck %s -check-prefix=CHECK-SINGLE-MISC
7676
// CHECK-SINGLE-MISC: -frontend
7777
// CHECK-SINGLE-MISC-SAME: -emit-bc
7878
// CHECK-SINGLE-MISC-SAME: -target-cpu abc
@@ -82,7 +82,7 @@
8282
// CHECK-SINGLE-MISC-SAME: -target-cpu abc
8383
// CHECK-SINGLE-MISC-SAME: -disable-llvm-optzns
8484

85-
// RUN: %target-swiftc_driver -embed-bitcode -c -parse-as-library -emit-module -force-single-frontend-invocation %s -parse-stdlib -module-name Swift 2>&1 -### | %FileCheck %s -check-prefix=CHECK-LIB-WMO
85+
// RUN: %target-swiftc_driver -embed-bitcode -c -parse-as-library -emit-module -whole-module-optimization %s -parse-stdlib -module-name Swift 2>&1 -### | %FileCheck %s -check-prefix=CHECK-LIB-WMO
8686
// CHECK-LIB-WMO: -frontend
8787
// CHECK-LIB-WMO: -emit-bc
8888
// CHECK-LIB-WMO: -parse-stdlib

test/Driver/emit-interface.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
// CHECK-SAME: -emit-module-interface-path {{.+[/\\]}}foo.swiftinterface
77
// CHECK: {{(bin/)?}}ld
88

9-
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface -o %t/foo -force-single-frontend-invocation 2>&1 | %FileCheck -check-prefix=CHECK-WHOLE-MODULE %s
9+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface -o %t/foo -whole-module-optimization 2>&1 | %FileCheck -check-prefix=CHECK-WHOLE-MODULE %s
1010

1111
// CHECK-WHOLE-MODULE: swift{{c?(\.exe)?"?}} -frontend
1212
// CHECK-WHOLE-MODULE-SAME: emit-interface.swift
1313
// CHECK-WHOLE-MODULE-SAME: -emit-module-interface-path {{.+[/\\]}}foo.swiftinterface
1414
// CHECK-WHOLE-MODULE-NOT: -merge-modules
1515
// CHECK-WHOLE-MODULE: {{(bin/)?}}ld
1616

17-
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface-path %t/unrelated.swiftinterface -o %t/foo -force-single-frontend-invocation 2>&1 | %FileCheck -check-prefix=CHECK-EXPLICIT-PATH %s
17+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface-path %t/unrelated.swiftinterface -o %t/foo -whole-module-optimization 2>&1 | %FileCheck -check-prefix=CHECK-EXPLICIT-PATH %s
1818

1919
// CHECK-EXPLICIT-PATH: swift{{c?(\.exe)?"?}} -frontend
2020
// CHECK-EXPLICIT-PATH-SAME: emit-interface.swift
2121
// CHECK-EXPLICIT-PATH-SAME: -emit-module-interface-path {{.+[/\\]}}unrelated.swiftinterface
2222

2323
// Ensure that we emit arguments when we force filelists as well
24-
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface -o %t/foo -module-name foo -force-single-frontend-invocation -driver-filelist-threshold=0 2>&1 | %FileCheck -check-prefix=CHECK-FILELIST %s
24+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface -o %t/foo -module-name foo -whole-module-optimization -driver-filelist-threshold=0 2>&1 | %FileCheck -check-prefix=CHECK-FILELIST %s
2525

2626
// CHECK-FILELIST: swift{{c?(\.exe)?"?}} -frontend
2727
// CHECK-FILELIST-SAME: -supplementary-output-file-map

test/Driver/emit-objc-header-single-vs-multi-file.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// FIXME: END -enable-source-import hackaround
66

77
// RUN: %target-swiftc_driver %clang-importer-sdk-nosource -emit-module -o %t.1.swiftmodule -emit-objc-header -emit-objc-header-path %t.1.h -module-name ThisModule %s %S/Inputs/main.swift %S/Inputs/lib.swift -I %t
8-
// RUN: %target-swiftc_driver %clang-importer-sdk-nosource -emit-module -o %t.2.swiftmodule -emit-objc-header -emit-objc-header-path %t.2.h -module-name ThisModule %s %S/Inputs/main.swift %S/Inputs/lib.swift -force-single-frontend-invocation -I %t
8+
// RUN: %target-swiftc_driver %clang-importer-sdk-nosource -emit-module -o %t.2.swiftmodule -emit-objc-header -emit-objc-header-path %t.2.h -module-name ThisModule %s %S/Inputs/main.swift %S/Inputs/lib.swift -whole-module-optimization -I %t
99
// RUN: diff %t.1.h %t.2.h
1010

1111
// REQUIRES: objc_interop

test/Driver/emit-objc-header.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// CHECK-SAME: -emit-objc-header-path {{.+}}/foo.h
77
// CHECK: {{(bin/)?}}ld
88

9-
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-objc-header-path %t/foo.h -force-single-frontend-invocation 2>&1 | %FileCheck -check-prefix=CHECK-WHOLE-MODULE %s
9+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-objc-header-path %t/foo.h -whole-module-optimization 2>&1 | %FileCheck -check-prefix=CHECK-WHOLE-MODULE %s
1010

1111
// CHECK-WHOLE-MODULE: swift{{c?(\.exe)?"?}} -frontend
1212
// CHECK-WHOLE-MODULE-SAME: emit-objc-header.swift

0 commit comments

Comments
 (0)