Commit Graph

27907 Commits

Author SHA1 Message Date
Anton Bannykh 0d1c6e08c3 Refactor LateinitLowering into DeclarationTransformer's and a BodyLoweringPass 2020-02-06 21:03:35 +03:00
Anton Bannykh 6e96e271ae Make InitializersLowering a BodyLoweringPass and add a InitializersCleanupLowering 2020-02-06 21:03:35 +03:00
Anton Bannykh 600caaa636 Make ExpectDeclarationsRemoveLowering a DeclarationTransformer 2020-02-06 21:03:35 +03:00
Anton Bannykh d0284d19ec Make PropertiesLowering a DeclarationTransformer 2020-02-06 21:03:35 +03:00
Anton Bannykh 03398e6025 Make StripTypeAliasDeclarationsLowering a DeclarationTransformer 2020-02-06 21:03:35 +03:00
Anton Bannykh 3d726fe5a2 Make InlineClassDeclarationLowering a DeclarationTransformer 2020-02-06 21:03:34 +03:00
Anton Bannykh 0a5db9d222 Make inlineClassUsageLowering a BodyLoweringPass 2020-02-06 21:03:34 +03:00
Anton Bannykh fe236507a0 Make LocalDeclarationsLowering a BodyLoweringPass 2020-02-06 21:03:34 +03:00
Anton Bannykh 1eec2acf43 Make LocalClassPopupLowering a BodyLoweringPass 2020-02-06 21:03:34 +03:00
Anton Bannykh d228de9008 Make ArrayConstructorLowering a BodyLoweringPass 2020-02-06 21:03:34 +03:00
Anton Bannykh bf26b86cf2 Make ProvisionalFunctionExpressionLowering a BodyLoweringPass 2020-02-06 21:03:34 +03:00
Anton Bannykh 5aa2deb449 Make ReturnableBlockLowering a BodyLoweringPass 2020-02-06 21:03:33 +03:00
Anton Bannykh 2fa04afbf2 Make SharedVariablesLowering a BodyLoweringPass 2020-02-06 21:03:33 +03:00
Anton Bannykh 936e53d044 Make TailrecLowering a BodyLoweringPass 2020-02-06 21:03:33 +03:00
Anton Bannykh a42f849981 Change BodyLoweringPass API; add DeclarationTransformer + helper methods 2020-02-06 21:03:33 +03:00
Anton Bannykh b087d2d756 IR impl: additional constructors for IrBody implementations 2020-02-06 21:03:33 +03:00
Anton Bannykh 20dc3ccdb8 New mechanism for mappings between old and produced declarations 2020-02-06 21:03:33 +03:00
Anton Bannykh e8fba8bcb6 IR API: change val ... : MutableList to var ...: List for most lists
All mutable state for IR declarations should be either:
- var (mutable properties)
- or class member list

Mutable properties are straightforward to persist.

The class member list is handled in a special way.
2020-02-06 21:03:32 +03:00
Anton Bannykh 0bcde9dffc IR API: Make IrEnumEntry.initializerExpression IrExpressionBody
All non-declarations should be inside IrBody's now
2020-02-06 21:03:32 +03:00
Igor Yakovlev 3ec671d727 Fix getMirror for kotlin decompiled file
Possibly fixed EA142049
2020-02-06 20:24:20 +03:00
Alexander Udalov c08c3d4d9b Update JVM metadata version to 1.4.0 2020-02-06 17:22:02 +01:00
Ilmir Usmanov 8bb59e31e0 Minor. Remove textifyMethodNode, since it duplicates nodeText 2020-02-06 13:10:24 +01:00
Ilmir Usmanov 7dfd7b6081 Spill stack before analyzing it when looking for non-inline suspend lambda
parameters of inline function. Otherwise, it leads to AnalyzerException,
when inlined lambda contains try-catch block. The reason is simple:
in try block, we leave some variables on stack, while on catch block the
stack is empty. Spilling the variables before try block does the trick.
 #KT-34708 Fixed
2020-02-06 13:10:21 +01:00
Pavel Kirpichenkov b7a6fc271c minor: remove unused import 2020-02-06 13:42:44 +03:00
Mikhail Glukhikh e2a99f84a5 [FIR] Fix test data 2020-02-06 13:40:11 +03:00
Denis Zharkov 286622009d FIR: Cleanup PostponedArguments.kt 2020-02-06 13:00:29 +03:00
Denis Zharkov 6f6281a3f3 FIR: Support type aliases to function types in resolution 2020-02-06 13:00:29 +03:00
Juan Chen 7249d2f889 [FIR] Fix translation of invokes & add return expressions for lambdas
* fixed NoSuchMethod caused by mismatched signatures of the "invoke" method generated for lambda arguments
* added test cases in invoke.kt for KFunction and anonymous functions
* added a transformer to wrap the last expression in the bodies of lambdas with return
2020-02-06 12:44:14 +03:00
Svyatoslav Scherbina 5eedba3903 Add Native-specific frontend checker for @Throws 2020-02-06 11:00:31 +03:00
Svyatoslav Scherbina 2a4d995fd1 Add infrastructure for Native-specific frontend diagnostic tests 2020-02-06 11:00:28 +03:00
Svyatoslav Scherbina 99ba6b5ae1 Make :compiler:tests-common depend on :native:frontend.native 2020-02-06 11:00:25 +03:00
Svyatoslav Scherbina e699965ed6 Add infrastructure for Native-specific frontend diagnostics 2020-02-06 11:00:22 +03:00
Svyatoslav Scherbina 1f97ae1084 Make :compiler:cli depend on :native:frontend.native 2020-02-06 11:00:19 +03:00
Alexander Udalov a4cc5ea1da Remove unneeded dependency of backend-common on ir.tree 2020-02-05 22:45:12 +01:00
pyos 18dcbb3c94 JVM_IR: copy annotations to nullary bridges for default constructors 2020-02-05 22:02:05 +01:00
Alexander Udalov 5d766eace4 JVM IR: process type arguments for function references in DefaultImpls
Local functions for lambdas declared in DefaultImpls are now also
getting additional type parameters from the containing class (see
4dd794c2d2), so function references to them should be adapted similarly
to normal calls.

This change fixes
`box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt`.
2020-02-05 21:56:01 +01:00
Alexander Udalov 763cb6dd6f JVM IR: keep original KotlinType in eraseTypeParameters
Otherwise EnhancedNullability annotation instance is lost (for some
reason it's not translated to IR elements), and in the newly added test,
the wrapper type in Java is confused with primitive, and this causes
a platform declaration clash error.

Also make IrTypeArgument.eraseTypeParameters private, since it's not
used outside.
2020-02-05 21:51:33 +01:00
Ilmir Usmanov 1ae0017401 JVM_IR: Minor. Support isFun in WrappedClassDescriptor
Otherwise, compilation of kotlinx-coroutines-core breaks.
2020-02-05 19:17:06 +01:00
Mark Punzalan bc9edea527 [JVM IR] Fix issue with suspend functions in @JvmMultifileClass. 2020-02-05 19:00:54 +01:00
Pavel Kirpichenkov a5d201e263 Exclude unsupported language versions from gradle options
^KT-36146 Fixed
2020-02-05 20:15:17 +03:00
Pavel Kirpichenkov f530c0c903 minor: reformat 2020-02-05 20:15:17 +03:00
Pavel Kirpichenkov 87e0186334 Cleanup test checking legacy inline suspend
Move expected library compilation output to file.
^KT-36240 Fixed
2020-02-05 19:34:59 +03:00
Ilmir Usmanov 8335ad7e98 JVM_IR: Minor. Add test 2020-02-05 15:07:55 +01:00
Ilmir Usmanov 5977799c59 JVM_IR: Get rid of non-local related hacks in coroutines inlining 2020-02-05 15:07:49 +01:00
Ilmir Usmanov e5bd4f74f3 JVM_IR: Do not copy attributes into DEFAULT_IMPLS functions
Otherwise, on creating suspend function views these functions will clash
with interface ones. Instead, compute name of their continuation classes
based on attributes of the interface class.
2020-02-05 15:07:43 +01:00
Ilmir Usmanov fc70455877 JVM_IR: Move suspend function views creation to lowering
Now AddContinuationLowering is responsible for both adding continuation
classes to suspend functions and adding continuation parameters to
them.
Because we cannot create a view if inline suspend function is defined
in another file, we generate a stub without body when we encounter call
to it. And then, when we lower the file containing the function we add
the body. This way we have no unlowered views after the lowering.
Thus, after the lowering there should be no suspend function, which
are not views, therefore, remove VIEW origins.
Because transformations of suspend functions can copy them into another
object, use attribute as a key inside function to view map.
2020-02-05 15:07:37 +01:00
Alexander Udalov 5e7343624b Update test data of wrongInlineTarget to 1.4 2020-02-05 13:09:53 +01:00
Alexander Udalov 9f9eef44b1 Use captured type approximation from new inference in ExpressionCodegen
This is needed in order to avoid star projections being expanded into
`out Any?`, which is visible for users of `typeOf` since 1.4.

 #KT-30278 Fixed
2020-02-05 13:09:08 +01:00
Mikhail Glukhikh 98ea2231f1 [FIR] Code cleanup: NodeConfigurator 2020-02-05 11:19:25 +03:00
Mikhail Glukhikh 0fa98ed635 [FIR] Discriminate abstract members when resolving on super 2020-02-05 11:19:23 +03:00