IR: remove deprecated constructor of IrValueParameterImpl

(cherry picked from commit 66cbe07ea6f41033e46257cf8113d6a689a49e37)
This commit is contained in:
Alexander Udalov
2020-07-06 22:25:15 +02:00
committed by Vasily Levchenko
parent ce1e651f64
commit 7cc6edc3ae
2 changed files with 23 additions and 20 deletions
@@ -207,11 +207,10 @@ internal class BuiltInFictitiousFunctionIrClassFactory(
parent = functionClass parent = functionClass
valueParameters += invokeFunctionDescriptor.valueParameters.map { valueParameters += invokeFunctionDescriptor.valueParameters.map {
IrValueParameterImpl( IrValueParameterImpl(
SYNTHETIC_OFFSET, SYNTHETIC_OFFSET, SYNTHETIC_OFFSET, SYNTHETIC_OFFSET, invokeFunctionOrigin,
invokeFunctionOrigin, IrValueParameterSymbolImpl(it), it.name, it.index,
it, functionClass.typeParameters[it.index].defaultType, null,
functionClass.typeParameters[it.index].defaultType, it.isCrossinline, it.isNoinline
null
).also { it.parent = this } ).also { it.parent = this }
} }
if (!isFakeOverride) if (!isFakeOverride)
@@ -258,17 +257,18 @@ internal class BuiltInFictitiousFunctionIrClassFactory(
} }
private fun IrFunction.createValueParameter(descriptor: ParameterDescriptor): IrValueParameter { private fun IrFunction.createValueParameter(descriptor: ParameterDescriptor): IrValueParameter {
val symbol = IrValueParameterSymbolImpl(descriptor)
val varargType = if (descriptor is ValueParameterDescriptor) descriptor.varargElementType else null val varargType = if (descriptor is ValueParameterDescriptor) descriptor.varargElementType else null
return IrValueParameterImpl( return IrValueParameterImpl(
offset, offset,
offset, offset,
memberOrigin, memberOrigin,
descriptor, IrValueParameterSymbolImpl(descriptor),
descriptor.name,
descriptor.indexOrMinusOne,
toIrType(descriptor.type), toIrType(descriptor.type),
varargType?.let { toIrType(it) }, varargType?.let { toIrType(it) },
descriptor.name, descriptor.isCrossinline,
symbol descriptor.isNoinline
).also { ).also {
it.parent = this it.parent = this
} }
@@ -11,29 +11,35 @@ import org.jetbrains.kotlin.backend.konan.KonanBackendContext
import org.jetbrains.kotlin.backend.konan.KonanCompilationException import org.jetbrains.kotlin.backend.konan.KonanCompilationException
import org.jetbrains.kotlin.backend.konan.descriptors.synthesizedName import org.jetbrains.kotlin.backend.konan.descriptors.synthesizedName
import org.jetbrains.kotlin.backend.konan.ir.buildSimpleAnnotation import org.jetbrains.kotlin.backend.konan.ir.buildSimpleAnnotation
import org.jetbrains.kotlin.backend.konan.ir.containsNull
import org.jetbrains.kotlin.builtins.KOTLIN_REFLECT_FQ_NAME import org.jetbrains.kotlin.builtins.KOTLIN_REFLECT_FQ_NAME
import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.config.LanguageVersionSettings
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.ParameterDescriptor import org.jetbrains.kotlin.descriptors.ParameterDescriptor
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.descriptors.impl.PackageFragmentDescriptorImpl import org.jetbrains.kotlin.descriptors.impl.PackageFragmentDescriptorImpl
import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.SourceManager import org.jetbrains.kotlin.ir.SourceManager
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.builders.* import org.jetbrains.kotlin.ir.builders.*
import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.declarations.impl.* import org.jetbrains.kotlin.ir.declarations.impl.IrFieldImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl
import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns
import org.jetbrains.kotlin.ir.descriptors.WrappedFieldDescriptor import org.jetbrains.kotlin.ir.descriptors.WrappedFieldDescriptor
import org.jetbrains.kotlin.ir.descriptors.WrappedVariableDescriptor import org.jetbrains.kotlin.ir.descriptors.WrappedVariableDescriptor
import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrCatchImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBodyImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrVarargImpl
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol
import org.jetbrains.kotlin.ir.symbols.IrSymbol import org.jetbrains.kotlin.ir.symbols.IrSymbol
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
import org.jetbrains.kotlin.ir.symbols.impl.IrFieldSymbolImpl import org.jetbrains.kotlin.ir.symbols.impl.IrFieldSymbolImpl
import org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl
import org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl import org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl
import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
@@ -44,8 +50,8 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.calls.checkers.isRestrictsSuspensionReceiver import org.jetbrains.kotlin.resolve.calls.checkers.isRestrictsSuspensionReceiver
import org.jetbrains.kotlin.resolve.scopes.MemberScope import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.types.*
import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.types.typeUtil.immediateSupertypes import org.jetbrains.kotlin.types.typeUtil.immediateSupertypes
import java.lang.reflect.Proxy import java.lang.reflect.Proxy
@@ -379,12 +385,9 @@ fun IrValueParameter.copy(newDescriptor: ParameterDescriptor): IrValueParameter
//} //}
return IrValueParameterImpl( return IrValueParameterImpl(
startOffset, startOffset, endOffset, IrDeclarationOrigin.DEFINED, IrValueParameterSymbolImpl(newDescriptor),
endOffset, newDescriptor.name, newDescriptor.indexOrMinusOne, type, varargElementType,
IrDeclarationOrigin.DEFINED, newDescriptor.isCrossinline, newDescriptor.isNoinline
newDescriptor,
type,
varargElementType
) )
} }