Skip to content

Commit b76e5f5

Browse files
committed
SSA: Deprecate unused predicate.
1 parent 7e59603 commit b76e5f5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
779779
pragma[noinline]
780780
predicate ssaDefReachesThroughBlock(DefinitionExt def, BasicBlock bb) {
781781
exists(SourceVariable v |
782-
ssaDefReachesEndOfBlockExt(bb, def, v) and
782+
ssaDefReachesEndOfBlockExt0(bb, def, v) and
783783
not defOccursInBlock(_, bb, v, _)
784784
)
785785
}
@@ -863,7 +863,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
863863
predicate varBlockReachesExitExt(DefinitionExt def, BasicBlock bb) {
864864
exists(BasicBlock bb2 | varBlockReachesExt(def, _, bb, bb2) |
865865
not defOccursInBlock(def, bb2, _, _) and
866-
not ssaDefReachesEndOfBlockExt(bb2, def, _)
866+
not ssaDefReachesEndOfBlockExt0(bb2, def, _)
867867
)
868868
}
869869

@@ -872,7 +872,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
872872
exists(BasicBlock bb2, SourceVariable v |
873873
varBlockReachesExt(def, v, bb, bb2) and
874874
not defOccursInBlock(def, bb2, _, _) and
875-
not ssaDefReachesEndOfBlockExt(bb2, def, _) and
875+
not ssaDefReachesEndOfBlockExt0(bb2, def, _) and
876876
not any(PhiReadNode phi).definesAt(v, bb2, _, _)
877877
)
878878
or
@@ -907,7 +907,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
907907
* SSA definition of `v`.
908908
*/
909909
pragma[nomagic]
910-
predicate ssaDefReachesEndOfBlockExt(BasicBlock bb, DefinitionExt def, SourceVariable v) {
910+
private predicate ssaDefReachesEndOfBlockExt0(BasicBlock bb, DefinitionExt def, SourceVariable v) {
911911
exists(int last |
912912
last = maxSsaRefRank(pragma[only_bind_into](bb), pragma[only_bind_into](v)) and
913913
ssaDefReachesRank(bb, def, last, v) and
@@ -920,10 +920,12 @@ module Make<LocationSig Location, InputSig<Location> Input> {
920920
// the node. If two definitions dominate a node then one must dominate the
921921
// other, so therefore the definition of _closest_ is given by the dominator
922922
// tree. Thus, reaching definitions can be calculated in terms of dominance.
923-
ssaDefReachesEndOfBlockExt(getImmediateBasicBlockDominator(bb), def, pragma[only_bind_into](v)) and
923+
ssaDefReachesEndOfBlockExt0(getImmediateBasicBlockDominator(bb), def, pragma[only_bind_into](v)) and
924924
liveThroughExt(bb, pragma[only_bind_into](v))
925925
}
926926

927+
deprecated predicate ssaDefReachesEndOfBlockExt = ssaDefReachesEndOfBlockExt0/3;
928+
927929
/**
928930
* NB: If this predicate is exposed, it should be cached.
929931
*
@@ -955,7 +957,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
955957
exists(SourceVariable v, BasicBlock bbDef |
956958
phi.definesAt(v, bbDef, _, _) and
957959
getABasicBlockPredecessor(bbDef) = bb and
958-
ssaDefReachesEndOfBlockExt(bb, inp, v)
960+
ssaDefReachesEndOfBlockExt0(bb, inp, v)
959961
|
960962
phi instanceof PhiNode or
961963
phi instanceof PhiReadNode
@@ -973,7 +975,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
973975
ssaDefReachesReadWithinBlock(v, def, bb, i)
974976
or
975977
ssaRef(bb, i, v, SsaActualRead()) and
976-
ssaDefReachesEndOfBlockExt(getABasicBlockPredecessor(bb), def, v) and
978+
ssaDefReachesEndOfBlockExt0(getABasicBlockPredecessor(bb), def, v) and
977979
not ssaDefReachesReadWithinBlock(v, _, bb, i)
978980
}
979981

0 commit comments

Comments
 (0)