Skip to content

Commit da7591d

Browse files
authored
Merge pull request #1519 from geoffw0/depkind
CPP: Deprecate Expr.getKind() and Stmt.getKind().
2 parents c29ef90 + 65bf778 commit da7591d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

cpp/ql/src/semmle/code/cpp/exprs/Expr.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ class Expr extends StmtParent, @expr {
7676

7777
/**
7878
* Gets an integer indicating the type of expression that this represents.
79-
*
80-
* Consider using subclasses of `Expr` rather than relying on this predicate.
79+
*
80+
* DEPRECATED: use the subclasses of `Expr` rather than relying on this predicate.
8181
*/
82-
int getKind() { exprs(underlyingElement(this),result,_) }
82+
deprecated int getKind() { exprs(underlyingElement(this),result,_) }
8383

8484
/** Gets a textual representation of this expression. */
8585
override string toString() { none() }

cpp/ql/src/semmle/code/cpp/stmts/Stmt.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ class Stmt extends StmtParent, @stmt {
5757

5858
override Location getLocation() { stmts(underlyingElement(this),_,result) }
5959

60-
/** Gets an int indicating the type of statement that this represents. */
61-
int getKind() { stmts(underlyingElement(this),result,_) }
60+
/**
61+
* Gets an int indicating the type of statement that this represents.
62+
*
63+
* DEPRECATED: use the subclasses of `Stmt` rather than relying on this predicate.
64+
*/
65+
deprecated int getKind() { stmts(underlyingElement(this),result,_) }
6266

6367
override string toString() { none() }
6468

0 commit comments

Comments
 (0)