Georgy Bronnikov
7f4df19dd1
JVM_IR: reorganize throw... functions in Symbols
2020-08-11 10:54:29 +03: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
e4cd7cdbcf
IR: remove unused code, cleanup
2020-08-06 17:08:04 +02:00
Alexander Udalov
b30b2e0179
IR: minor, render duplicate IR node in checker
2020-08-06 17:08:04 +02:00
Alexander Udalov
8db1c3611b
IR: introduce abstract class IrDeclarationBase
...
The main purpose of this class is to improve performance of IR visitors
and transformers. `IrElementVisitor.visitDeclaration` now takes
IrDeclarationBase as a parameter, and therefore the call to `accept`
there is now a virtual class call, instead of an interface call.
2020-08-06 17:08:04 +02: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
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
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
Steven Schäfer
9d63412b3e
JVM IR: Produce correct generic signatures for special bridge methods
2020-07-27 17:02:24 +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
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
Alexander Udalov
c7f9dc1c40
IR: rename DeclarationFactory to InnerClassesSupport, move out of context
...
Methods of the common interface DeclarationFactory were only used in
lowerings in InnerClassesLowering, which were used in JVM and JS, not
Native. Therefore, it makes sense to have this as a separate interface
and pass its implementation to these lowerings directly, instead of
declaring it in the common context (which is not going to be implemented
in Native).
2020-07-20 22:26:11 +02:00
Alexander Udalov
cf884fb048
IR: remove JVM-specific methods from DeclarationFactory
2020-07-20 22:26:11 +02:00
Georgy Bronnikov
c901e82a55
IR: add IrSimpleFunction.isInfix
2020-07-18 11:03:33 +03:00
Jim Sproch
ccbb2eaba9
Make linker visible to compiler plugins
2020-07-17 21:18:07 +03:00
Igor Chevdar
8bbbee8ffd
[IR] Supported IrFunctionExpression in ClosureAnnotator
...
It may be encountered during local classes extraction from inline lambdas
2020-07-16 19:23:02 +05:00
Alexander Udalov
c9fdef8233
IR: use buildField where possible
2020-07-16 16:09:31 +02:00
Alexander Udalov
2d723f1c51
IR: use buildClass where possible
2020-07-16 16:09:31 +02:00
Alexander Udalov
5b1193407a
IR: use buildConstructor where possible
2020-07-16 16:09:31 +02:00
Alexander Udalov
6aa09f61d4
IR: use buildFun where possible
2020-07-16 16:09:30 +02:00
Alexander Udalov
39e38c7049
IR: introduce buildVariable, use where possible
2020-07-16 16:09:30 +02:00
Alexander Udalov
c3560e5854
IR: use buildTypeParameter, minor cleanup
2020-07-16 16:09:30 +02:00
Alexander Udalov
4b5464c6cc
IR: introduce buildReceiverParameter, use where possible
2020-07-16 16:09:30 +02:00
Alexander Udalov
b36a6114aa
IR: use buildValueParameter where possible
2020-07-16 16:09:29 +02:00
Georgy Bronnikov
a97d718de8
IR: remove a KotlinType use from Ir.kt
2020-07-10 17:35:30 +03:00
Alexander Udalov
e674226a3b
IR: do not use Ir*Impl elements where it's not necessary
2020-07-10 16:17:06 +02:00
Anton Bannykh
abc6ecaa1c
[JS IR BE] support SAM conversions in DCE-driven mode
2020-07-10 11:30:42 +03:00
Alexander Udalov
0691595ed2
IR: remove deprecated constructor of IrValueParameterImpl
2020-07-09 18:51:03 +02:00
Alexander Udalov
8c71d8f126
Undeprecate VariableDescriptorWithAccessors.isDelegated
...
Apparently there's quite a few valid usages of this method outside of
the compiler frontend, where manual suppression is annoying.
2020-07-07 18:09:40 +02:00
Alexander Udalov
181965f6e8
IR: inline namedIrModulePhase and namedIrFilePhase phase builders
...
Construct NamedCompilerPhase directly instead. Only use phase builders
where the code becomes easier to read.
2020-07-02 21:19:28 +02:00
Alexander Udalov
15a969b3ba
IR: refactor performByIrFile a little
...
Take a list of phases instead of the CompositePhase, to make stacktraces
nicer and avoid quadratic time of phase construction.
2020-07-02 21:19:28 +02:00
Alexander Udalov
4475325ffa
IR: refactor PhaseBuilders a little
...
- use named classes to improve stacktraces
- reorder parameters to make the code shorter
- use explicit types to improve IDE resolve in usages
2020-07-02 21:19:27 +02:00
Alexander Udalov
7997d4afd3
IR: do not use AnyNamedPhase where there is Context parameter
2020-07-02 21:19:27 +02:00
Alexander Udalov
ef58f1e72e
IR: simplify phaser code a little
...
- merge NamedCompilerPhase, SameTypeNamedPhaseWrapper,
AbstractNamedPhaseWrapper and inherit it from SameTypeCompilerPhase
- inline some functions to simplify stacktraces
- reformat and fix inspections
2020-07-02 21:19:27 +02:00
Alexander Udalov
d4605f5816
IR: add type parameter to IrMemberAccessExpression and some subclasses
...
This is needed to get rid of the diamond hierarchy:
IrMemberAccessExpression
/ \
/ \
IrFunctionAccessExpression IrCallableReference
\ /
\ /
IrFunctionReference
In the subsequent commit, IrFunctionReference no longer inherits from
IrFunctionAccessExpression; the more precise type of `val symbol:
IrFunctionSymbol` is now carried via the generic type argument.
This will help to refactor IR element hierarchy from interfaces to
classes, improving performance of visitors and transformers.
2020-07-01 13:03:56 +02:00
Anton Bannykh
5239ab477c
Lowerings apply to a list of modules
2020-06-26 17:55:33 +03:00
Ivan Kylchik
f028d6c898
Move interpreter files to separate module
2020-06-24 16:13:01 +03:00
Ivan Kylchik
49124709b8
Remove all usages of descriptors from interpreter
2020-06-24 16:13:01 +03:00