Commit Graph

1398 Commits

Author SHA1 Message Date
Georgy Bronnikov 4d2bcf7e66 IR: compute file local signatures from descriptors 2022-01-27 01:02:16 +03:00
Georgy Bronnikov 3cc883cf7b IR: use DescriptorBySignatureFinder in DeclarationStubGenerator
Duplicating code that was used for the same purpose in
DeclarationStubGenerator is removed.
2022-01-27 01:02:14 +03:00
Dmitry Petrov e55f7459f4 JVM_IR drop StripTypeAliasDeclarationsLowering 2022-01-26 12:49:20 +00:00
Sergey Bogolepov 2306834b06 [K/N] Fix comparison of IrConstantPrimitiveImpl 2022-01-25 09:11:00 +00:00
Alexander Udalov 3e7b1c027f IR: make IrConst.copyWithOffsets an extension function
Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:36 +01:00
Alexander Udalov 785eb83822 IR: refactor IrMemberAccessExpression internals
The idea is to keep the subclasses as simple as possible, to simplify
transition to auto-generated IR.

Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:36 +01:00
Alexander Udalov 6f6bdd8aec IR: change acceptChildren/transformChildren order in IrClass
Traverse properties of supertypes first, and then handle thisReceiver.
This will simplify transition to auto-generated IR.
2022-01-19 17:50:35 +01:00
Alexander Udalov 4ecc5e517a IR: move some accept/acceptChildren/transformChildren to base classes
This will be helpful for the transition to auto-generated IR.

Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:35 +01:00
Alexander Udalov 886545262b IR: use mutable lists in IrStringConcatenation, IrTry, IrVararg
Make addArgument/addElement/putElement extension functions. This will
simplify transition to auto-generated IR.

Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:35 +01:00
Alexander Udalov 9ee570ae54 IR: update copyright in ir.tree declarations and expressions
To simplify review of the upcoming IR tree generator.

Note that copyright is dated 2021, since that's in
license/COPYRIGHT_HEADER.txt which is used by generators.
2022-01-19 17:50:35 +01:00
Alexander Udalov f17fc67683 IR: split files containing multiple classes/functions
This change only moves code around, no behavior is changed.
Specifically, ir.tree sources containing several declarations are split
into several files: one file per class, and one file for all extension
functions per package (IrDeclarations.kt, IrExpressions.kt,
IrVisitors.kt, IrConstructorCallTypeArguments.kt).

This is useful because after introducing IR tree generator, we can
easily see how generated sources are different from those which were
written manually, since Git will recognize file moves. Also, it will
keep Git history for sources which consisted of one big class + a couple
of extension functions (e.g. IrElementVisitorVoid.kt).
2022-01-19 17:50:35 +01:00
Alexander Udalov e4b63d4a2b IR: minor, rename some files to keep git history 2022-01-19 17:50:35 +01:00
Alexander Udalov 6445a29893 IR: remove type parameter in visitConst
Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:35 +01:00
Alexander Udalov 81106526b1 IR: remove IrConstantObject.putArgument, IrConstantArray.putElement
Change `valueArguments` and `elements` types to be mutable lists. This
will simplify IR tree generator.
2022-01-19 17:50:35 +01:00
Evgeniy.Zhelenskiy e97ca2ada4 [Psi2Ir, Fir2Ir] Generate toString, hashCode, equals methods for MF VC 2022-01-14 13:51:57 +00:00
Irene Dea 13bff10567 Fix union related failures. 2022-01-08 15:26:44 +03:00
Irene Dea a98e2c4e03 Fix failed tests 2022-01-08 15:26:44 +03:00
Irene Dea 19bfc43bee Fixes and refactors 2022-01-08 15:25:07 +03:00
Irene Dea f2a351367c Implement unionTypeAttributes and replaceTypeAttributes in ConeInferenceContext 2022-01-08 15:25:07 +03:00
Irene Dea 56d817b49f Union type attributes for common super type calculation 2022-01-08 15:25:07 +03:00
Dmitry Petrov 1e5fc1c3aa JVM_IR KT-27427 use checkNotNull with message in checked casts
This would prevent extra branching in 'as <not-null-type>', which
usually would not be covered.
2021-12-30 13:41:21 +03:00
Dmitry Petrov 5946242d75 JVM_IR fix special bridges in mixed Java/Kotlin hierarchies
KT-50257 KT-50476
2021-12-29 13:29:19 +00:00
Roman Artemev 93e7eb2a8e [JS IR] Cleanup StageController & Lowerings magic a bit 2021-12-24 16:50:47 +03:00
Roman Artemev 7341a17a5d [IR] Cleanup ir serialization 2021-12-24 16:50:44 +03:00
Roman Artemev 4babc30624 [IR] Remove Persistent IR 2021-12-24 16:50:42 +03:00
Dmitry Petrov 976998b56c PSI2IR KT-49526 function reference type approximation hack 2021-12-17 21:06:24 +00:00
Svyatoslav Scherbina 3fd4d90cca Native: remove harmful assertions from NaiveSourceBasedFileEntryImpl
These assertions checked that nobody requests line and column number
for the UNDEFINED_OFFSET.
But diagnostic and crash reporting tools might request line and column,
and crashing during crash reporting is not great.

So handle UNDEFINED_OFFSET gracefully instead, in a conventional manner.
2021-12-17 14:49:34 +00:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Simon Ogorodnik 7b8ece8758 FIR: Make constraint injector treat stub types as type variables 2021-12-15 22:22:55 +03:00
Tianyu Geng a5844b754e Type Approximation: add separate flag to control approx. anonymous type
This extra flexibility is useful for IDE where we always want to
approximate anonymous types but may not want to approximate other local
 types
2021-12-15 16:09:27 +03:00
Victor Petukhov 24900630cb Revert "Revert "[FE 1.0] Provide an API to clean compile time initializer cache for variable descriptor""
This reverts commit faeb5d21ab.
2021-12-14 14:21:46 +03:00
Ilya Chernikov cb5e451e05 Implement script instance capturing in script lowering
for regular classes only. Reimplementing the main behavior of the
old BE and implementing few cases on top of it.
#KT-19423 fixed
2021-12-14 13:39:17 +03:00
Dmitry Petrov df460a842b JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter 2021-12-13 14:13:34 +00:00
Dmitry Petrov 6f148c594f Revert "JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter"
This reverts commit 627d838343.
2021-12-13 14:13:33 +00:00
Dmitry Petrov 627d838343 JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter 2021-12-11 08:04:26 +00:00
Nikolay Krasko faeb5d21ab Revert "[FE 1.0] Provide an API to clean compile time initializer cache for variable descriptor"
This reverts commit 0e6762acc3.
2021-12-10 16:54:55 +03:00
Victor Petukhov 0e6762acc3 [FE 1.0] Provide an API to clean compile time initializer cache for variable descriptor 2021-12-09 16:15:24 +03:00
Dmitry Petrov 0ccd7a7e0c KT-47939 fun interface constructor reference should throw NPE for null 2021-12-08 14:12:41 +03:00
Dmitry Petrov 50b0dae786 KT-47939 fixes after review 2021-12-08 14:12:37 +03:00
Dmitry Petrov 27a144f86f PSI2IR KT-47939 callable references to fun interface constructors 2021-12-08 14:12:34 +03:00
Victor Petukhov 61d40403e7 [FE 1.0] Create captured star projection for self types by replacing type arguments deeply
^KT-49752 Fixed
2021-12-07 11:38:45 +03:00
Dmitriy Novozhilov 3519543831 [IR Test] Properly create empty dump for IR files witout source 2021-12-06 19:23:12 +03:00
Dmitriy Novozhilov 86404b8027 [FIR] Implement IR body generators for all FIR declarations generators in plugin prototype 2021-12-03 14:17:34 +03:00
Anton Bannykh 7b5fbb2985 [IR] add a TODO for the privateSignature 2021-12-03 12:58:25 +03:00
Anton Bannykh 4de69fb4b5 [JS IR] store signatures for private symbols separately from public
Those signatures are used in JS IR IC
2021-12-03 12:58:24 +03:00
Anton Bannykh cb3538db92 Revert "[IR] support storing signatures for non-public symbols"
This reverts commit 33cd7e982c.
2021-12-03 12:58:24 +03:00
Anastasiya Shadrina 17f24319d0 [IR, Tests] Add context receivers count to IR dump 2021-12-02 20:24:46 +03:00
Anastasiya Shadrina 617af898b0 [FE, IR] Support deserialization 2021-12-02 20:24:37 +03:00
Anastasiya Shadrina d0794e6741 [IR] Make contextReceiverParametersCount abstract in IrFunction 2021-12-02 20:24:34 +03:00
Anastasiya Shadrina 097e286622 [IR] Minor: add a note about contextReceiverParametersCount prop 2021-12-02 20:24:27 +03:00