@@ -209,6 +209,13 @@ abstract class SplitImpl extends Split {
209209 or
210210 exists ( ControlFlowElement pred | this .appliesTo ( pred ) | this .hasSuccessor ( pred , cfe , _) )
211211 }
212+
213+ /** The `succ` relation restricted to predecessors `pred` that this split applies to. */
214+ pragma [ noinline]
215+ final predicate appliesSucc ( ControlFlowElement pred , ControlFlowElement succ , Completion c ) {
216+ this .appliesTo ( pred ) and
217+ succ ( pred , succ , c )
218+ }
212219}
213220
214221module InitializerSplitting {
@@ -382,8 +389,7 @@ module InitializerSplitting {
382389 }
383390
384391 override predicate hasSuccessor ( ControlFlowElement pred , ControlFlowElement succ , Completion c ) {
385- this .appliesTo ( pred ) and
386- succ ( pred , succ , c ) and
392+ this .appliesSucc ( pred , succ , c ) and
387393 succ =
388394 any ( InitializedInstanceMember m |
389395 constructorInitializes ( this .getConstructor ( ) , m .getInitializer ( ) )
@@ -620,8 +626,7 @@ module AssertionSplitting {
620626 }
621627
622628 override predicate hasSuccessor ( ControlFlowElement pred , ControlFlowElement succ , Completion c ) {
623- this .appliesTo ( pred ) and
624- succ ( pred , succ , c ) and
629+ this .appliesSucc ( pred , succ , c ) and
625630 succ = getAnAssertionDescendant ( a )
626631 }
627632 }
@@ -858,8 +863,7 @@ module FinallySplitting {
858863 }
859864
860865 override predicate hasSuccessor ( ControlFlowElement pred , ControlFlowElement succ , Completion c ) {
861- this .appliesToPredecessor ( pred ) and
862- succ ( pred , succ , c ) and
866+ this .appliesSucc ( pred , succ , c ) and
863867 succ =
864868 any ( FinallyControlFlowElement fcfe |
865869 if fcfe .isEntryNode ( )
@@ -1037,7 +1041,7 @@ module ExceptionHandlerSplitting {
10371041
10381042 override predicate hasSuccessor ( ControlFlowElement pred , ControlFlowElement succ , Completion c ) {
10391043 this .appliesToPredecessor ( pred , c ) and
1040- succ ( pred , succ , c ) and
1044+ this . appliesSucc ( pred , succ , c ) and
10411045 not first ( any ( SpecificCatchClause scc ) .getBlock ( ) , succ ) and
10421046 not succ instanceof GeneralCatchClause and
10431047 not exists ( TryStmt ts , SpecificCatchClause scc , int last |
@@ -1298,7 +1302,7 @@ module BooleanSplitting {
12981302 override predicate hasSuccessor ( ControlFlowElement pred , ControlFlowElement succ , Completion c ) {
12991303 exists ( PreBasicBlock bb , Completion c0 | this .appliesToBlock ( bb , c0 ) |
13001304 pred = bb .getAnElement ( ) and
1301- succ ( pred , succ , c ) and
1305+ this . appliesSucc ( pred , succ , c ) and
13021306 (
13031307 pred = bb .getLastElement ( )
13041308 implies
@@ -1489,7 +1493,7 @@ module LoopSplitting {
14891493
14901494 override predicate hasSuccessor ( ControlFlowElement pred , ControlFlowElement succ , Completion c ) {
14911495 this .appliesToPredecessor ( pred , c ) and
1492- succ ( pred , succ , c ) and
1496+ this . appliesSucc ( pred , succ , c ) and
14931497 not loop .stop ( pred , succ , c )
14941498 }
14951499 }
0 commit comments