Commit Graph

1151 Commits

Author SHA1 Message Date
Tamas Vajk
21af31f3ab CFG changes for non-null operator + some tests 2022-05-10 19:51:08 +01:00
Tamás Vajk
04daa7f28f Revert "Kotlin: Fix extraction of dispatch and extension receivers" 2022-05-10 19:51:08 +01:00
Ian Lynagh
75e22da096 Kotlin: Fix extraction of dispatch and extension receivers
It is possible for a call to have both, e.g. the `arg.ext()` call in:

class Class1 {
    val y = 4
}
class Class2 (val arg:Class1) {
    val x = 3
    fun someFun() {
        arg.ext();
    }
    fun Class1.ext() {
        val z = x + y
    }
}
2022-05-10 19:51:07 +01:00
Ian Lynagh
712d70248a Kotlin: Add CFG for VarArgExpr 2022-05-10 19:51:07 +01:00
Ian Lynagh
8440bafc42 Kotlin: Add CFG for KtAnonymousClassDeclarationStmt 2022-05-10 19:51:07 +01:00
Ian Lynagh
5ae74949a0 Kotlin: Add CFG for ClassExpr 2022-05-10 19:51:07 +01:00
Ian Lynagh
2135a870d3 Kotlin: Fix CFG for StmtExpr 2022-05-10 19:51:06 +01:00
Ian Lynagh
2e5cf92f8a Kotlin: Fix CFG for string templates 2022-05-10 19:51:06 +01:00
Ian Lynagh
7baefbb9e5 Kotlin: Add WhenBranch.getWhenExpr() 2022-05-10 19:51:06 +01:00
Ian Lynagh
2b973fa3b1 Kotlin: Add support for IrSyntheticBody
I'm not sure it's worth adding an entity to the database for them,
although that would allow us to use a 'case' in the dbscheme for
the different kinds.

There's no QLL support for this info yet.
2022-05-10 19:51:06 +01:00
Tamas Vajk
716b87d200 Extract not-null expression 2022-05-10 19:51:06 +01:00
Tamas Vajk
afabe652c1 Add anonymous class declaration stmt 2022-05-10 19:51:05 +01:00
Ian Lynagh
e6e56238c5 Kotlin: Handle properties better 2022-05-10 19:51:03 +01:00
Chris Smowton
1b7e33b6e3 Remove Kotlin element and component type from arrays
Now that these are no longer required, array extraction can extract kt-types consistently with other parameterised classes.
2022-05-10 19:51:03 +01:00
Chris Smowton
805b54897e KotlinType: accept non-class-or-interface Java types 2022-05-10 19:51:02 +01:00
Chris Smowton
2cc5f3e5b7 kt_*_types tables: cite correct Kotlin classid for arrays 2022-05-10 19:51:01 +01:00
Ian Lynagh
5cf14e6f39 Kotlin: Tweak a comment 2022-05-10 19:51:01 +01:00
Ian Lynagh
8853489f04 Kotlin: Add a "generted by" field to the diagnostics table 2022-05-10 19:51:01 +01:00
Ian Lynagh
be75d30ee0 Kotlin: Add support for varargs 2022-05-10 19:51:01 +01:00
Ian Lynagh
bdaa3ce2b3 Kotlin: Add support for companion objects 2022-05-10 19:51:01 +01:00
Ian Lynagh
ceb1e57ddd Kotlin: Add support for objects 2022-05-10 19:51:01 +01:00
Ian Lynagh
87b433142c Kotlin: Add support for Kotlin type aliases 2022-05-10 19:51:01 +01:00
Ian Lynagh
e61ff60bf8 Kotlin: Add KotlinType to ExtensionMethod 2022-05-10 19:51:00 +01:00
Ian Lynagh
6cf0b755f0 Kotlin: Add KotlinType to localvars 2022-05-10 19:51:00 +01:00
Ian Lynagh
06a41b3923 Kotlin: Add KotlinTypes to arrays 2022-05-10 19:51:00 +01:00
Ian Lynagh
ba56517900 Kotlin: Add Variable.getKotlinType() 2022-05-10 19:51:00 +01:00
Ian Lynagh
ef22194eed Kotlin: Add KotlinType to params 2022-05-10 19:51:00 +01:00
Ian Lynagh
0d5e471b96 Kotlin: Give methods and constructors a KotlinType 2022-05-10 19:51:00 +01:00
Ian Lynagh
d9822266f5 Kotlin: Fix SafeCastConversionContext QLL 2022-05-10 19:51:00 +01:00
Ian Lynagh
c20ee76826 Kotlin: Give fields a Kotlin type
This meant refactoring the EnumEntry extraction a bit. The IR doesn't
give us a type for fields, so we have to make it up based on the parent.
2022-05-10 19:51:00 +01:00
Ian Lynagh
976cc31c7a Kotlin: Add support for string templates 2022-05-10 19:50:59 +01:00
Ian Lynagh
ba335b0c69 Kotlin: Add StmtExpr
In some contexts, Kotlin has what we would call a Stmt inside what we
would call an Expr. This allows us to handle this case.
2022-05-10 19:50:59 +01:00
Ian Lynagh
ba7a7535e9 Kotlin: Add support for more type operators 2022-05-10 19:50:58 +01:00
Ian Lynagh
d247e4fcff Kotlin: WhenBranch isn't postorder 2022-05-10 19:50:58 +01:00
Ian Lynagh
c4880cc935 Kotlin: Fix handling of non-true conditions 2022-05-10 19:50:58 +01:00
Ian Lynagh
7f3ae94d73 Tweak the WhenExpr CFG and QL class 2022-05-10 19:50:58 +01:00
Ian Lynagh
715a92c602 Kotlin: Add CFG for when expressions 2022-05-10 19:50:58 +01:00
Ian Lynagh
286e29cd81 Kotlin: Add exprstmt's where appropriate 2022-05-10 18:46:02 +01:00
Ian Lynagh
14a10564f3 Kotlin: Fix File locations, and fromSource/hasSourceLocation for Kotlin code 2022-05-10 18:46:01 +01:00
Ian Lynagh
cd41d5b9cf Kotlin: Add KotlinType to exprs 2022-05-10 18:46:01 +01:00
Ian Lynagh
1bce9a131a Kotlin: Towards KotlinType support 2022-05-10 18:46:01 +01:00
Tamas Vajk
1a6d693618 Implement review findings + fix ID of nested types 2022-05-10 18:46:00 +01:00
Tamas Vajk
8dff527a0e WIP: type arg extraction 2022-05-10 18:46:00 +01:00
Tamas Vajk
ab77ed085f Add QL classes and tests for comments 2022-05-10 18:45:59 +01:00
Ian Lynagh
93f6b23a91 Kotlin: Revert some now-unnecessary changes to dbscheme 2022-05-10 18:45:59 +01:00
Tamas Vajk
5aac46f20f Fix DB relation names to use plurals 2022-05-10 18:45:58 +01:00
Tamas Vajk
bf4fb13326 Revert extracting this and this@TYPE parameters 2022-05-10 18:45:58 +01:00
Tamas Vajk
3bfc93daab Add ExtensionMethod class 2022-05-10 18:45:58 +01:00
Tamas Vajk
32a61c16cb Add break/continue QL and tests 2022-05-10 18:45:58 +01:00
Tamas Vajk
aa190f9d65 Store break/continue targets 2022-05-10 18:45:58 +01:00