Skip to content

Commit ac38d4c

Browse files
authored
Mass rename L/RValue -> VarWrite/Read
1 parent 59a49ee commit ac38d4c

36 files changed

+81
-81
lines changed

java/ql/lib/semmle/code/java/ControlFlowGraph.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ private module ControlFlowGraphImpl {
473473
or
474474
this instanceof ClassExpr
475475
or
476-
this instanceof RValue
476+
this instanceof VarRead
477477
or
478478
this instanceof Call // includes both expressions and statements
479479
or
@@ -554,7 +554,7 @@ private module ControlFlowGraphImpl {
554554
or
555555
index = 0 and result = this.(LocalVariableDeclExpr).getInit()
556556
or
557-
index = 0 and result = this.(RValue).getQualifier() and not result instanceof TypeAccess
557+
index = 0 and result = this.(VarRead).getQualifier() and not result instanceof TypeAccess
558558
or
559559
exists(Call e | e = this |
560560
index = -1 and result = e.getQualifier() and not result instanceof TypeAccess

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,10 +2273,10 @@ private module Qualifier {
22732273
}
22742274

22752275
/** An expression that assigns a value to a field. */
2276-
class FieldWrite extends FieldAccess, LValue { }
2276+
class FieldWrite extends FieldAccess, VarWrite { }
22772277

22782278
/** An expression that reads a field. */
2279-
class FieldRead extends FieldAccess, RValue { }
2279+
class FieldRead extends FieldAccess, VarRead { }
22802280

22812281
private predicate hasInstantiation(RefType t) {
22822282
t instanceof TypeVariable or

java/ql/lib/semmle/code/java/Member.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ class Callable extends StmtParent, Member, @callable {
161161
* Holds if field `f` may be assigned a value
162162
* within the body of this callable.
163163
*/
164-
predicate writes(Field f) { f.getAnAccess().(LValue).getEnclosingCallable() = this }
164+
predicate writes(Field f) { f.getAnAccess().(VarWrite).getEnclosingCallable() = this }
165165

166166
/**
167167
* Holds if field `f` may be read
168168
* within the body of this callable.
169169
*/
170-
predicate reads(Field f) { f.getAnAccess().(RValue).getEnclosingCallable() = this }
170+
predicate reads(Field f) { f.getAnAccess().(VarRead).getEnclosingCallable() = this }
171171

172172
/**
173173
* Holds if field `f` may be either read or written

java/ql/lib/semmle/code/java/Reflection.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private ReflectiveClassIdentifier pointsToReflectiveClassIdentifier(Expr expr) {
9595
or
9696
// Or if this is an access of a variable which was defined as an expression creating a `Class<T>`,
9797
// return the inferred `T` from the definition expression.
98-
exists(RValue use, VariableAssign assign |
98+
exists(VarRead use, VariableAssign assign |
9999
use = expr and
100100
defUsePair(assign, use) and
101101
// The source of the assignment must be a `ReflectiveClassIdentifier`.

java/ql/lib/semmle/code/java/dataflow/DefUse.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ private import SSA
1313
*
1414
* This is the transitive closure of `adjacentUseUseSameVar`.
1515
*/
16-
predicate useUsePairSameVar(RValue use1, RValue use2) { adjacentUseUseSameVar+(use1, use2) }
16+
predicate useUsePairSameVar(VarRead use1, VarRead use2) { adjacentUseUseSameVar+(use1, use2) }
1717

1818
/**
1919
* Holds if `use1` and `use2` form a use-use-pair of the same
@@ -23,15 +23,15 @@ predicate useUsePairSameVar(RValue use1, RValue use2) { adjacentUseUseSameVar+(u
2323
*
2424
* This is the transitive closure of `adjacentUseUse`.
2525
*/
26-
predicate useUsePair(RValue use1, RValue use2) { adjacentUseUse+(use1, use2) }
26+
predicate useUsePair(VarRead use1, VarRead use2) { adjacentUseUse+(use1, use2) }
2727

2828
/**
2929
* Holds if there exists a path from `def` to `use` without passing through another
3030
* `VariableUpdate` of the `LocalScopeVariable` that they both refer to.
3131
*
3232
* Other paths may also exist, so the SSA variables in `def` and `use` can be different.
3333
*/
34-
predicate defUsePair(VariableUpdate def, RValue use) {
34+
predicate defUsePair(VariableUpdate def, VarRead use) {
3535
exists(SsaVariable v |
3636
v.getAUse() = use and v.getAnUltimateDefinition().(SsaExplicitUpdate).getDefiningExpr() = def
3737
)
@@ -43,7 +43,7 @@ predicate defUsePair(VariableUpdate def, RValue use) {
4343
*
4444
* Other paths may also exist, so the SSA variables can be different.
4545
*/
46-
predicate parameterDefUsePair(Parameter p, RValue use) {
46+
predicate parameterDefUsePair(Parameter p, VarRead use) {
4747
exists(SsaVariable v |
4848
v.getAUse() = use and v.getAnUltimateDefinition().(SsaImplicitInit).isParameterDefinition(p)
4949
)

java/ql/lib/semmle/code/java/dataflow/InstanceAccess.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class InstanceAccessExt extends TInstanceAccessExt {
234234
e instanceof InstanceAccess and result = e
235235
or
236236
exists(FieldAccess fa | fa = e |
237-
if fa instanceof RValue then fa = result else result.(AssignExpr).getDest() = fa
237+
if fa instanceof VarRead then fa = result else result.(AssignExpr).getDest() = fa
238238
)
239239
)
240240
}

java/ql/lib/semmle/code/java/dataflow/IntegerGuards.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ private Expr exprWithIntValue(int i) {
1515

1616
/**
1717
* An expression for which the predicate `integerGuard` is relevant.
18-
* This includes `RValue` and `MethodCall`.
18+
* This includes `VarRead` and `MethodCall`.
1919
*/
2020
class IntComparableExpr extends Expr {
21-
IntComparableExpr() { this instanceof RValue or this instanceof MethodCall }
21+
IntComparableExpr() { this instanceof VarRead or this instanceof MethodCall }
2222

2323
/** Gets an integer that is directly assigned to the expression in case of a variable; or zero. */
2424
int relevantInt() {
@@ -132,7 +132,7 @@ Expr integerGuard(IntComparableExpr e, boolean branch, int k, boolean is_k) {
132132
* If `branch_with_lower_bound_k` is true then `result` is equivalent to `k <= x`
133133
* and if it is false then `result` is equivalent to `k > x`.
134134
*/
135-
Expr intBoundGuard(RValue x, boolean branch_with_lower_bound_k, int k) {
135+
Expr intBoundGuard(VarRead x, boolean branch_with_lower_bound_k, int k) {
136136
exists(ComparisonExpr comp, ConstantIntegerExpr c, int val |
137137
comp = result and
138138
comp.hasOperands(x, c) and

java/ql/lib/semmle/code/java/dataflow/NullGuards.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Expr clearlyNotNullExpr(Expr reason) {
7979
(reason = r1 or reason = r2)
8080
)
8181
or
82-
exists(SsaVariable v, boolean branch, RValue rval, Guard guard |
82+
exists(SsaVariable v, boolean branch, VarRead rval, Guard guard |
8383
guard = directNullGuard(v, branch, false) and
8484
guard.controls(rval.getBasicBlock(), branch) and
8585
reason = guard and

java/ql/lib/semmle/code/java/dataflow/Nullness.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ private predicate correlatedConditions(
485485
inverted = branch1.booleanXor(branch2)
486486
)
487487
or
488-
exists(SsaVariable v, RValue rv1, RValue rv2, int k, boolean branch1, boolean branch2 |
488+
exists(SsaVariable v, VarRead rv1, VarRead rv2, int k, boolean branch1, boolean branch2 |
489489
rv1 = v.getAUse() and
490490
rv2 = v.getAUse() and
491491
cond1.getCondition() = integerGuard(rv1, branch1, k, true) and

java/ql/lib/semmle/code/java/dataflow/SSA.qll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private module SsaImpl {
275275
}
276276

277277
/** Holds if `VarAccess` `use` of `v` occurs in `b` at index `i`. */
278-
private predicate variableUse(TrackedVar v, RValue use, BasicBlock b, int i) {
278+
private predicate variableUse(TrackedVar v, VarRead use, BasicBlock b, int i) {
279279
v.getAnAccess() = use and b.getNode(i) = use
280280
}
281281

@@ -652,7 +652,7 @@ private module SsaImpl {
652652
* Holds if the SSA definition of `v` at `def` reaches `use` in the same basic block
653653
* without crossing another SSA definition of `v`.
654654
*/
655-
private predicate ssaDefReachesUseWithinBlock(TrackedVar v, TrackedSsaDef def, RValue use) {
655+
private predicate ssaDefReachesUseWithinBlock(TrackedVar v, TrackedSsaDef def, VarRead use) {
656656
exists(BasicBlock b, int rankix, int i |
657657
ssaDefReachesRank(v, def, b, rankix) and
658658
defUseRank(v, b, rankix, i) and
@@ -665,7 +665,7 @@ private module SsaImpl {
665665
* SSA definition of `v`.
666666
*/
667667
cached
668-
predicate ssaDefReachesUse(TrackedVar v, TrackedSsaDef def, RValue use) {
668+
predicate ssaDefReachesUse(TrackedVar v, TrackedSsaDef def, VarRead use) {
669669
ssaDefReachesUseWithinBlock(v, def, use)
670670
or
671671
exists(BasicBlock b |
@@ -813,7 +813,7 @@ private module SsaImpl {
813813
* any other uses, but possibly through phi nodes and uncertain implicit updates.
814814
*/
815815
cached
816-
predicate firstUse(TrackedSsaDef def, RValue use) {
816+
predicate firstUse(TrackedSsaDef def, VarRead use) {
817817
exists(TrackedVar v, BasicBlock b1, int i1, BasicBlock b2, int i2 |
818818
adjacentVarRefs(v, b1, i1, b2, i2) and
819819
def.definesAt(v, b1, i1) and
@@ -838,7 +838,7 @@ private module SsaImpl {
838838
* through any other use or any SSA definition of the variable.
839839
*/
840840
cached
841-
predicate adjacentUseUseSameVar(RValue use1, RValue use2) {
841+
predicate adjacentUseUseSameVar(VarRead use1, VarRead use2) {
842842
exists(TrackedVar v, BasicBlock b1, int i1, BasicBlock b2, int i2 |
843843
adjacentVarRefs(v, b1, i1, b2, i2) and
844844
variableUse(v, use1, b1, i1) and
@@ -853,7 +853,7 @@ private module SsaImpl {
853853
* except for phi nodes and uncertain implicit updates.
854854
*/
855855
cached
856-
predicate adjacentUseUse(RValue use1, RValue use2) {
856+
predicate adjacentUseUse(VarRead use1, VarRead use2) {
857857
adjacentUseUseSameVar(use1, use2)
858858
or
859859
exists(TrackedVar v, TrackedSsaDef def, BasicBlock b1, int i1, BasicBlock b2, int i2 |
@@ -938,7 +938,7 @@ class SsaVariable extends TSsaVariable {
938938
BasicBlock getBasicBlock() { result = this.getCfgNode().getBasicBlock() }
939939

940940
/** Gets an access of this SSA variable. */
941-
RValue getAUse() {
941+
VarRead getAUse() {
942942
ssaDefReachesUse(_, this, result) or
943943
this = TSsaUntracked(_, result)
944944
}
@@ -952,7 +952,7 @@ class SsaVariable extends TSsaVariable {
952952
* Subsequent uses can be found by following the steps defined by
953953
* `adjacentUseUse`.
954954
*/
955-
RValue getAFirstUse() {
955+
VarRead getAFirstUse() {
956956
firstUse(this, result) or
957957
this = TSsaUntracked(_, result)
958958
}

0 commit comments

Comments
 (0)