@@ -25,30 +25,19 @@ Expr enumConstEquality(Expr e, boolean polarity, EnumConstant c) {
2525}
2626
2727/** Gets an instanceof expression of `v` with type `type` */
28- InstanceOfExpr instanceofExpr ( SsaVariable v , Expr type ) {
29- result .getTypeName ( ) = type and
28+ InstanceOfExpr instanceofExpr ( SsaVariable v , Type type ) {
29+ result .getTypeName ( ) . getType ( ) = type and
3030 result .getExpr ( ) = v .getAUse ( )
3131}
3232
3333/**
34- * Gets an expression of the form `v1` == ` v2` or `v1` != ` v2`.
34+ * Gets an expression of the form `v1 == v2` or `v1 != v2`.
3535 * The predicate is symmetric in `v1` and `v2`.
3636 */
37- BinaryExpr varComparisonExpr ( SsaVariable v1 , SsaVariable v2 , boolean isEqualExpr ) {
38- (
39- result .getLeftOperand ( ) = v1 .getAUse ( ) and
40- result .getRightOperand ( ) = v2 .getAUse ( )
41- or
42- result .getLeftOperand ( ) = v2 .getAUse ( ) and
43- result .getRightOperand ( ) = v1 .getAUse ( )
44- ) and
45- (
46- result instanceof EQExpr and
47- isEqualExpr = true
48- or
49- result instanceof NEExpr and
50- isEqualExpr = false
51- )
37+ EqualityTest varEqualityTestExpr ( SsaVariable v1 , SsaVariable v2 , boolean isEqualExpr ) {
38+ result .hasOperands ( v1 .getAUse ( ) , v2 .getAUse ( ) ) and
39+ result instanceof EqualityTest and
40+ isEqualExpr = result .polarity ( )
5241}
5342
5443/** Gets an expression that is provably not `null`. */
0 commit comments