Skip to content

Commit 8144323

Browse files
authored
Merge pull request swiftlang#77036 from tbkka/tbkka-verifiers-are-assertions
Enable full SIL verification with `-compiler-assertions`
2 parents 9325512 + c93cd20 commit 8144323

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,6 +3656,8 @@ bool CompilerInvocation::parseArgs(
36563656
return true;
36573657
}
36583658

3659+
ParseAssertionArgs(ParsedArgs);
3660+
36593661
if (ParseFrontendArgs(FrontendOpts, ParsedArgs, Diags,
36603662
ConfigurationFileBuffers)) {
36613663
return true;
@@ -3672,8 +3674,6 @@ bool CompilerInvocation::parseArgs(
36723674
return true;
36733675
}
36743676

3675-
ParseAssertionArgs(ParsedArgs);
3676-
36773677
if (ParseLangArgs(LangOpts, ParsedArgs, Diags, FrontendOpts)) {
36783678
return true;
36793679
}

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)