Skip to content

Commit 42eef9e

Browse files
committed
SSA: Deprecate getDefinitionExt.
1 parent 0d1865d commit 42eef9e

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
16441644
/** A synthesized SSA data flow node. */
16451645
abstract private class SsaNodeImpl extends NodeImpl {
16461646
/** Gets the underlying SSA definition. */
1647-
abstract DefinitionExt getDefinitionExt();
1647+
abstract deprecated DefinitionExt getDefinitionExt();
16481648

16491649
/** Gets the SSA definition this node corresponds to, if any. */
16501650
Definition asDefinition() { this = TSsaDefinitionNode(result) }
@@ -1664,7 +1664,9 @@ module Make<LocationSig Location, InputSig<Location> Input> {
16641664

16651665
SsaDefinitionExtNodeImpl() { this = TSsaDefinitionNode(def) }
16661666

1667-
override DefinitionExt getDefinitionExt() { result = def }
1667+
DefinitionExt getDefExt() { result = def }
1668+
1669+
deprecated override DefinitionExt getDefinitionExt() { result = def }
16681670

16691671
override BasicBlock getBasicBlock() { result = def.getBasicBlock() }
16701672

@@ -1692,7 +1694,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
16921694
/** A node that represents a synthetic read of a source variable. */
16931695
final class SsaSynthReadNode extends SsaNode {
16941696
SsaSynthReadNode() {
1695-
this.(SsaDefinitionExtNodeImpl).getDefinitionExt() instanceof PhiReadNode or
1697+
this.(SsaDefinitionExtNodeImpl).getDefExt() instanceof PhiReadNode or
16961698
this instanceof SsaInputNodeImpl
16971699
}
16981700
}
@@ -1744,7 +1746,9 @@ module Make<LocationSig Location, InputSig<Location> Input> {
17441746
input = input_
17451747
}
17461748

1747-
override SsaInputDefinitionExt getDefinitionExt() { result = def_ }
1749+
SsaInputDefinitionExt getPhi() { result = def_ }
1750+
1751+
deprecated override SsaInputDefinitionExt getDefinitionExt() { result = def_ }
17481752

17491753
override BasicBlock getBasicBlock() { result = input_ }
17501754

@@ -1767,7 +1771,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
17671771
private predicate flowOutOf(
17681772
DefinitionExt def, Node nodeFrom, SourceVariable v, BasicBlock bb, int i, boolean isUseStep
17691773
) {
1770-
nodeFrom.(SsaDefinitionExtNodeImpl).getDefinitionExt() = def and
1774+
nodeFrom.(SsaDefinitionExtNodeImpl).getDefExt() = def and
17711775
def.definesAt(v, bb, i, _) and
17721776
isUseStep = false
17731777
or
@@ -1790,7 +1794,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
17901794
// Flow from parameter into entry definition
17911795
DfInput::ssaDefInitializesParam(def, nodeFrom.(ParameterNode).getParameter())
17921796
) and
1793-
nodeTo.(SsaDefinitionExtNodeImpl).getDefinitionExt() = def and
1797+
nodeTo.(SsaDefinitionExtNodeImpl).getDefExt() = def and
17941798
isUseStep = false
17951799
or
17961800
// Flow from definition/read to next read
@@ -1806,7 +1810,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
18061810
AdjacentSsaRefs::adjacentRefRead(bb1, i1, bb2, i2, v) and
18071811
exists(UncertainWriteDefinition def2 |
18081812
DfInput::allowFlowIntoUncertainDef(def2) and
1809-
nodeTo.(SsaDefinitionExtNodeImpl).getDefinitionExt() = def2 and
1813+
nodeTo.(SsaDefinitionExtNodeImpl).getDefExt() = def2 and
18101814
def2.definesAt(v, bb2, i2)
18111815
)
18121816
)
@@ -1823,8 +1827,8 @@ module Make<LocationSig Location, InputSig<Location> Input> {
18231827
)
18241828
or
18251829
// Flow from input node to def
1826-
nodeTo.(SsaDefinitionExtNodeImpl).getDefinitionExt() = def and
1827-
def = nodeFrom.(SsaInputNodeImpl).getDefinitionExt() and
1830+
nodeTo.(SsaDefinitionExtNodeImpl).getDefExt() = def and
1831+
def = nodeFrom.(SsaInputNodeImpl).getPhi() and
18281832
isUseStep = false
18291833
}
18301834

@@ -1837,10 +1841,10 @@ module Make<LocationSig Location, InputSig<Location> Input> {
18371841
// Flow from parameter into entry definition
18381842
DfInput::ssaDefInitializesParam(def, nodeFrom.(ParameterNode).getParameter())
18391843
) and
1840-
nodeTo.(SsaDefinitionExtNodeImpl).getDefinitionExt() = def
1844+
nodeTo.(SsaDefinitionExtNodeImpl).getDefExt() = def
18411845
or
18421846
// Flow from SSA definition to read
1843-
nodeFrom.(SsaDefinitionExtNodeImpl).getDefinitionExt() = def and
1847+
nodeFrom.(SsaDefinitionExtNodeImpl).getDefExt() = def and
18441848
nodeTo.(ExprNode).getExpr() = DfInput::getARead(def)
18451849
}
18461850

0 commit comments

Comments
 (0)