77private import codeql.util.Unit
88private import codeql.util.Option
99private import codeql.util.Boolean
10+ private import codeql.util.Location
1011private import codeql.dataflow.DataFlow
1112
12- module MakeImpl< InputSig Lang> {
13+ module MakeImpl< LocationSig Location , InputSig< Location > Lang> {
1314 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 >
1617 private import DataFlowImplCommonPublic
1718
1819 /**
@@ -192,11 +193,7 @@ module MakeImpl<InputSig Lang> {
192193 pragma [ only_bind_out ] ( this ) .getDataFlowType0 ( ) = pragma [ only_bind_into ] ( result )
193194 }
194195
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 ( ) }
200197 }
201198
202199 private class ArgNodeEx extends NodeEx {
@@ -3305,11 +3302,7 @@ module MakeImpl<InputSig Lang> {
33053302
33063303 override string toString ( ) { result = p + concat ( " : " + ppReprType ( t ) ) + " " + ap }
33073304
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 ( ) }
33133306 }
33143307
33153308 /**
@@ -3727,18 +3720,8 @@ module MakeImpl<InputSig Lang> {
37273720 this .ppSummaryCtx ( )
37283721 }
37293722
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 ( ) }
37423725 }
37433726
37443727 /** Holds if `n` can reach a sink. */
@@ -3774,17 +3757,21 @@ module MakeImpl<InputSig Lang> {
37743757 */
37753758 final string toStringWithContext ( ) { result = super .toStringWithContext ( ) }
37763759
3760+ /** Gets the location of this node. */
3761+ Location getLocation ( ) { result = super .getLocation ( ) }
3762+
37773763 /**
37783764 * Holds if this element is at the specified location.
37793765 * The location spans column `startcolumn` of line `startline` to
37803766 * column `endcolumn` of line `endline` in file `filepath`.
37813767 * For more information, see
37823768 * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
37833769 */
3784- final predicate hasLocationInfo (
3770+ pragma [ inline]
3771+ deprecated final predicate hasLocationInfo (
37853772 string filepath , int startline , int startcolumn , int endline , int endcolumn
37863773 ) {
3787- super .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
3774+ this . getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
37883775 }
37893776
37903777 /** Gets the underlying `Node`. */
@@ -3945,12 +3932,6 @@ module MakeImpl<InputSig Lang> {
39453932 override predicate isSource ( ) { none ( ) }
39463933
39473934 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- }
39543935 }
39553936
39563937 private class PathNodeSinkGroup extends PathNodeImpl , TPathNodeSinkGroup {
@@ -3967,12 +3948,6 @@ module MakeImpl<InputSig Lang> {
39673948 override predicate isSource ( ) { none ( ) }
39683949
39693950 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- }
39763951 }
39773952
39783953 private predicate pathNode (
@@ -4801,17 +4776,21 @@ module MakeImpl<InputSig Lang> {
48014776 result = this .getNodeEx ( ) .toString ( ) + this .ppType ( ) + this .ppAp ( ) + this .ppCtx ( )
48024777 }
48034778
4779+ /** Gets the location of this node. */
4780+ Location getLocation ( ) { result = this .getNodeEx ( ) .getLocation ( ) }
4781+
48044782 /**
48054783 * Holds if this element is at the specified location.
48064784 * The location spans column `startcolumn` of line `startline` to
48074785 * column `endcolumn` of line `endline` in file `filepath`.
48084786 * For more information, see
48094787 * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
48104788 */
4811- predicate hasLocationInfo (
4789+ pragma [ inline]
4790+ deprecated predicate hasLocationInfo (
48124791 string filepath , int startline , int startcolumn , int endline , int endcolumn
48134792 ) {
4814- this .getNodeEx ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
4793+ this .getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
48154794 }
48164795
48174796 /** Gets the underlying `Node`. */
0 commit comments