Commit Graph

1012 Commits

Author SHA1 Message Date
Georgy Bronnikov 8e331c8afe IR: relax type cast for WrappedVariableDescriptor.containingDeclaration 2020-10-22 18:26:47 +03:00
Georgy Bronnikov b588839752 EnumConstructorCall.fromSymbolDescriptor 2020-10-22 18:26:46 +03:00
Georgy Bronnikov 887dd10764 IR: remove descriptor usage 2020-10-22 18:26:46 +03:00
Georgy Bronnikov e5cf7a1be7 Remove descriptor usage from Scope.kt 2020-10-22 18:26:46 +03:00
Alexander Gorshenev 81c06b24f7 [Private fake overrides] Private fake overrides linkage 2020-10-22 13:23:28 +03:00
Alexander Gorshenev 223d1dd5e6 [Private fake overrides] Private fake override construction 2020-10-22 13:23:28 +03:00
Alexander Gorshenev c7ea8b1ab6 [Private fake overrides] Prepare IdSignature for private fake override construction 2020-10-22 13:23:27 +03:00
pyos ccf921510d PSI2IR / FIR2IR: do not create temporaries for adapted references
Arguments to function references behave the same as arguments to
function calls and should be evaluated once regardless, so the temporary
is unnecessary.
2020-10-21 15:21:01 +02:00
LepilkinaElena b786cf7559 [IR] Made signature nullable (#3860) 2020-10-20 21:13:40 +03:00
Dmitry Petrov 47c784f023 JVM_IR fix Java wildcard types translation
Types such as 'Collection<? extends CharSequence>' are treated as
'(kotlin.collections.MutableCollection<out kotlin.CharSequence!>
  ..kotlin.collections.Collection<kotlin.CharSequence!>?)'
by the front-end.
When generating generic signatures, JVM BE takes lower bound (which is
'kotlin.collections.MutableCollection<out kotlin.CharSequence!>').
Emulate this behavior in TypeTranslator.
2020-10-19 20:52:53 +03:00
Georgy Bronnikov 305da8ee10 IR: IrFunctionReference.fromSymbolDescriptor 2020-10-19 12:21:12 +03:00
Georgy Bronnikov 14b3beefb3 IR: IrDelegatingConstructorCall.fromSymbolDescriptor 2020-10-19 12:21:12 +03:00
Georgy Bronnikov b28c85f5ea IR: IrCall.fromSymbolDescriptor 2020-10-19 12:21:12 +03:00
Georgy Bronnikov ab3ef3a7e9 IR: remove descriptor usage 2020-10-19 12:21:12 +03:00
Georgy Bronnikov 065edac64b IR: remove unused functions 2020-10-19 12:21:12 +03:00
Georgy Bronnikov 726282c1ee IR: remove a descriptor usage 2020-10-19 12:21:11 +03:00
LepilkinaElena cc4d93ac71 [IR] Eliminated expensive calculating of fqNames (#3815) 2020-10-16 21:07:04 +03:00
Roman Artemev 8ce497c7ef [IR] Add wrapped descriptor for error declaration 2020-10-15 13:55:05 +03:00
Pavel Kirpichenkov 39a87435ee [FIR/NI] Refactor type variable gathering from lambda types
Motivation:
- drop getArguments from type context as a duplicate of getArgumentList
- reduce the number of collection allocations in getAllDeeplyRelatedTypeVariables

Additional minor improvements, test data fixes
2020-10-13 11:00:21 +03:00
Pavel Kirpichenkov 3822a32fce [FIR] Prepare commonization of PostponedArgumentInputTypesResolver 2020-10-13 11:00:20 +03:00
Mark Punzalan 8bc7370b92 ForLoopsLowering: Add PLUSEQ origin to increment to use IINC
instructions if possible.
2020-10-09 21:34:56 +02:00
Dmitry Savvinov f02593074f Drop isEqualTypeConstructor in favour of areEqualTypeConstructors 2020-10-09 13:44:06 +03:00
Mads Ager 3817aa32a1 [IR] Move isAssignable to IrValueDeclaration. 2020-10-06 21:47:29 +02:00
Mads Ager af0999ec6f [IR] Support isAssignable in builders and serialization. 2020-10-06 21:47:29 +02: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
Mads Ager 87f17dec4a [JS_IR] Use IrSetValue for default argument handling for JS backend.
Fix a couple of parameter remappings that now have to take IrSetValue
into account as well as IrGetValue.
2020-10-06 21:47:29 +02:00
Mads Ager 9a93bb3f09 [IR] Add IR support for setting parameters.
Use it in the JVM_IR backend for default values code. The parameter
local has to be overwritten for the inliner to work.
2020-10-06 21:47:29 +02:00
Mads Ager a37f16d7a2 [IR] Do not generate line numbers for synthesized data class members.
Fixes KT-41903.
2020-10-06 19:53:47 +02:00
Steven Schäfer 714d17ac63 Parcelize, JVM IR: Handle star projected and nullable arrays. 2020-10-06 17:42:35 +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
LepilkinaElena 402f7df0d4 [IR] Save several last calculated line numbers not to recalculate them several times during code and debug info generation (#3792) 2020-10-06 08:03:50 +03:00
LepilkinaElena dc2845df10 [IR] Avoid extra lists creation during getting explicit/all parameters (#3769) 2020-10-01 21:19:40 +03:00
Dmitry Petrov af86c52101 JVM_IR merge annotations when substituting types
Otherwise special annotations such as @EnhancedNullability are lost,
which affects JVM signatures.

KT-42330
2020-09-30 15:44:54 +03:00
Alexander Udalov b497f39c29 IR: do not try to render IrUninitializedType
This will improve exception messages in case some error happens on a
function whose return type is uninitialized, as in KT-41401.
2020-09-29 12:32:45 +02:00
Georgy Bronnikov 83ee705c0a IR: make IrClassReference.classType mutable 2020-09-22 23:53:41 +03:00
Georgy Bronnikov 377940a6ea IR: handle IrVararg.varargElementType in RemapTypes 2020-09-22 23:53:41 +03:00
Georgy Bronnikov 728c55973a IR: handle MemberAccessExpression type parameters in RemapTypes 2020-09-22 23:53:41 +03:00
Georgy Bronnikov 3041a2815c IR: handle varargElementType in LocalDeclarationsLowering 2020-09-22 23:53:41 +03:00
Georgy Bronnikov 67d7bf3269 IR: take care of supertypes when copying IrTypeParameters 2020-09-22 23:53:40 +03:00
Georgy Bronnikov 1f3d344835 IR: add RemapTypes.kt 2020-09-22 23:53:39 +03: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 09a906cc9a IR: make IrTypeOperatorCall.typeOperand 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
Georgy Bronnikov 1f37795e08 IR: make IrExpression.type mutable 2020-09-22 23:53:38 +03:00
Mads Ager 78483930bc [JVM_IR] Fix offsets in constant propagation optimization.
Loads of temporary variables that contain constants are replaced
with a copy of the constant. This avoids locals loads and stores.
However, the copy of the constant needs to have the offset of
the load and not of the original constant.

Fixes KT-41963.
2020-09-22 19:12:06 +02:00