Skip to content

Commit f2522c6

Browse files
authored
Merge pull request #1663 from tshortli/enable-cmo-everything
Pass `-enable-cmo-everything` to frontend jobs
2 parents ead3302 + 5fe861e commit f2522c6

File tree

4 files changed

+45
-14
lines changed

4 files changed

+45
-14
lines changed

Sources/SwiftDriver/Jobs/CompileJob.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ extension Driver {
296296
if Driver.canDoCrossModuleOptimization(parsedOptions: &parsedOptions) &&
297297
// For historical reasons, -cross-module-optimization turns on "aggressive" CMO
298298
// which is different from "default" CMO.
299-
!parsedOptions.hasArgument(.CrossModuleOptimization) {
299+
!parsedOptions.hasArgument(.CrossModuleOptimization) &&
300+
!parsedOptions.hasArgument(.EnableCMOEverything) {
300301
assert(!emitModuleSeparately, "Cannot emit module separately with cross-module-optimization")
301302
commandLine.appendFlag("-enable-default-cmo")
302303
}
@@ -370,6 +371,7 @@ extension Driver {
370371

371372
try commandLine.appendLast(.trackSystemDependencies, from: &parsedOptions)
372373
try commandLine.appendLast(.CrossModuleOptimization, from: &parsedOptions)
374+
try commandLine.appendLast(.EnableCMOEverything, from: &parsedOptions)
373375
try commandLine.appendLast(.ExperimentalPerformanceAnnotations, from: &parsedOptions)
374376

375377
try commandLine.appendLast(.runtimeCompatibilityVersion, from: &parsedOptions)

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

+1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ extension Driver {
197197
try commandLine.appendLast(.fixitAll, from: &parsedOptions)
198198
try commandLine.appendLast(.warnSwift3ObjcInferenceMinimal, .warnSwift3ObjcInferenceComplete, from: &parsedOptions)
199199
try commandLine.appendLast(.warnImplicitOverrides, from: &parsedOptions)
200+
try commandLine.appendLast(.warnSoftDeprecated, from: &parsedOptions)
200201
try commandLine.appendLast(.typoCorrectionLimit, from: &parsedOptions)
201202
try commandLine.appendLast(.enableAppExtension, from: &parsedOptions)
202203
try commandLine.appendLast(.enableLibraryEvolution, from: &parsedOptions)

0 commit comments

Comments
 (0)