Skip to content

Commit cde80cc

Browse files
committed
Replace 'hasLocationInfo' with 'getLocation'.
1 parent 387c96d commit cde80cc

File tree

1 file changed

+4
-20
lines changed
  • cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal

1 file changed

+4
-20
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/Ssa.qll

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,8 @@ private class DefOrUse extends TDefOrUse {
4848
rnk = getRank(this, block)
4949
}
5050

51-
/**
52-
* Holds if this element is at the specified location.
53-
* The location spans column `startcolumn` of line `startline` to
54-
* column `endcolumn` of line `endline` in file `filepath`.
55-
* For more information, see
56-
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
57-
*/
58-
abstract predicate hasLocationInfo(
59-
string filepath, int startline, int startcolumn, int endline, int endcolumn
60-
);
51+
/** Gets the location of this element. */
52+
abstract Cpp::Location getLocation();
6153
}
6254

6355
private Instruction toInstruction(DefOrUse defOrUse) {
@@ -84,11 +76,7 @@ abstract class Def extends DefOrUse {
8476

8577
override IRBlock getBlock() { result = this.getInstruction().getBlock() }
8678

87-
override predicate hasLocationInfo(
88-
string filepath, int startline, int startcolumn, int endline, int endcolumn
89-
) {
90-
store.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
91-
}
79+
override Cpp::Location getLocation() { result = store.getLocation() }
9280
}
9381

9482
private class ExplicitDef extends Def, TExplicitDef {
@@ -134,11 +122,7 @@ abstract class Use extends DefOrUse {
134122

135123
override IRBlock getBlock() { result = use.getUse().getBlock() }
136124

137-
override predicate hasLocationInfo(
138-
string filepath, int startline, int startcolumn, int endline, int endcolumn
139-
) {
140-
use.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
141-
}
125+
override Cpp::Location getLocation() { result = use.getLocation() }
142126
}
143127

144128
private class ExplicitUse extends Use, TExplicitUse {

0 commit comments

Comments
 (0)