Clean up code in basicLocalFlowStep

No changes in functionality.
This commit is contained in:
Owen Mansel-Chan
2023-11-28 13:25:45 +00:00
parent 4484d5bfa9
commit 5267671b15

View File

@@ -69,22 +69,22 @@ predicate basicLocalFlowStep(Node nodeFrom, Node nodeTo) {
exists(IR::Instruction pred, SsaExplicitDefinition succ |
succ.getRhs() = pred and
nodeFrom = instructionNode(pred) and
nodeTo = ssaNode(succ)
nodeTo = ssaNode(succ.getVariable())
)
or
// SSA defn -> SSA capture
exists(SsaExplicitDefinition pred, SsaVariableCapture succ |
// Check: should these flow from PHIs as well? Perhaps they should be included
// in the use-use graph?
succ.(SsaVariableCapture).getSourceVariable() = pred.(SsaExplicitDefinition).getSourceVariable()
succ.getSourceVariable() = pred.getSourceVariable()
|
nodeFrom = ssaNode(pred) and
nodeTo = ssaNode(succ)
nodeFrom = ssaNode(pred.getVariable()) and
nodeTo = ssaNode(succ.getVariable())
)
or
// SSA defn -> first SSA use
exists(SsaExplicitDefinition pred, IR::Instruction succ | succ = pred.getAFirstUse() |
nodeFrom = ssaNode(pred) and
nodeFrom = ssaNode(pred.getVariable()) and
nodeTo = instructionNode(succ)
)
or