Rename Comparison to ComparisonExpr.

This commit is contained in:
Max Schaefer
2020-02-07 16:24:35 +00:00
parent ad7dfa258c
commit 5571f1eac7
4 changed files with 7 additions and 7 deletions

View File

@@ -51,10 +51,10 @@ class AssocNestedExpr extends BinaryExpr {
class HarmlessNestedExpr extends BinaryExpr {
HarmlessNestedExpr() {
exists(BinaryExpr parent | this = parent.getAChildExpr() |
parent instanceof Comparison and
parent instanceof ComparisonExpr and
(this instanceof ArithmeticExpr or this instanceof ShiftExpr)
or
parent instanceof LogicalExpr and this instanceof Comparison
parent instanceof LogicalExpr and this instanceof ComparisonExpr
)
}
}

View File

@@ -13,7 +13,7 @@
import go
from Comparison cmp, Expr l
from ComparisonExpr cmp, Expr l
where
l = cmp.getLeftOperand() and
l.getGlobalValueNumber() = cmp.getRightOperand().getGlobalValueNumber() and

View File

@@ -11,7 +11,7 @@
import go
from Comparison cmp, BuiltinFunction len, int ub, string r
from ComparisonExpr cmp, BuiltinFunction len, int ub, string r
where
(len = Builtin::len() or len = Builtin::cap()) and
(

View File

@@ -800,12 +800,12 @@ class ShiftExpr extends @shiftexpr, BitwiseBinaryExpr { }
/**
* A comparison expression, that is, `==`, `!=`, `<`, `<=`, `>=` or `>`.
*/
class Comparison extends @comparison, BinaryExpr { }
class ComparisonExpr extends @comparison, BinaryExpr { }
/**
* An equality test, that is, `==` or `!=`.
*/
class EqualityTestExpr extends @equalitytest, Comparison {
class EqualityTestExpr extends @equalitytest, ComparisonExpr {
/** Gets the polarity of this equality test, that is, `true` for `==` and `false` for `!=`. */
boolean getPolarity() { none() }
}
@@ -813,7 +813,7 @@ class EqualityTestExpr extends @equalitytest, Comparison {
/**
* A relational comparison, that is, `<`, `<=`, `>=` or `>`.
*/
class RelationalComparisonExpr extends @relationalcomparison, Comparison {
class RelationalComparisonExpr extends @relationalcomparison, ComparisonExpr {
/** Holds if this comparison is strict, that is, it implies inequality. */
predicate isStrict() { none() }