Skip to content

Commit 6120e07

Browse files
tbkkapull[bot]
authored andcommitted
Enable SIL verification in a more-appropriate way
1 parent 5a394ba commit 6120e07

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,7 +2749,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
27492749
Opts.EnableLifetimeDependenceDiagnostics);
27502750

27512751
Opts.VerifyAll |= Args.hasArg(OPT_sil_verify_all);
2752-
Opts.VerifyAll |= CONDITIONAL_ASSERT_enabled();
27532752
Opts.VerifyNone |= Args.hasArg(OPT_sil_verify_none);
27542753
Opts.DebugSerialization |= Args.hasArg(OPT_sil_debug_serialization);
27552754
Opts.EmitVerboseSIL |= Args.hasArg(OPT_emit_verbose_sil);
@@ -2770,7 +2769,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
27702769
Opts.DisableSILPartialApply |=
27712770
Args.hasArg(OPT_disable_sil_partial_apply);
27722771
Opts.VerifySILOwnership &= !Args.hasArg(OPT_disable_sil_ownership_verifier);
2773-
Opts.VerifySILOwnership |= CONDITIONAL_ASSERT_enabled();
27742772
Opts.EnableDynamicReplacementCanCallPreviousImplementation = !Args.hasArg(
27752773
OPT_disable_previous_implementation_calls_in_dynamic_replacements);
27762774
Opts.ParseStdlib = FEOpts.ParseStdlib;

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7330,6 +7330,10 @@ static bool verificationEnabled(const SILModule &M) {
73307330
if (M.getOptions().VerifyAll)
73317331
return true;
73327332

7333+
// If we have asserts enabled, always verify...
7334+
if (CONDITIONAL_ASSERT_enabled())
7335+
return true;
7336+
73337337
#ifndef NDEBUG
73347338
// Otherwise if we do have asserts enabled, always verify...
73357339
return true;

0 commit comments

Comments
 (0)