Commit Graph

3327 Commits

Author SHA1 Message Date
Georgy Bronnikov a27d63f58f JVM_IR: flexible nullability as annotation
We carry information about flexible nullability of IrType as an
annotation, so there is no need to look at its underlying KotlinType.
2020-07-30 11:24:07 +03:00
Georgy Bronnikov a2e9521ad5 Make DescriptorlessExternalPackageFragmentSymbol public 2020-07-30 11:24:07 +03:00
Georgy Bronnikov c2ead0303b IR: remove more descriptor usage 2020-07-30 11:24:07 +03:00
Alexander Gorshenev 9a717e9ecf Don't copy default value parameters for fake overrides 2020-07-29 22:15:10 +03:00
Mark Punzalan 2cfd776092 ForLoopsLowering: Assume step == 1 for *Range (e.g., IntRange) and
handle accordingly (e.g., do not read `step` property).
2020-07-29 20:44:51 +02:00
Alexander Udalov 687d13a320 IR: cleanup expression implementations
Remove unused constructors with descriptors, minimize usages of
secondary constructors and make some properties non-lateinit, fix some
inspections.
2020-07-28 20:05:58 +02:00
Alexander Udalov e36d3ba4f6 IR: remove IrNoArgumentsCallableReferenceBase
To simplify transformation of IR element hierarchy to classes.
2020-07-28 20:05:57 +02:00
Alexander Udalov f240d51d2c IR: do not inherit IrFakeOverride* from IrFunction/IrProperty
This will help to reduce boilerplate after making the latter classes.

Without this change, IrFunctionCommonImpl would not be able to be a
class because it would introduce a diamond class hierarchy, and thus
that would require copying all its contents to IrFunctionImpl and
IrFakeOverrideFunctionImpl.
2020-07-28 19:05:12 +02:00
Alexander Udalov 0909894a96 PIR: make most implementations and carriers internal 2020-07-28 19:04:44 +02:00
Alexander Udalov cce55f1609 IR: add module ir.tree.impl, move main IR implementation there 2020-07-28 19:04:44 +02:00
Alexander Udalov 77247deb23 IR: add module ir.tree.persistent, copy PIR implementation there
Use PersistentIrFactory in JS IR compiler entry points.
2020-07-28 19:04:43 +02:00
Alexander Udalov 9aed92d2dd Partially revert "Persistent IR implementation"
This partially reverts commit f437da8ee5.
Changes related to carriers and others are still there. They will be
moved out to a separate module in a subsequent commit.
2020-07-28 19:04:43 +02:00
Dmitry Petrov 4fdccb3b35 JVM_IR: don't generate repeated ElementType values in @Target 2020-07-28 18:19:20 +03:00
Alexander Udalov df324d5a08 IR: pull up common accept/transform implementations to interfaces
To avoid duplicating them among the main, persisting, lazy, and
fir2ir-lazy implementations.

Also reformat a bit, and avoid storing descriptor in a field in some
places.
2020-07-28 12:05:24 +02:00
Alexander Udalov 12d2a02d22 JS IR: drop JsIrDeclarationBuilder
Move buildValueParameter back to JsIrBuilder, and use common IR builders
directly where buildFunction was called.
2020-07-28 12:05:24 +02:00
Alexander Udalov 0d605a6b7f IR: create IrBlockBody via IrFactory 2020-07-28 12:05:24 +02:00
Alexander Udalov 9ad4a754ce IR: create IrExpressionBody via IrFactory 2020-07-28 12:05:24 +02:00
Alexander Udalov d1dc938a5d IR: use IrFactory in IR builders 2020-07-28 12:05:24 +02:00
Alexander Udalov 898dd20a9e IR: use IrFactory in misc utils 2020-07-28 12:05:23 +02:00
Alexander Udalov f359f36ed9 IR: add IrFactory to IrDeclaration, use in deep copy 2020-07-28 12:05:23 +02:00
Alexander Udalov 305288aa82 IR: use IrFactory in psi2ir 2020-07-28 12:05:23 +02:00
Alexander Udalov 9356f87f28 IR: use IrFactory in linker 2020-07-28 12:05:23 +02:00
Alexander Udalov db4cbe7103 IR: use IrFactory in SymbolTable 2020-07-28 12:05:23 +02:00
Alexander Udalov c6a127e87e IR: introduce IrFactory
This is needed to refactor IrPersistingElementBase-based implementations
into another module, to use it in JS IR.
2020-07-28 12:05:23 +02:00
Dmitry Petrov 43fcb2330e JVM_IR: fix source file name for mutlifile class facades 2020-07-27 19:13:37 +03:00
Dmitriy Dolovov 3d9093583f Metadata: 'non-stable parameter names' flag for callables
^KT-34602
2020-07-27 23:11:30 +07:00
Steven Schäfer 9d63412b3e JVM IR: Produce correct generic signatures for special bridge methods 2020-07-27 17:02:24 +02:00
Steven Schäfer c16b548dff JVM IR: Don't produce annotations on builtin stub, toArray, and bridge methods 2020-07-27 17:02:24 +02:00
Dmitry Petrov e2a4ca10d6 JVM_IR: fix inner class attributes for private class in interface 2020-07-23 19:13:28 +03:00
Svyatoslav Kuzmich 4a803e9d2f [JS IR] Support object declaration export
Fixes KT-39117 and KT-39367
2020-07-23 08:21:59 +03:00
Alexander Udalov 65d3ae6253 JS IR: move declaration creation from IrBuilder to JsIrDeclarationBuilder
This is a temporary class until IrDeclarationFactory is there.
2020-07-22 22:40:08 +02:00
Alexander Udalov d3a34a8898 Psi2Ir: somewhat simplify Psi2IrTranslator API
Inline some methods only used once, deduplicate usages, rearrange
parameters, etc.
2020-07-22 22:38:21 +02:00
Alexander Udalov 241f82c70f IR: avoid storing unnecessary fields in IrPropertyImpl 2020-07-22 22:38:21 +02:00
Alexander Udalov 3f06f8a6ba IR: avoid storing unnecessary fields in IrFunctionImpl 2020-07-22 22:38:20 +02:00
Alexander Udalov 517c3e1020 IR: introduce IrFakeOverrideFunction, IrFakeOverrideProperty
Use them instead of the implementations. This will allow to refactor
creation to a factory and allow to use other implementations in the
future.
2020-07-22 22:38:20 +02:00
Alexander Udalov ca5eb40fa5 IR: minor, avoid usages of IrBlockBodyImpl/IrExpressionBodyImpl 2020-07-22 22:38:20 +02:00
Mark Punzalan 174576af61 ForLoopsLowering: Handle Sequence<*>.withIndex(). 2020-07-22 22:32:29 +02:00
Mark Punzalan 132960a695 ForLoopsLowering: Eliminate use of @ObsoleteDescriptorBasedAPI. 2020-07-22 22:32:29 +02:00
Mark Punzalan b1ce21bc55 ForLoopsLowering: Reduce unnecessary temporary variables for the
"checked step" (check for a positive step arg) and "negated step"
(negate the step arg when the nested step is negative).
2020-07-22 22:32:29 +02:00
Mark Punzalan 291d62f653 ForLoopsLowering: Move handlers to sub-package and separate files. 2020-07-22 22:32:29 +02:00
Dmitry Petrov 1272162a7f JVM_IR: generate "safe" names for functions in init blocks 2020-07-22 19:49:48 +03:00
Alexander Gorshenev c076d81f0c [IR FAKE OVERRIDES] Properly account for outer class type parameters 2020-07-22 12:02:51 +03:00
Pavel Kirpichenkov 1ef17c6f3a Drop isErrorTypeAllowed flag from type system context
The flag was used exclusively during calculation of common super type.
This change relies on assumption, that common super type is
NOT calculated in IR type system context.
2020-07-22 11:41:42 +03:00
Denis Zharkov 41bd013796 Fix incorrect usages of @NotNull type parameters in project sources
^KT-36770 In progress
2020-07-22 10:16:14 +03:00
Dmitry Petrov e84339a0d3 JVM_IR: fields for deprecated enum entries have ACC_DEPRECATED flag
'Deprecated' annotation can't be applied to field itself.
2020-07-21 22:25:44 +03:00
Roman Artemev edab3e3ba9 [PLUGIN API] Add referenceTypeAlias API to IrPluginContext
- attempt to fix KT-40193
2020-07-21 18:38:33 +03:00
Roman Artemev c4b4912a71 Revert "[PLUGIN API] Make referenceClass resolve type aliases too" 2020-07-21 18:38:32 +03:00
Anton Bannykh cb15570d75 [JS IR BE] Fix validation errors (duplicate nodes and incorrect parent) 2020-07-21 18:25:17 +03:00
Roman Artemev d7a0dbfae8 [PLUGIN API] Make referenceClass resolve type aliases too
- fix KT-40193
2020-07-21 15:36:31 +03:00
Roman Artemev 8c4930da2e [KLIB] Drop API which is no longer used 2020-07-21 13:15:35 +03:00