Skip to content

Commit 3a895ef

Browse files
committed
Re-Sync Options Flags
Now that cross-module incremental builds are controlled by -{enable,disable}-incremental-imports, resync the options and teach merge-modules to propagate the disable flag.
1 parent 41647b4 commit 3a895ef

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Sources/SwiftDriver/Jobs/MergeModuleJob.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ extension Driver {
6161
try commandLine.appendLast(.emitSymbolGraph, from: &parsedOptions)
6262
try commandLine.appendLast(.emitSymbolGraphDir, from: &parsedOptions)
6363

64-
// Propagate cross-module incremental builds flag so dependency information
65-
// shows up in swiftmodules.
66-
try commandLine.appendLast(.enableExperimentalCrossModuleIncrementalBuild, from: &parsedOptions)
64+
// Propagate the disable flag for cross-module incremental builds
65+
// if necessary.
66+
try commandLine.appendLast(.disableIncrementalImports, from: &parsedOptions)
6767

6868
commandLine.appendFlag(.o)
6969
commandLine.appendPath(moduleOutputInfo.output!.outputPath)

Sources/SwiftOptions/Options.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ extension Option {
8787
public static let disableGenericMetadataPrespecialization: Option = Option("-disable-generic-metadata-prespecialization", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Do not statically specialize metadata for generic types at types that are known to be used in source.")
8888
public static let disableImplicitConcurrencyModuleImport: Option = Option("-disable-implicit-concurrency-module-import", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable the implicit import of the _Concurrency module.")
8989
public static let disableImplicitSwiftModules: Option = Option("-disable-implicit-swift-modules", .flag, attributes: [.frontend, .noDriver], helpText: "Disable building Swift modules implicitly by the compiler")
90+
public static let disableIncrementalImports: Option = Option("-disable-incremental-imports", .flag, attributes: [.frontend], helpText: "Disable cross-module incremental build metadata and driver scheduling for Swift modules")
9091
public static let disableIncrementalLlvmCodegeneration: Option = Option("-disable-incremental-llvm-codegen", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable incremental llvm code generation.")
9192
public static let disableInterfaceLockfile: Option = Option("-disable-interface-lock", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Don't lock interface file when building module")
9293
public static let disableInvalidEphemeralnessAsError: Option = Option("-disable-invalid-ephemeralness-as-error", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Diagnose invalid ephemeral to non-ephemeral conversions as warnings")
@@ -109,7 +110,6 @@ extension Option {
109110
public static let disablePreviousImplementationCallsInDynamicReplacements: Option = Option("-disable-previous-implementation-calls-in-dynamic-replacements", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable calling the previous implementation in dynamic replacements")
110111
public static let disableReflectionMetadata: Option = Option("-disable-reflection-metadata", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable emission of reflection metadata for nominal types")
111112
public static let disableReflectionNames: Option = Option("-disable-reflection-names", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable emission of names of stored properties and enum cases inreflection metadata")
112-
public static let disableRequestBasedIncrementalDependencies: Option = Option("-disable-request-based-incremental-dependencies", .flag, attributes: [.frontend], helpText: "Disable request-based name tracking")
113113
public static let disableSilOwnershipVerifier: Option = Option("-disable-sil-ownership-verifier", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Do not verify ownership invariants during SIL Verification ")
114114
public static let disableSilPartialApply: Option = Option("-disable-sil-partial-apply", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable use of partial_apply in SIL generation")
115115
public static let disableSilPerfOptzns: Option = Option("-disable-sil-perf-optzns", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Don't run SIL performance optimization passes")
@@ -223,14 +223,15 @@ extension Option {
223223
public static let enableExperimentalAdditiveArithmeticDerivation: Option = Option("-enable-experimental-additive-arithmetic-derivation", .flag, attributes: [.frontend], helpText: "Enable experimental 'AdditiveArithmetic' derived conformances")
224224
public static let enableExperimentalConcisePoundFile: Option = Option("-enable-experimental-concise-pound-file", .flag, attributes: [.frontend, .moduleInterface], helpText: "Enable experimental concise '#file' identifier")
225225
public static let enableExperimentalConcurrency: Option = Option("-enable-experimental-concurrency", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable experimental concurrency model")
226-
public static let enableExperimentalConcurrentValueChecking: Option = Option("-enable-experimental-concurrent-value-checking", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable ConcurrentValue checking")
227226
public static let enableExperimentalCrossModuleIncrementalBuild: Option = Option("-enable-experimental-cross-module-incremental-build", .flag, attributes: [.frontend], helpText: "(experimental) Enable cross-module incremental build metadata and driver scheduling")
228227
public static let enableExperimentalCxxInterop: Option = Option("-enable-experimental-cxx-interop", .flag, helpText: "Allow importing C++ modules into Swift (experimental feature)")
228+
public static let enableExperimentalEnumCodableDerivation: Option = Option("-enable-experimental-enum-codable-derivation", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable experimental derivation of Codable for enums")
229229
public static let enableExperimentalFlowSensitiveConcurrentCaptures: Option = Option("-enable-experimental-flow-sensitive-concurrent-captures", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable flow-sensitive concurrent captures")
230230
public static let enableExperimentalForwardModeDifferentiation: Option = Option("-enable-experimental-forward-mode-differentiation", .flag, attributes: [.frontend], helpText: "Enable experimental forward mode differentiation")
231231
public static let enableExperimentalStaticAssert: Option = Option("-enable-experimental-static-assert", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental #assert")
232232
public static let enableFuzzyForwardScanTrailingClosureMatching: Option = Option("-enable-fuzzy-forward-scan-trailing-closure-matching", .flag, attributes: [.frontend], helpText: "Enable fuzzy forward-scan trailing closure matching")
233233
public static let enableImplicitDynamic: Option = Option("-enable-implicit-dynamic", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Add 'dynamic' to all declarations")
234+
public static let enableIncrementalImports: Option = Option("-enable-incremental-imports", .flag, attributes: [.frontend], helpText: "Enable cross-module incremental build metadata and driver scheduling for Swift modules")
234235
public static let enableInferImportAsMember: Option = Option("-enable-infer-import-as-member", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Infer when a global could be imported as a member")
235236
public static let enableInvalidEphemeralnessAsError: Option = Option("-enable-invalid-ephemeralness-as-error", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Diagnose invalid ephemeral to non-ephemeral conversions as errors")
236237
public static let enableLibraryEvolution: Option = Option("-enable-library-evolution", .flag, attributes: [.frontend, .moduleInterface], helpText: "Build the module to allow binary-compatible library evolution")
@@ -242,8 +243,8 @@ extension Option {
242243
public static let enableObjcInterop: Option = Option("-enable-objc-interop", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable Objective-C interop code generation and config directives")
243244
public static let enableOnlyOneDependencyFile: Option = Option("-enable-only-one-dependency-file", .flag, attributes: [.doesNotAffectIncrementalBuild], helpText: "Enables incremental build optimization that only produces one dependencies file")
244245
public static let enableOperatorDesignatedTypes: Option = Option("-enable-operator-designated-types", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable operator designated types")
246+
public static let enableOssaModules: Option = Option("-enable-ossa-modules", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Always serialize SIL in ossa form. If this flag is not passed in, when optimizing ownership will be lowered before serializing SIL")
245247
public static let enablePrivateImports: Option = Option("-enable-private-imports", .flag, attributes: [.helpHidden, .frontend, .noInteractive], helpText: "Allows this module's internal and private API to be accessed")
246-
public static let enableRequestBasedIncrementalDependencies: Option = Option("-enable-request-based-incremental-dependencies", .flag, attributes: [.frontend], helpText: "Enable request-based name tracking")
247248
public static let enableResilience: Option = Option("-enable-resilience", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Deprecated, use -enable-library-evolution instead")
248249
public static let enableSilOpaqueValues: Option = Option("-enable-sil-opaque-values", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable SIL Opaque Values")
249250
public static let enableSourceImport: Option = Option("-enable-source-import", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable importing of Swift source files")
@@ -590,6 +591,7 @@ extension Option {
590591
Option.disableGenericMetadataPrespecialization,
591592
Option.disableImplicitConcurrencyModuleImport,
592593
Option.disableImplicitSwiftModules,
594+
Option.disableIncrementalImports,
593595
Option.disableIncrementalLlvmCodegeneration,
594596
Option.disableInterfaceLockfile,
595597
Option.disableInvalidEphemeralnessAsError,
@@ -612,7 +614,6 @@ extension Option {
612614
Option.disablePreviousImplementationCallsInDynamicReplacements,
613615
Option.disableReflectionMetadata,
614616
Option.disableReflectionNames,
615-
Option.disableRequestBasedIncrementalDependencies,
616617
Option.disableSilOwnershipVerifier,
617618
Option.disableSilPartialApply,
618619
Option.disableSilPerfOptzns,
@@ -726,14 +727,15 @@ extension Option {
726727
Option.enableExperimentalAdditiveArithmeticDerivation,
727728
Option.enableExperimentalConcisePoundFile,
728729
Option.enableExperimentalConcurrency,
729-
Option.enableExperimentalConcurrentValueChecking,
730730
Option.enableExperimentalCrossModuleIncrementalBuild,
731731
Option.enableExperimentalCxxInterop,
732+
Option.enableExperimentalEnumCodableDerivation,
732733
Option.enableExperimentalFlowSensitiveConcurrentCaptures,
733734
Option.enableExperimentalForwardModeDifferentiation,
734735
Option.enableExperimentalStaticAssert,
735736
Option.enableFuzzyForwardScanTrailingClosureMatching,
736737
Option.enableImplicitDynamic,
738+
Option.enableIncrementalImports,
737739
Option.enableInferImportAsMember,
738740
Option.enableInvalidEphemeralnessAsError,
739741
Option.enableLibraryEvolution,
@@ -745,8 +747,8 @@ extension Option {
745747
Option.enableObjcInterop,
746748
Option.enableOnlyOneDependencyFile,
747749
Option.enableOperatorDesignatedTypes,
750+
Option.enableOssaModules,
748751
Option.enablePrivateImports,
749-
Option.enableRequestBasedIncrementalDependencies,
750752
Option.enableResilience,
751753
Option.enableSilOpaqueValues,
752754
Option.enableSourceImport,

0 commit comments

Comments
 (0)