Skip to content

Commit d10d5fd

Browse files
committed
C++: Rename in the name of consistency.
1 parent 99e1a07 commit d10d5fd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

cpp/ql/lib/semmle/code/cpp/controlflow/IRGuards.qll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ final class IRGuardCondition extends Guards_v1::Guard {
11281128
*/
11291129
pragma[inline]
11301130
predicate comparesLt(Operand op, int k, boolean isLessThan, GuardValue value) {
1131-
compares_lt(valueNumber(this), op, k, isLessThan, value)
1131+
unary_compares_lt(valueNumber(this), op, k, isLessThan, value)
11321132
}
11331133

11341134
/**
@@ -1150,7 +1150,7 @@ final class IRGuardCondition extends Guards_v1::Guard {
11501150
pragma[inline]
11511151
predicate ensuresLt(Operand op, int k, IRBlock block, boolean isLessThan) {
11521152
exists(GuardValue value |
1153-
compares_lt(valueNumber(this), op, k, isLessThan, value) and
1153+
unary_compares_lt(valueNumber(this), op, k, isLessThan, value) and
11541154
this.valueControls(block, value)
11551155
)
11561156
}
@@ -1176,7 +1176,7 @@ final class IRGuardCondition extends Guards_v1::Guard {
11761176
pragma[inline]
11771177
predicate ensuresLtEdge(Operand left, int k, IRBlock pred, IRBlock succ, boolean isLessThan) {
11781178
exists(GuardValue value |
1179-
compares_lt(valueNumber(this), left, k, isLessThan, value) and
1179+
unary_compares_lt(valueNumber(this), left, k, isLessThan, value) and
11801180
this.valueControlsBranchEdge(pred, succ, value)
11811181
)
11821182
}
@@ -1648,14 +1648,14 @@ private module Cached {
16481648

16491649
/** Holds if `op < k` evaluates to `isLt` given that `test` evaluates to `value`. */
16501650
cached
1651-
predicate compares_lt(ValueNumber test, Operand op, int k, boolean isLt, GuardValue value) {
1651+
predicate unary_compares_lt(ValueNumber test, Operand op, int k, boolean isLt, GuardValue value) {
16521652
unary_simple_comparison_lt(test, op, k, isLt, value)
16531653
or
16541654
complex_lt(test, op, k, isLt, value)
16551655
or
16561656
/* (x is true => (op < k)) => (!x is false => (op < k)) */
16571657
exists(GuardValue dual | value = dual.getDualValue() |
1658-
compares_lt(test.(LogicalNotValueNumber).getUnary(), op, k, isLt, dual)
1658+
unary_compares_lt(test.(LogicalNotValueNumber).getUnary(), op, k, isLt, dual)
16591659
)
16601660
or
16611661
exists(int k1, int k2, Instruction const |
@@ -1664,13 +1664,13 @@ private module Cached {
16641664
k = k1 + k2
16651665
)
16661666
or
1667-
compares_lt(test.(BuiltinExpectCallValueNumber).getCondition(), op, k, isLt, value)
1667+
unary_compares_lt(test.(BuiltinExpectCallValueNumber).getCondition(), op, k, isLt, value)
16681668
or
16691669
// See argument for why this is correct in compares_eq
16701670
exists(Operand l, GuardValue bv |
16711671
unary_compares_eq(test, l, 0, bv.asBooleanValue().booleanNot(), value) and
1672-
compares_lt(valueNumber(BooleanInstruction<isUnaryComparesEqLeft/1>::get(l.getDef())), op, k,
1673-
isLt, bv)
1672+
unary_compares_lt(valueNumber(BooleanInstruction<isUnaryComparesEqLeft/1>::get(l.getDef())),
1673+
op, k, isLt, bv)
16741674
)
16751675
}
16761676

@@ -1769,14 +1769,14 @@ private module Cached {
17691769

17701770
private predicate sub_lt(ValueNumber test, Operand left, int k, boolean isLt, GuardValue value) {
17711771
exists(SubInstruction lhs, int c, int x |
1772-
compares_lt(test, lhs.getAUse(), c, isLt, value) and
1772+
unary_compares_lt(test, lhs.getAUse(), c, isLt, value) and
17731773
left = lhs.getLeftOperand() and
17741774
x = int_value(lhs.getRight()) and
17751775
k = c + x
17761776
)
17771777
or
17781778
exists(PointerSubInstruction lhs, int c, int x |
1779-
compares_lt(test, lhs.getAUse(), c, isLt, value) and
1779+
unary_compares_lt(test, lhs.getAUse(), c, isLt, value) and
17801780
left = lhs.getLeftOperand() and
17811781
x = int_value(lhs.getRight()) and
17821782
k = c + x
@@ -1831,7 +1831,7 @@ private module Cached {
18311831

18321832
private predicate add_lt(ValueNumber test, Operand left, int k, boolean isLt, GuardValue value) {
18331833
exists(AddInstruction lhs, int c, int x |
1834-
compares_lt(test, lhs.getAUse(), c, isLt, value) and
1834+
unary_compares_lt(test, lhs.getAUse(), c, isLt, value) and
18351835
(
18361836
left = lhs.getLeftOperand() and x = int_value(lhs.getRight())
18371837
or
@@ -1841,7 +1841,7 @@ private module Cached {
18411841
)
18421842
or
18431843
exists(PointerAddInstruction lhs, int c, int x |
1844-
compares_lt(test, lhs.getAUse(), c, isLt, value) and
1844+
unary_compares_lt(test, lhs.getAUse(), c, isLt, value) and
18451845
(
18461846
left = lhs.getLeftOperand() and x = int_value(lhs.getRight())
18471847
or

0 commit comments

Comments
 (0)