Skip to content

Commit 2f124cf

Browse files
committed
Remove the -enable-ossa-modules option.
OSSA modules are enabled by default. The compiler still accepts this option but it has no effect.
1 parent 887bfb7 commit 2f124cf

File tree

51 files changed

+95
-275
lines changed

Some content is hidden

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

51 files changed

+95
-275
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ add_compile_options(
194194
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>"
195195
"$<$<COMPILE_LANGUAGE:Swift>:-no-link-objc-runtime>"
196196
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enforce-exclusivity=unchecked>"
197-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-ossa-modules>"
198197
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -empty-abi-descriptor>"
199198
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -target-min-inlining-version -Xfrontend min>"
200199
"$<$<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
@@ -81,7 +81,6 @@ add_compile_options(
8181
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature Macros>"
8282
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature ExtensionMacros>"
8383
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-lexical-lifetimes=false>"
84-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-ossa-modules>"
8584
"$<$<COMPILE_LANGUAGE:Swift>:-warn-implicit-overrides>"
8685
"$<$<AND:$<BOOL:${${PROJECT_NAME}_ENABLE_LIBRARY_EVOLUTION}>,$<COMPILE_LANGUAGE:Swift>>:-enable-library-evolution>"
8786
"$<$<AND:$<BOOL:${${PROJECT_NAME}_ENABLE_PRESPECIALIZATION}>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xfrontend -prespecialize-generic-metadata>")

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/Serialization/SerializedModuleLoader.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ class SerializedModuleLoaderBase : public ModuleLoader {
193193
static llvm::ErrorOr<std::vector<ScannerImportStatementInfo>>
194194
getMatchingPackageOnlyImportsOfModule(Twine modulePath,
195195
bool isFramework,
196-
bool isRequiredOSSAModules,
197196
StringRef SDKName,
198197
const llvm::Triple &target,
199198
StringRef packageName,
@@ -222,8 +221,6 @@ class SerializedModuleLoaderBase : public ModuleLoader {
222221
std::unique_ptr<llvm::MemoryBuffer> moduleSourceInfoInputBuffer,
223222
bool isFramework);
224223

225-
bool isRequiredOSSAModules() const;
226-
227224
/// Check whether the module with a given name can be imported without
228225
/// importing it.
229226
///

include/swift/Serialization/Validation.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,6 @@ struct SearchPath {
297297
///
298298
/// \param data A buffer containing the serialized AST. Result information
299299
/// refers directly into this buffer.
300-
/// \param requiresOSSAModules If true, necessitates the module to be
301-
/// compiled with -enable-ossa-modules.
302300
/// \param requiredSDK If not empty, only accept modules built with
303301
/// a compatible SDK. The StringRef represents the canonical SDK name.
304302
/// \param target The target triple of the current compilation for
@@ -309,7 +307,7 @@ struct SearchPath {
309307
/// \param[out] dependencies If present, will be populated with list of
310308
/// input files the module depends on, if present in INPUT_BLOCK.
311309
ValidationInfo validateSerializedAST(
312-
StringRef data, bool requiresOSSAModules,
310+
StringRef data,
313311
StringRef requiredSDK,
314312
ExtendedValidationInfo *extendedInfo = nullptr,
315313
SmallVectorImpl<SerializationOptions::FileDependency> *dependencies =

lib/ASTSectionImporter/ASTSectionImporter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ swift::parseASTSection(MemoryBufferSerializedModuleLoader &Loader,
5858
// headers. Iterate over all AST modules.
5959
while (!buf.empty()) {
6060
auto info = serialization::validateSerializedAST(
61-
buf, Loader.isRequiredOSSAModules(),
61+
buf,
6262
/*requiredSDK*/StringRef());
6363

6464
assert(info.name.size() < (2 << 10) && "name failed sanity check");

lib/DependencyScan/ModuleDependencyScanner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ ModuleDependencyScanningWorker::ModuleDependencyScanningWorker(
252252
workerCompilerInvocation->getFrontendOptions()
253253
.SerializeModuleInterfaceDependencyHashes,
254254
workerCompilerInvocation->getFrontendOptions()
255-
.shouldTrackSystemDependencies(),
256-
RequireOSSAModules_t(SILOptions));
255+
.shouldTrackSystemDependencies()
256+
);
257257

258258
auto loader = std::make_unique<PluginLoader>(
259259
*workerASTContext, /*DepTracker=*/nullptr,

0 commit comments

Comments
 (0)