@@ -25,16 +25,8 @@ abstract class Bound extends TBound {
25
25
/** Gets an expression that equals this bound. */
26
26
Expr getExpr ( ) { result = this .getExpr ( 0 ) }
27
27
28
- /**
29
- * Holds if this element is at the specified location.
30
- * The location spans column `sc` of line `sl` to
31
- * column `ec` of line `el` in file `path`.
32
- * For more information, see
33
- * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
34
- */
35
- predicate hasLocationInfo ( string path , int sl , int sc , int el , int ec ) {
36
- path = "" and sl = 0 and sc = 0 and el = 0 and ec = 0
37
- }
28
+ /** Gets the location of this bound. */
29
+ abstract Location getLocation ( ) ;
38
30
}
39
31
40
32
/**
@@ -45,6 +37,8 @@ class ZeroBound extends Bound, TBoundZero {
45
37
override string toString ( ) { result = "0" }
46
38
47
39
override Expr getExpr ( int delta ) { result .( ConstantIntegerExpr ) .getIntValue ( ) = delta }
40
+
41
+ override Location getLocation ( ) { result .hasLocationInfo ( "" , 0 , 0 , 0 , 0 ) }
48
42
}
49
43
50
44
/**
@@ -58,9 +52,7 @@ class SsaBound extends Bound, TBoundSsa {
58
52
59
53
override Expr getExpr ( int delta ) { result = this .getSsa ( ) .getAUse ( ) and delta = 0 }
60
54
61
- override predicate hasLocationInfo ( string path , int sl , int sc , int el , int ec ) {
62
- this .getSsa ( ) .getLocation ( ) .hasLocationInfo ( path , sl , sc , el , ec )
63
- }
55
+ override Location getLocation ( ) { result = this .getSsa ( ) .getLocation ( ) }
64
56
}
65
57
66
58
/**
@@ -72,7 +64,5 @@ class ExprBound extends Bound, TBoundExpr {
72
64
73
65
override Expr getExpr ( int delta ) { this = TBoundExpr ( result ) and delta = 0 }
74
66
75
- override predicate hasLocationInfo ( string path , int sl , int sc , int el , int ec ) {
76
- this .getExpr ( ) .getLocation ( ) .hasLocationInfo ( path , sl , sc , el , ec )
77
- }
67
+ override Location getLocation ( ) { result = this .getExpr ( ) .getLocation ( ) }
78
68
}
0 commit comments