Skip to content

Commit c49fca5

Browse files
authored
Merge pull request swiftlang#23382 from gottesmm/pr-70738274d737cc40c6973417c97dfc24b81133c7
[ownership] Rename enable-sil-ownership => verify-sil-ownership.
2 parents 9250e9f + 0dfaa19 commit c49fca5

File tree

119 files changed

+173
-212
lines changed

Some content is hidden

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

119 files changed

+173
-212
lines changed

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,6 @@ option(SWIFT_STDLIB_USE_NONATOMIC_RC
327327
"Build the standard libraries and overlays with nonatomic reference count operations enabled"
328328
FALSE)
329329

330-
option(SWIFT_STDLIB_ENABLE_SIL_OWNERSHIP
331-
"Build the standard libraries and overlays with sil ownership enabled."
332-
FALSE)
333-
334330
option(SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS
335331
"Enable runtime function counters and expose the API."
336332
FALSE)

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ function (swift_benchmark_compile_archopts)
314314

315315
set(common_options
316316
"-c"
317-
"-Xfrontend" "-enable-sil-ownership"
317+
"-Xfrontend" "-verify-sil-ownership"
318318
"-target" "${target}"
319319
"-${BENCH_COMPILE_ARCHOPTS_OPT}" ${PAGE_ALIGNMENT_OPTION})
320320

@@ -344,7 +344,7 @@ function (swift_benchmark_compile_archopts)
344344

345345
set(common_options_driver
346346
"-c"
347-
"-Xfrontend" "-enable-sil-ownership"
347+
"-Xfrontend" "-verify-sil-ownership"
348348
"-target" "${target}"
349349
"-${driver_opt}")
350350

cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function(_compile_swift_files
236236
endif()
237237

238238
if(SWIFTFILE_IS_STDLIB)
239-
list(APPEND swift_flags "-Xfrontend" "-enable-sil-ownership")
239+
list(APPEND swift_flags "-Xfrontend" "-verify-sil-ownership")
240240
list(APPEND swift_flags "-Xfrontend" "-enable-mandatory-semantic-arc-opts")
241241
endif()
242242

include/swift/AST/SILOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class SILOptions {
112112
std::string SILOutputFileNameForDebugging;
113113

114114
/// If set to true, compile with the SIL Ownership Model enabled.
115-
bool EnableSILOwnership = false;
115+
bool VerifySILOwnership = false;
116116

117117
/// Assume that code will be executed in a single-threaded environment.
118118
bool AssumeSingleThreaded = false;

include/swift/Option/FrontendOptions.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ def emit_pch : Flag<["-"], "emit-pch">,
299299
def pch_disable_validation : Flag<["-"], "pch-disable-validation">,
300300
HelpText<"Disable validating the persistent PCH">;
301301

302-
def enable_sil_ownership : Flag<["-"], "enable-sil-ownership">,
303-
HelpText<"Enable the SIL Ownership Model">;
302+
def verify_sil_ownership : Flag<["-"], "verify-sil-ownership">,
303+
HelpText<"Verify ownership invariants during SIL Verification ">;
304304

305305
def enable_mandatory_semantic_arc_opts : Flag<["-"], "enable-mandatory-semantic-arc-opts">,
306306
HelpText<"Enable the mandatory semantic arc optimizer">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
767767
Opts.EmitProfileCoverageMapping |= Args.hasArg(OPT_profile_coverage_mapping);
768768
Opts.DisableSILPartialApply |=
769769
Args.hasArg(OPT_disable_sil_partial_apply);
770-
Opts.EnableSILOwnership |= Args.hasArg(OPT_enable_sil_ownership);
770+
Opts.VerifySILOwnership |= Args.hasArg(OPT_verify_sil_ownership);
771771
Opts.EnableMandatorySemanticARCOpts |=
772772
Args.hasArg(OPT_enable_mandatory_semantic_arc_opts);
773773
Opts.EnableLargeLoadableTypes |= Args.hasArg(OPT_enable_large_loadable_types);

lib/SIL/SILOwnershipVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ void SILInstruction::verifyOperandOwnership() const {
630630
return;
631631

632632
// If SILOwnership is not enabled, do not perform verification.
633-
if (!getModule().getOptions().EnableSILOwnership)
633+
if (!getModule().getOptions().VerifySILOwnership)
634634
return;
635635

636636
// If the given function has unqualified ownership or we have been asked by

lib/SIL/SILVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
429429
void operator=(const SILVerifier&) = delete;
430430
public:
431431
bool isSILOwnershipEnabled() const {
432-
return F.getModule().getOptions().EnableSILOwnership;
432+
return F.getModule().getOptions().VerifySILOwnership;
433433
}
434434

435435
void _require(bool condition, const Twine &complaint,

lib/SIL/ValueOwnership.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ ValueOwnershipKindClassifier::visitForwardingInst(SILInstruction *i,
223223
// If we have mismatched SILOwnership and sil ownership is not enabled,
224224
// just return Any for staging purposes. If SILOwnership is enabled, then
225225
// we must assert!
226-
if (!i->getModule().getOptions().EnableSILOwnership) {
226+
if (!i->getModule().getOptions().VerifySILOwnership) {
227227
return ValueOwnershipKind::Any;
228228
}
229229
llvm_unreachable("Forwarding inst with mismatching ownership kinds?!");

lib/SILOptimizer/Mandatory/SemanticARCOpts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ struct SemanticARCOpts : SILFunctionTransform {
378378
SILFunction &f = *getFunction();
379379

380380
// Make sure we are running with ownership verification enabled.
381-
assert(f.getModule().getOptions().EnableSILOwnership &&
381+
assert(f.getModule().getOptions().VerifySILOwnership &&
382382
"Can not perform semantic arc optimization unless ownership "
383383
"verification is enabled");
384384

0 commit comments

Comments
 (0)