Remove and replace @anonymousclassdeclstmt with @localtypedeclstmt

This commit is contained in:
Tamas Vajk
2021-12-07 15:24:44 +01:00
committed by Ian Lynagh
parent e325925f5a
commit fa5c3f9159
6 changed files with 17 additions and 40 deletions

View File

@@ -1137,11 +1137,6 @@ ktPropertyBackingFields(
int backingField: @field ref
)
ktAnonymousClassDeclarationStmts(
unique int id: @anonymousclassdeclstmt ref,
int classId: @class ref
)
ktSyntheticBody(
unique int id: @callable ref,
int kind: int ref

View File

@@ -987,10 +987,6 @@ private module ControlFlowGraphImpl {
completion = YieldCompletion(branchCompletion)
)
)
or
n instanceof KtAnonymousClassDeclarationStmt and
last = n and
completion = NormalCompletion()
}
/**

View File

@@ -911,16 +911,3 @@ class KtBreakStmt extends BreakStmt, KtBreakContinueStmt { }
/** A Kotlin `continue` statement. */
class KtContinueStmt extends ContinueStmt, KtBreakContinueStmt { }
class KtAnonymousClassDeclarationStmt extends Stmt, @anonymousclassdeclstmt {
Class c;
KtAnonymousClassDeclarationStmt() { ktAnonymousClassDeclarationStmts(this, c) }
/** Gets the class declaration belonging to this declaration statement. */
AnonymousClass getDeclaration() { result = c }
override string getAPrimaryQlClass() { result = "KtAnonymousClassDeclarationStmt" }
override string toString() { result = "{ ... }" }
}

View File

@@ -1,7 +1,7 @@
| classes.kt:66:20:66:54 | new Object(...) { ... } | classes.kt:66:20:66:54 | new (...) | | file://:0:0:0:0 | Object | classes.kt:66:20:66:54 | { ... } |
| classes.kt:68:20:68:74 | new Object(...) { ... } | classes.kt:68:20:68:74 | new (...) | | file://:0:0:0:0 | Object | classes.kt:68:20:68:74 | { ... } |
| classes.kt:72:16:77:10 | new Object(...) { ... } | classes.kt:72:16:77:10 | new (...) | | file://:0:0:0:0 | Object | classes.kt:72:16:77:10 | { ... } |
| classes.kt:75:24:75:33 | new Object(...) { ... } | classes.kt:75:24:75:33 | new (...) | | file://:0:0:0:0 | Object | classes.kt:75:24:75:33 | { ... } |
| classes.kt:81:16:81:38 | new Interface1(...) { ... } | classes.kt:81:16:81:38 | new (...) | | file://:0:0:0:0 | Interface1 | classes.kt:81:16:81:38 | { ... } |
| classes.kt:85:16:85:25 | new Object(...) { ... } | classes.kt:85:16:85:25 | new (...) | | file://:0:0:0:0 | Object | classes.kt:85:16:85:25 | { ... } |
| classes.kt:89:16:89:44 | new Interface3<Integer>(...) { ... } | classes.kt:89:16:89:44 | new (...) | | file://:0:0:0:0 | Interface3<Integer> | classes.kt:89:16:89:44 | { ... } |
| classes.kt:66:20:66:54 | new Object(...) { ... } | classes.kt:66:20:66:54 | new (...) | | file://:0:0:0:0 | Object | classes.kt:66:20:66:54 | class ... |
| classes.kt:68:20:68:74 | new Object(...) { ... } | classes.kt:68:20:68:74 | new (...) | | file://:0:0:0:0 | Object | classes.kt:68:20:68:74 | class ... |
| classes.kt:72:16:77:10 | new Object(...) { ... } | classes.kt:72:16:77:10 | new (...) | | file://:0:0:0:0 | Object | classes.kt:72:16:77:10 | class ... |
| classes.kt:75:24:75:33 | new Object(...) { ... } | classes.kt:75:24:75:33 | new (...) | | file://:0:0:0:0 | Object | classes.kt:75:24:75:33 | class ... |
| classes.kt:81:16:81:38 | new Interface1(...) { ... } | classes.kt:81:16:81:38 | new (...) | | file://:0:0:0:0 | Interface1 | classes.kt:81:16:81:38 | class ... |
| classes.kt:85:16:85:25 | new Object(...) { ... } | classes.kt:85:16:85:25 | new (...) | | file://:0:0:0:0 | Object | classes.kt:85:16:85:25 | class ... |
| classes.kt:89:16:89:44 | new Interface3<Integer>(...) { ... } | classes.kt:89:16:89:44 | new (...) | | file://:0:0:0:0 | Interface3<Integer> | classes.kt:89:16:89:44 | class ... |

View File

@@ -1,7 +1,7 @@
import java
from AnonymousClass c, KtAnonymousClassDeclarationStmt stmt
where c.fromSource() and stmt.getDeclaration() = c
from AnonymousClass c, LocalTypeDeclStmt stmt
where c.fromSource() and stmt.getLocalType() = c
select c, c.getClassInstanceExpr(),
c.getClassInstanceExpr().getConstructor().getDeclaringType().getName(),
c.getClassInstanceExpr().getTypeName(), stmt