Skip to content

Commit 6f02aa6

Browse files
authored
Merge pull request #73453 from eeckstein/fix-verifier
SILVerifier: be more tolerant if errors were detected in diagnostic passes
2 parents 3003155 + b636da1 commit 6f02aa6

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,6 +3002,9 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
30023002
}
30033003

30043004
void checkAssignOrInitInst(AssignOrInitInst *AI) {
3005+
if (F.getASTContext().hadError())
3006+
return;
3007+
30053008
SILValue Src = AI->getSrc();
30063009
require(AI->getModule().getStage() == SILStage::Raw,
30073010
"assign_or_init can only exist in raw SIL");
@@ -6620,6 +6623,9 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
66206623
/// the task, or exiting the function
66216624
/// - flow-sensitive states must be equivalent on all paths into a block
66226625
void verifyFlowSensitiveRules(SILFunction *F) {
6626+
if (F->getASTContext().hadError())
6627+
return;
6628+
66236629
// Do a traversal of the basic blocks.
66246630
// Note that we intentionally don't verify these properties in blocks
66256631
// that can't be reached from the entry block.

test/SILOptimizer/generalized_accessors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-sil -primary-file %s -o /dev/null -verify
1+
// RUN: %target-swift-frontend -sil-verify-all -emit-sil -primary-file %s -o /dev/null -verify
22
//
33
// Tests for yield-once diagnostics emitted for generalized accessors.
44

test/SILOptimizer/init_accessor_definite_init_diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -enable-copy-propagation=requested-passes-only -emit-sil -primary-file %s -o /dev/null -verify
1+
// RUN: %target-swift-frontend -sil-verify-all -enable-copy-propagation=requested-passes-only -emit-sil -primary-file %s -o /dev/null -verify
22

33
struct Test1 {
44
var x: Int // expected-note {{variable defined here}}

0 commit comments

Comments
 (0)