Commit Graph

32 Commits

Author SHA1 Message Date
Anton Bannykh 87f3ca3f36 IR: make isExternal immutable 2021-03-02 14:30:18 +03:00
Anton Bannykh 027f656790 JS IR: make PIR Carriers immutable 2021-03-02 14:30:15 +03:00
Anton Bannykh c06b345f3c Hide stageController into the IrFactory 2021-02-17 10:42:50 +03:00
Anton Bannykh 97080c49fc Persistent IR generator
Goal:
- avoid hand-writing the boilerplate
- easier PIR evolution

Output is reasonably close the hand-writtern version
2021-02-17 10:42:50 +03:00
Anton Bannykh 8a0ce20d43 PIR: minor restructuring 2021-02-17 10:42:50 +03:00
Svyatoslav Kuzmich 2a424ad2af [IR] Make isExternal mutable and accessible via common interface
JS IR: Mark all effectively external declarations as external to access it
directly instead of computing it every time
2021-02-04 16:15:33 +03:00
Georgy Bronnikov c5961da780 IR: remove WrappedDescriptors altogether 2020-12-23 18:50:52 +03:00
Georgy Bronnikov b07dccb8d7 Fir2IR: remove wrapped descriptors 2020-12-23 18:50:52 +03:00
Mads Ager 5d9e86863a [IR] Make isHidden and isAssignable explicit on IrValueParameter.
There were a couple of places where they were confused and
isAssignable was passed as a positional parameter in the position
of isHidden.
2020-12-04 17:04:45 +01:00
Zalim Bashorov 2c1e4c1769 [IR] Use more specific type (IrSimpleFunction) for accessors in IrLocalDelegatedProperty 2020-11-05 22:25:05 +03:00
Mads Ager 1f2ca606a5 [IR] Add isAssignable property to IrValueParameter.
Use it to check that only the value parameters that are explicitly
marked assignable are assigned.

Currently, the only parameters marked assignable are those for
default argument stubs.
2020-10-06 21:47:29 +02:00
Alexander Udalov 2573eaa77f IR: do not crash renderer on functions with uninitialized return type
This is a follow-up to b497f39c29. It
turns out that it didn't help because `IrFunction.returnType` throws
exception, and checking for `IrUninitializedType` in `IrType.render` was
already too late. Throw and catch specific exception instead.

Also add function name into the exception message for better diagnostics
elsewhere (can't compute the full FQ name because in cases like
KT-42020, the parent is also uninitialized).
2020-10-06 14:23:34 +02:00
Alexander Udalov 06f1bd6101 Reformat IR tree declarations and implementations
Most of the changes are to the incorrect formatting introduced in
d1fd1da56f.
2020-10-06 14:21:40 +02:00
Georgy Bronnikov df1d9a0113 IR: make IrTypeParameter.superTypes persistent mutable field 2020-09-22 23:53:39 +03:00
Georgy Bronnikov a409976d28 IR: make IrValueParameter.varargElementType mutable 2020-09-22 23:53:39 +03:00
Georgy Bronnikov a3763e8276 IR: make IrTypeAlias.expandedType mutable 2020-09-22 23:53:39 +03:00
Georgy Bronnikov 78fc690f29 IR: make IrLocaldelegatedProperty.type mutable 2020-09-22 23:53:39 +03:00
Georgy Bronnikov d9681e535d IR: make IrField.type mutable 2020-09-22 23:53:39 +03:00
Georgy Bronnikov 5065b1a4c6 Make IrValueDeclaration.type mutable 2020-09-22 23:53:38 +03:00
Roman Artemev f01941d1dd [IR] Support isHidden is IrFactory API
- add API to create a hidden value parameter
2020-09-17 00:57:16 +03:00
Roman Artemev 79e2886da1 [IR] Add isHidden flag into IrValueParameter 2020-09-17 00:57:15 +03:00
Dmitriy Novozhilov d1fd1da56f Rename Visibility to DescriptorVisibility 2020-09-04 11:07:42 +03:00
Alexander Udalov 9d81e50128 IR: undeprecate IrUninitializedType
It's no longer a temporary hack, see the comment.
2020-08-27 18:02:04 +02:00
Alexander Udalov a810dbb41b IR: fix compiler warnings 2020-08-18 10:33:25 +02:00
Alexander Udalov 08a35f0674 IR: make IrBody and subtypes classes 2020-08-11 14:41:57 +02:00
Georgy Bronnikov dafcdc527d IR: propagate original declaration info via attributeOwnerId
For IrProperty, IrSimpleFunction we need to pass information about
original declaration to JVM_IR codegen. Instead of descriptors, use
the attributeOwnerId field.
2020-08-10 10:16:23 +03:00
Georgy Bronnikov 04d93dfbce IR: move containerSource from descriptor to IrFunction, IrProperty 2020-08-10 10:16:23 +03:00
Alexander Udalov 771e7574f4 IR: make subtypes of IrDeclaration classes 2020-08-06 17:08:03 +02:00
Alexander Udalov 9152df4702 PIR: transform base implementation classes to interfaces
Unfortunately this requires a lot of boilerplate, but is a requirement
for transforming the main IR element hierarchy interfaces
(IrDeclaration, IrClass, ...) to classes.
2020-08-06 16:46:26 +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 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