File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -2840,35 +2840,23 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
2840
2840
case SILInstructionKind::DestroyAddrInst:
2841
2841
return true ;
2842
2842
case SILInstructionKind::UncheckedAddrCastInst: {
2843
- // Don't be too conservative here, we have a new case:
2844
- // sil-combine producing a new code pattern for devirtualizer
2845
- // open_existential_addr immutable_access -> witness_method
2846
- // witness_method gets transformed into unchecked_addr_cast
2847
- // we are "OK" If one of the new users is an non-consuming apply
2848
- // we are also "OK" if we have a single non-consuming user
2849
2843
auto isCastToNonConsuming = [=](UncheckedAddrCastInst *I) -> bool {
2850
2844
for (auto *use : I->getUses ()) {
2851
2845
auto *inst = use->getUser ();
2852
2846
switch (inst->getKind ()) {
2853
2847
case SILInstructionKind::ApplyInst:
2854
2848
case SILInstructionKind::TryApplyInst:
2855
2849
case SILInstructionKind::PartialApplyInst:
2856
- if (!isConsumingOrMutatingApplyUse (use))
2857
- return true ;
2858
- break ;
2859
- case SILInstructionKind::StructElementAddrInst:
2860
- case SILInstructionKind::LoadInst:
2861
- case SILInstructionKind::DebugValueAddrInst:
2862
- if (I->hasOneUse ())
2863
- return true ;
2864
- break ;
2850
+ if (isConsumingOrMutatingApplyUse (use))
2851
+ return false ;
2852
+ continue ;
2865
2853
default :
2866
- break ;
2854
+ continue ;
2867
2855
}
2868
2856
}
2869
- return false ;
2857
+ return true ;
2870
2858
};
2871
- if (isCastToNonConsuming (dyn_cast <UncheckedAddrCastInst>(inst))) {
2859
+ if (isCastToNonConsuming (cast <UncheckedAddrCastInst>(inst))) {
2872
2860
break ;
2873
2861
}
2874
2862
return true ;
You can’t perform that action at this time.
0 commit comments