7
7
private import codeql.util.Unit
8
8
private import codeql.util.Option
9
9
private import codeql.util.Boolean
10
+ private import codeql.util.Location
10
11
private import codeql.dataflow.DataFlow
11
12
12
- module MakeImpl< InputSig Lang> {
13
+ module MakeImpl< LocationSig Location , InputSig< Location > Lang> {
13
14
private import Lang
14
- private import DataFlowMake< Lang >
15
- private import DataFlowImplCommon:: MakeImplCommon< Lang >
15
+ private import DataFlowMake< Location , Lang >
16
+ private import DataFlowImplCommon:: MakeImplCommon< Location , Lang >
16
17
private import DataFlowImplCommonPublic
17
18
18
19
/**
@@ -192,11 +193,7 @@ module MakeImpl<InputSig Lang> {
192
193
pragma [ only_bind_out ] ( this ) .getDataFlowType0 ( ) = pragma [ only_bind_into ] ( result )
193
194
}
194
195
195
- predicate hasLocationInfo (
196
- string filepath , int startline , int startcolumn , int endline , int endcolumn
197
- ) {
198
- this .projectToNode ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
199
- }
196
+ Location getLocation ( ) { result = this .projectToNode ( ) .getLocation ( ) }
200
197
}
201
198
202
199
private class ArgNodeEx extends NodeEx {
@@ -3305,11 +3302,7 @@ module MakeImpl<InputSig Lang> {
3305
3302
3306
3303
override string toString ( ) { result = p + concat ( " : " + ppReprType ( t ) ) + " " + ap }
3307
3304
3308
- predicate hasLocationInfo (
3309
- string filepath , int startline , int startcolumn , int endline , int endcolumn
3310
- ) {
3311
- p .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
3312
- }
3305
+ Location getLocation ( ) { result = p .getLocation ( ) }
3313
3306
}
3314
3307
3315
3308
/**
@@ -3727,18 +3720,8 @@ module MakeImpl<InputSig Lang> {
3727
3720
this .ppSummaryCtx ( )
3728
3721
}
3729
3722
3730
- /**
3731
- * Holds if this element is at the specified location.
3732
- * The location spans column `startcolumn` of line `startline` to
3733
- * column `endcolumn` of line `endline` in file `filepath`.
3734
- * For more information, see
3735
- * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
3736
- */
3737
- predicate hasLocationInfo (
3738
- string filepath , int startline , int startcolumn , int endline , int endcolumn
3739
- ) {
3740
- this .getNodeEx ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
3741
- }
3723
+ /** Gets the location of this node. */
3724
+ Location getLocation ( ) { result = this .getNodeEx ( ) .getLocation ( ) }
3742
3725
}
3743
3726
3744
3727
/** Holds if `n` can reach a sink. */
@@ -3774,17 +3757,21 @@ module MakeImpl<InputSig Lang> {
3774
3757
*/
3775
3758
final string toStringWithContext ( ) { result = super .toStringWithContext ( ) }
3776
3759
3760
+ /** Gets the location of this node. */
3761
+ Location getLocation ( ) { result = super .getLocation ( ) }
3762
+
3777
3763
/**
3778
3764
* Holds if this element is at the specified location.
3779
3765
* The location spans column `startcolumn` of line `startline` to
3780
3766
* column `endcolumn` of line `endline` in file `filepath`.
3781
3767
* For more information, see
3782
3768
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
3783
3769
*/
3784
- final predicate hasLocationInfo (
3770
+ pragma [ inline]
3771
+ deprecated final predicate hasLocationInfo (
3785
3772
string filepath , int startline , int startcolumn , int endline , int endcolumn
3786
3773
) {
3787
- super .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
3774
+ this . getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
3788
3775
}
3789
3776
3790
3777
/** Gets the underlying `Node`. */
@@ -3945,12 +3932,6 @@ module MakeImpl<InputSig Lang> {
3945
3932
override predicate isSource ( ) { none ( ) }
3946
3933
3947
3934
override string toString ( ) { result = sourceGroup }
3948
-
3949
- override predicate hasLocationInfo (
3950
- string filepath , int startline , int startcolumn , int endline , int endcolumn
3951
- ) {
3952
- filepath = "" and startline = 0 and startcolumn = 0 and endline = 0 and endcolumn = 0
3953
- }
3954
3935
}
3955
3936
3956
3937
private class PathNodeSinkGroup extends PathNodeImpl , TPathNodeSinkGroup {
@@ -3967,12 +3948,6 @@ module MakeImpl<InputSig Lang> {
3967
3948
override predicate isSource ( ) { none ( ) }
3968
3949
3969
3950
override string toString ( ) { result = sinkGroup }
3970
-
3971
- override predicate hasLocationInfo (
3972
- string filepath , int startline , int startcolumn , int endline , int endcolumn
3973
- ) {
3974
- filepath = "" and startline = 0 and startcolumn = 0 and endline = 0 and endcolumn = 0
3975
- }
3976
3951
}
3977
3952
3978
3953
private predicate pathNode (
@@ -4801,17 +4776,21 @@ module MakeImpl<InputSig Lang> {
4801
4776
result = this .getNodeEx ( ) .toString ( ) + this .ppType ( ) + this .ppAp ( ) + this .ppCtx ( )
4802
4777
}
4803
4778
4779
+ /** Gets the location of this node. */
4780
+ Location getLocation ( ) { result = this .getNodeEx ( ) .getLocation ( ) }
4781
+
4804
4782
/**
4805
4783
* Holds if this element is at the specified location.
4806
4784
* The location spans column `startcolumn` of line `startline` to
4807
4785
* column `endcolumn` of line `endline` in file `filepath`.
4808
4786
* For more information, see
4809
4787
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
4810
4788
*/
4811
- predicate hasLocationInfo (
4789
+ pragma [ inline]
4790
+ deprecated predicate hasLocationInfo (
4812
4791
string filepath , int startline , int startcolumn , int endline , int endcolumn
4813
4792
) {
4814
- this .getNodeEx ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
4793
+ this .getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
4815
4794
}
4816
4795
4817
4796
/** Gets the underlying `Node`. */
0 commit comments