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() {
3939 result = queryPredicate ( ) .getAChild ( )
4040}
4141
42+ private AstNode discardPredicate ( ) {
43+ result .( Predicate ) .getAnAnnotation ( ) instanceof OverlayDiscardEntity
44+ }
45+
4246AstNode hackyShouldBeTreatedAsAlive ( ) {
4347 // Stages from the shared DataFlow impl are copy-pasted, so predicates that are dead in one stage are not dead in another.
4448 result = any ( Module mod | mod .getName ( ) .matches ( "Stage%" ) ) .getAMember ( ) .( ClasslessPredicate ) and
@@ -58,7 +62,7 @@ AstNode hackyShouldBeTreatedAsAlive() {
5862 */
5963private AstNode alive ( ) {
6064 //
61- // The 4 base cases.
65+ // The 5 base cases.
6266 //
6367 // 1) everything that can be imported.
6468 result = publicApi ( )
@@ -73,6 +77,9 @@ private AstNode alive() {
7377 // 4) Things that aren't really alive, but that this query treats as live.
7478 result = hackyShouldBeTreatedAsAlive ( )
7579 or
80+ // 5) discard predicates
81+ result = discardPredicate ( )
82+ or
7683 result instanceof TopLevel // toplevel is always alive.
7784 or
7885 // recursive cases
You can’t perform that action at this time.
0 commit comments