Extract container of adapter function as compiler generated

This commit is contained in:
Tamas Vajk
2022-04-04 16:42:43 +02:00
committed by Ian Lynagh
parent 7f94495601
commit cdc7ed0e14
5 changed files with 17 additions and 1 deletions

View File

@@ -1222,3 +1222,9 @@ ktPropertyDelegates(
unique int id: @kt_property ref,
unique int variableId: @variable ref
)
compiler_generated(
unique int id: @top ref,
int kind: int ref
// 1: Kotlin declaring classes of adapter functions
);

View File

@@ -50,7 +50,9 @@ predicate dead(RefType dead) {
// Exclude classes that look like they may be reflectively constructed.
not dead.getAnAnnotation() instanceof ReflectiveAccessAnnotation and
// Insist all source ancestors are dead as well.
forall(RefType t | t.fromSource() and t = getASuperTypePlus(dead) | dead(t))
forall(RefType t | t.fromSource() and t = getASuperTypePlus(dead) | dead(t)) and
// Exclude compiler generated classes (e.g. declaring type of adapter functions in Kotlin)
not compiler_generated(dead, _)
}
from RefType t, string kind

View File

@@ -228,3 +228,5 @@ modifiers
| reflection.kt:116:40:116:44 | ...::... | reflection.kt:116:40:116:44 | invoke | override |
| reflection.kt:116:40:116:44 | ...::... | reflection.kt:116:40:116:44 | invoke | public |
| reflection.kt:126:9:126:13 | ...::... | reflection.kt:126:9:126:13 | invoke | public |
compGenerated
| reflection.kt:126:9:126:13 | | 1 |

View File

@@ -86,3 +86,5 @@ query predicate modifiers(ClassInstanceExpr e, Method m, string modifier) {
e.getAnonymousClass().getAMethod() = m and
m.hasModifier(modifier)
}
query predicate compGenerated(Top t, int i) { compiler_generated(t, i) }