Skip to content

Commit a1e5a06

Browse files
authored
Merge pull request #84530 from eeckstein/remove-enable-oss-module-option
Remove the `-enable-ossa-modules` option
2 parents eef4780 + 7217722 commit a1e5a06

File tree

62 files changed

+98
-403
lines changed

Some content is hidden

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

62 files changed

+98
-403
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ add_compile_options(
193193
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>"
194194
"$<$<COMPILE_LANGUAGE:Swift>:-no-link-objc-runtime>"
195195
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enforce-exclusivity=unchecked>"
196-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-ossa-modules>"
197196
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -empty-abi-descriptor>"
198197
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -target-min-inlining-version -Xfrontend min>"
199198
"$<$<AND:$<NOT:$<BOOL:${SwiftCore_ENABLE_OBJC_INTEROP}>>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xfrontend -disable-objc-interop>"

Runtimes/Overlay/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ add_compile_options(
7171
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-concurrency-module-import>"
7272
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>"
7373
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enforce-exclusivity=unchecked>"
74-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-ossa-modules>"
7574
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -target-min-inlining-version -Xfrontend min>"
7675
"$<$<AND:$<BOOL:${${PROJECT_NAME}_ENABLE_LIBRARY_EVOLUTION}>,$<COMPILE_LANGUAGE:Swift>>:-enable-library-evolution>"
7776
"$<$<AND:$<BOOL:${${PROJECT_NAME}_ENABLE_PRESPECIALIZATION}>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xfrontend -prespecialize-generic-metadata>")

Runtimes/Supplemental/Observation/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ add_compile_options(
7878
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature Macros>"
7979
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature ExtensionMacros>"
8080
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-lexical-lifetimes=false>"
81-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-ossa-modules>"
8281
"$<$<COMPILE_LANGUAGE:Swift>:-warn-implicit-overrides>"
8382
"$<$<AND:$<BOOL:${${PROJECT_NAME}_ENABLE_LIBRARY_EVOLUTION}>,$<COMPILE_LANGUAGE:Swift>>:-enable-library-evolution>"
8483
"$<$<AND:$<BOOL:${${PROJECT_NAME}_ENABLE_PRESPECIALIZATION}>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xfrontend -prespecialize-generic-metadata>")

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,9 +958,6 @@ ERROR(serialization_target_too_new_repl,none,
958958
"deployment target of %0 %3: %4",
959959
(StringRef, llvm::VersionTuple, Identifier, llvm::VersionTuple,
960960
StringRef))
961-
ERROR(serialization_non_ossa_module_incompatible, Fatal,
962-
"cannot import non-OSSA module into an OSSA module",
963-
(Identifier))
964961

965962
ERROR(serialization_fatal,Fatal,
966963
"fatal error encountered while reading from module '%0'; "

include/swift/AST/SILOptions.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ enum class CopyPropagationOption : uint8_t {
4545
// Do not add any copy propagation passes.
4646
Off = 0,
4747

48-
// Only add the copy propagation passes requested by other flags, currently
49-
// just -enable-ossa-modules.
48+
// Only add the copy propagation passes requested by other flags.
5049
RequestedPassesOnly,
5150

5251
// Run copy propagation during optimized builds only.
5352
//
54-
// If a setting, e.g. -enable-ossa-modules, requests to add copy propagation
53+
// If a setting, requests to add copy propagation
5554
// to the performance pipeline, do so.
5655
Optimizing,
5756

@@ -189,11 +188,6 @@ class SILOptions {
189188
/// and go from OSSA to non-ownership SIL.
190189
bool StopOptimizationBeforeLoweringOwnership = false;
191190

192-
/// Do we always serialize SIL in OSSA form?
193-
///
194-
/// If this is disabled we do not serialize in OSSA form when optimizing.
195-
bool EnableOSSAModules = true;
196-
197191
/// Allow recompilation of a non-OSSA module to an OSSA module when imported
198192
/// from another OSSA module.
199193
bool EnableRecompilationToOSSAModule = false;

include/swift/Frontend/ModuleInterfaceLoader.h

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -478,49 +478,27 @@ class ModuleInterfaceLoaderOptions {
478478
ModuleInterfaceLoaderOptions() = default;
479479
};
480480

481-
/// Strongly typed enum that represents if we require all SILModules to have
482-
/// OSSA modules emitted. This is implemented by incorporating this bit into the
483-
/// module cache hash.
484-
struct RequireOSSAModules_t {
485-
enum ValueTy {
486-
No = 0,
487-
Yes = 1,
488-
};
489-
490-
ValueTy value;
491-
492-
RequireOSSAModules_t(const SILOptions &opts)
493-
: value(opts.EnableOSSAModules ? RequireOSSAModules_t::Yes
494-
: RequireOSSAModules_t::No) {}
495-
496-
operator ValueTy() const { return value; }
497-
explicit operator bool() const { return bool(value); }
498-
};
499-
500481
class ModuleInterfaceCheckerImpl: public ModuleInterfaceChecker {
501482
friend class ModuleInterfaceLoader;
502483
ASTContext &Ctx;
503484
std::string CacheDir;
504485
std::string PrebuiltCacheDir;
505486
std::string BackupInterfaceDir;
506487
ModuleInterfaceLoaderOptions Opts;
507-
RequireOSSAModules_t RequiresOSSAModules;
508488

509489
public:
510490
explicit ModuleInterfaceCheckerImpl(ASTContext &Ctx, StringRef cacheDir,
511491
StringRef prebuiltCacheDir,
512492
StringRef BackupInterfaceDir,
513-
ModuleInterfaceLoaderOptions opts,
514-
RequireOSSAModules_t requiresOSSAModules)
493+
ModuleInterfaceLoaderOptions opts)
515494
: Ctx(Ctx), CacheDir(cacheDir), PrebuiltCacheDir(prebuiltCacheDir),
516495
BackupInterfaceDir(BackupInterfaceDir),
517-
Opts(opts), RequiresOSSAModules(requiresOSSAModules) {}
496+
Opts(opts) {}
518497
explicit ModuleInterfaceCheckerImpl(ASTContext &Ctx, StringRef cacheDir,
519498
StringRef prebuiltCacheDir,
520-
ModuleInterfaceLoaderOptions opts,
521-
RequireOSSAModules_t requiresOSSAModules):
499+
ModuleInterfaceLoaderOptions opts):
522500
ModuleInterfaceCheckerImpl(Ctx, cacheDir, prebuiltCacheDir, StringRef(),
523-
opts, requiresOSSAModules) {}
501+
opts) {}
524502
std::vector<std::string>
525503
getCompiledModuleCandidatesForInterface(StringRef moduleName,
526504
StringRef interfacePath) override;
@@ -596,7 +574,6 @@ class ModuleInterfaceLoader : public SerializedModuleLoaderBase {
596574
ArrayRef<std::pair<std::string, std::string>> replayPrefixMap,
597575
bool SerializeDependencyHashes, bool TrackSystemDependencies,
598576
ModuleInterfaceLoaderOptions Opts,
599-
RequireOSSAModules_t RequireOSSAModules,
600577
bool silenceInterfaceDiagnostics);
601578

602579
/// Unconditionally build \p InPath (a swiftinterface file) to \p OutPath (as
@@ -666,8 +643,7 @@ struct InterfaceSubContextDelegateImpl : InterfaceSubContextDelegate {
666643
const LangOptions &LangOpts,
667644
const ClangImporterOptions &clangImporterOpts,
668645
const CASOptions &casOpts,
669-
bool suppressRemarks,
670-
RequireOSSAModules_t requireOSSAModules);
646+
bool suppressRemarks);
671647
bool extractSwiftInterfaceVersionAndArgs(CompilerInvocation &subInvocation,
672648
DiagnosticEngine &subInstanceDiags,
673649
SwiftInterfaceInfo &interfaceInfo,
@@ -684,7 +660,7 @@ struct InterfaceSubContextDelegateImpl : InterfaceSubContextDelegate {
684660
StringRef backupModuleInterfaceDir,
685661
ArrayRef<std::pair<std::string, std::string>> replayPrefixMap,
686662
bool serializeDependencyHashes,
687-
bool trackSystemDependencies, RequireOSSAModules_t requireOSSAModules);
663+
bool trackSystemDependencies);
688664

689665
template<typename ...ArgTypes>
690666
static InFlightDiagnostic diagnose(StringRef interfacePath,

include/swift/Option/FrontendOptions.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,8 +1320,7 @@ def disable_ast_verifier : Flag<["-"], "disable-ast-verifier">,
13201320

13211321
let Flags = [FrontendOption, NoDriverOption, HelpHidden, ModuleInterfaceOptionIgnorable] in {
13221322
def enable_ossa_modules : Flag<["-"], "enable-ossa-modules">,
1323-
HelpText<"Always serialize SIL in ossa form. If this flag is not passed in, "
1324-
"when optimizing ownership will be lowered before serializing SIL">;
1323+
HelpText<"Obsolete. This option is ignored">;
13251324
}
13261325

13271326
def enable_recompilation_to_ossa_module : Flag<["-"], "enable-recompilation-to-ossa-module">,

include/swift/SIL/SILModule.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,6 @@ class SILModule {
393393

394394
bool parsedAsSerializedSIL;
395395

396-
/// Set if we have registered a deserialization notification handler for
397-
/// lowering ownership in non transparent functions.
398-
/// This gets set in NonTransparent OwnershipModelEliminator pass.
399-
bool regDeserializationNotificationHandlerForNonTransparentFuncOME;
400396
/// Set if we have registered a deserialization notification handler for
401397
/// lowering ownership in transparent functions.
402398
/// This gets set in OwnershipModelEliminator pass.
@@ -449,15 +445,9 @@ class SILModule {
449445
deserializationNotificationHandlers.erase(handler);
450446
}
451447

452-
bool hasRegisteredDeserializationNotificationHandlerForNonTransparentFuncOME() {
453-
return regDeserializationNotificationHandlerForNonTransparentFuncOME;
454-
}
455448
bool hasRegisteredDeserializationNotificationHandlerForAllFuncOME() {
456449
return regDeserializationNotificationHandlerForAllFuncOME;
457450
}
458-
void setRegisteredDeserializationNotificationHandlerForNonTransparentFuncOME() {
459-
regDeserializationNotificationHandlerForNonTransparentFuncOME = true;
460-
}
461451
void setRegisteredDeserializationNotificationHandlerForAllFuncOME() {
462452
regDeserializationNotificationHandlerForAllFuncOME = true;
463453
}

include/swift/SILOptimizer/PassManager/Passes.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,6 @@ LEGACY_PASS(ModulePrinter, "module-printer",
377377
"Print the module")
378378
LEGACY_PASS(NestedSemanticFunctionCheck, "nested-semantic-function-check",
379379
"Diagnose improperly nested '@_semantics' functions")
380-
LEGACY_PASS(NonTransparentFunctionOwnershipModelEliminator,
381-
"non-transparent-func-ownership-model-eliminator",
382-
"Eliminate Ownership Annotations from non-transparent SIL Functions")
383380
LEGACY_PASS(RCIdentityDumper, "rc-id-dumper",
384381
"Print Reference Count Identities")
385382
LEGACY_PASS(AlwaysInlineInliner, "always-inline",

include/swift/Serialization/SerializationOptions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ class SerializationOptions {
162162
bool StaticLibrary = false;
163163
bool HermeticSealAtLink = false;
164164
bool EmbeddedSwiftModule = false;
165-
bool IsOSSA = false;
166165
bool SkipNonExportableDecls = false;
167166
bool ExplicitModuleBuild = false;
168167
bool EnableSerializationRemarks = false;

0 commit comments

Comments
 (0)