Java: Rename to selector as per review comment.

This commit is contained in:
Anders Schack-Mulligen
2019-06-05 09:16:12 +02:00
parent 0e12df0a15
commit 98c5dc194b
2 changed files with 6 additions and 6 deletions

View File

@@ -427,7 +427,7 @@ class SwitchCase extends Stmt, @case {
* Gets the expression of the surrounding switch that this case is compared
* against.
*/
Expr getTestExpr() {
Expr getSelectorExpr() {
result = this.getSwitch().getExpr() or result = this.getSwitchExpr().getExpr()
}

View File

@@ -127,7 +127,7 @@ class Guard extends ExprParent {
branch = true and
bb2.getFirstNode() = sc.getControlFlowNode() and
pred = sc.getControlFlowNode().getAPredecessor() and
pred.(Expr).getParent*() = sc.getTestExpr() and
pred.(Expr).getParent*() = sc.getSelectorExpr() and
bb1 = pred.getBasicBlock()
)
or
@@ -161,12 +161,12 @@ class Guard extends ExprParent {
}
private predicate switchCaseControls(SwitchCase sc, BasicBlock bb) {
exists(BasicBlock caseblock, Expr switchTest |
switchTest = sc.getTestExpr() and
exists(BasicBlock caseblock, Expr selector |
selector = sc.getSelectorExpr() and
caseblock.getFirstNode() = sc.getControlFlowNode() and
caseblock.bbDominates(bb) and
forall(ControlFlowNode pred | pred = sc.getControlFlowNode().getAPredecessor() |
pred.(Expr).getParent*() = switchTest
pred.(Expr).getParent*() = selector
)
)
}
@@ -255,7 +255,7 @@ private predicate equalityGuard(Guard g, Expr e1, Expr e2, boolean polarity) {
exists(ConstCase cc |
cc = g and
polarity = true and
cc.getTestExpr().getProperExpr() = e1 and
cc.getSelectorExpr().getProperExpr() = e1 and
cc.getValue() = e2 and
strictcount(cc.getValue(_)) = 1
)