Skip to content

Commit 3d8ac14

Browse files
authored
Merge pull request #16074 from jketema/reuse-val-cat
C++: Add value category column to the expr_reuse relation
2 parents 9e47909 + 9eb51a9 commit 3d8ac14

File tree

12 files changed

+11396
-2259
lines changed

12 files changed

+11396
-2259
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Expr extends @expr {
2+
string toString() { none() }
3+
}
4+
5+
from Expr reuse, Expr original
6+
where expr_reuse(reuse, original, _)
7+
select reuse, original
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
class Expr extends @expr {
2+
string toString() { none() }
3+
}
4+
5+
class Type extends @type {
6+
string toString() { none() }
7+
}
8+
9+
predicate existingType(Expr expr, Type type, int value_category) {
10+
expr_types(expr, type, value_category)
11+
}
12+
13+
predicate reuseType(Expr reuse, Type type, int value_category) {
14+
exists(Expr original |
15+
expr_reuse(reuse, original, value_category) and
16+
expr_types(original, type, _)
17+
)
18+
}
19+
20+
from Expr expr, Type type, int value_category
21+
where existingType(expr, type, value_category) or reuseType(expr, type, value_category)
22+
select expr, type, value_category

0 commit comments

Comments
 (0)