Skip to content

Commit

Permalink
Enable SIL verification in a more-appropriate way
Browse files Browse the repository at this point in the history
  • Loading branch information
tbkka committed Oct 16, 2024
1 parent 4e91aca commit c93cd20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2749,7 +2749,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
Opts.EnableLifetimeDependenceDiagnostics);

Opts.VerifyAll |= Args.hasArg(OPT_sil_verify_all);
Opts.VerifyAll |= CONDITIONAL_ASSERT_enabled();
Opts.VerifyNone |= Args.hasArg(OPT_sil_verify_none);
Opts.DebugSerialization |= Args.hasArg(OPT_sil_debug_serialization);
Opts.EmitVerboseSIL |= Args.hasArg(OPT_emit_verbose_sil);
Expand All @@ -2770,7 +2769,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
Opts.DisableSILPartialApply |=
Args.hasArg(OPT_disable_sil_partial_apply);
Opts.VerifySILOwnership &= !Args.hasArg(OPT_disable_sil_ownership_verifier);
Opts.VerifySILOwnership |= CONDITIONAL_ASSERT_enabled();
Opts.EnableDynamicReplacementCanCallPreviousImplementation = !Args.hasArg(
OPT_disable_previous_implementation_calls_in_dynamic_replacements);
Opts.ParseStdlib = FEOpts.ParseStdlib;
Expand Down
4 changes: 4 additions & 0 deletions lib/SIL/Verifier/SILVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7330,6 +7330,10 @@ static bool verificationEnabled(const SILModule &M) {
if (M.getOptions().VerifyAll)
return true;

// If we have asserts enabled, always verify...
if (CONDITIONAL_ASSERT_enabled())
return true;

#ifndef NDEBUG
// Otherwise if we do have asserts enabled, always verify...
return true;
Expand Down

0 comments on commit c93cd20

Please sign in to comment.