File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
ql/ql/src/codeql_ql/style Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ private AstNode queryPredicate() {
39
39
result = queryPredicate ( ) .getAChild ( )
40
40
}
41
41
42
+ private AstNode discardPredicate ( ) {
43
+ result .( Predicate ) .getAnAnnotation ( ) instanceof OverlayDiscardEntity
44
+ }
45
+
42
46
AstNode hackyShouldBeTreatedAsAlive ( ) {
43
47
// Stages from the shared DataFlow impl are copy-pasted, so predicates that are dead in one stage are not dead in another.
44
48
result = any ( Module mod | mod .getName ( ) .matches ( "Stage%" ) ) .getAMember ( ) .( ClasslessPredicate ) and
@@ -58,7 +62,7 @@ AstNode hackyShouldBeTreatedAsAlive() {
58
62
*/
59
63
private AstNode alive ( ) {
60
64
//
61
- // The 4 base cases.
65
+ // The 5 base cases.
62
66
//
63
67
// 1) everything that can be imported.
64
68
result = publicApi ( )
@@ -73,6 +77,9 @@ private AstNode alive() {
73
77
// 4) Things that aren't really alive, but that this query treats as live.
74
78
result = hackyShouldBeTreatedAsAlive ( )
75
79
or
80
+ // 5) discard predicates
81
+ result = discardPredicate ( )
82
+ or
76
83
result instanceof TopLevel // toplevel is always alive.
77
84
or
78
85
// recursive cases
You can’t perform that action at this time.
0 commit comments