@@ -8,7 +8,7 @@ import SsaImplCommon
88/**
99 * Holds if the `i`th node of basic block `bb` reads source variable `v`.
1010 */
11- predicate variableReadActual ( ControlFlow:: BasicBlock bb , int i , Ssa:: SourceVariable v ) {
11+ private predicate variableReadActual ( ControlFlow:: BasicBlock bb , int i , Ssa:: SourceVariable v ) {
1212 v .getAnAccess ( ) .( AssignableRead ) = bb .getNode ( i ) .getElement ( )
1313}
1414
@@ -1102,6 +1102,11 @@ private module Cached {
11021102 )
11031103 }
11041104
1105+ cached
1106+ predicate isLiveAtEndOfBlock ( Definition def , ControlFlow:: BasicBlock bb ) {
1107+ ssaDefReachesEndOfBlock ( bb , def , _)
1108+ }
1109+
11051110 private predicate adjacentDefReaches (
11061111 Definition def , ControlFlow:: BasicBlock bb1 , int i1 , ControlFlow:: BasicBlock bb2 , int i2
11071112 ) {
@@ -1122,6 +1127,16 @@ private module Cached {
11221127 variableReadActual ( bb2 , i2 , _)
11231128 }
11241129
1130+ cached
1131+ AssignableRead getAReadAtNode ( Definition def , ControlFlow:: Node cfn ) {
1132+ exists ( Ssa:: SourceVariable v , ControlFlow:: BasicBlock bb , int i |
1133+ ssaDefReachesRead ( v , def , bb , i ) and
1134+ variableReadActual ( bb , i , v ) and
1135+ cfn = bb .getNode ( i ) and
1136+ result .getAControlFlowNode ( ) = cfn
1137+ )
1138+ }
1139+
11251140 /**
11261141 * Holds if the value defined at SSA definition `def` can reach a read at `cfn`,
11271142 * without passing through any other read.
0 commit comments