You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix cross-module-optimization builds and add the option -disable-cmo
The driver splits the compile job into two jobs: one for creating the object file, one for emitting the swiftmodule.
For the swiftmodule-job the driver adds -experimental-skip-non-inlinable-function-bodies-without-types.
This breaks CMO, because in CMO, the inlinable-decision is not derived from the AST but done in the optimizer.
As a quick hack we could disable -experimental-skip-non-inlinable-function-bodies-without-types.
But for CMO, the two-job approach is highly problematic, because it risks the two compile jobs to get out of sync, e.g. by different command line options, indeterministic behavior, etc. This can result in unresolved symbol errors, which are very hard to debug.
This change also adds a new option `-disable-cmo` to disable cross-module-optimization. It can be used to go back to the old behavior.
rdar://89223981
Copy file name to clipboardExpand all lines: Sources/SwiftOptions/Options.swift
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,7 @@ extension Option {
61
61
publicstaticletcontinueBuildingAfterErrors:Option=Option("-continue-building-after-errors",.flag, attributes:[.frontend,.doesNotAffectIncrementalBuild], helpText:"Continue building, even after errors are encountered")
62
62
publicstaticletcoveragePrefixMap:Option=Option("-coverage-prefix-map",.separate, attributes:[.frontend], metaVar:"<prefix=replacement>", helpText:"Remap source paths in coverage info")
publicstaticletdebugAssertAfterParse:Option=Option("-debug-assert-after-parse",.flag, attributes:[.helpHidden,.frontend,.noDriver], helpText:"Force an assertion failure after parsing", group:.debugCrash)
0 commit comments