IR BE common: provide type arguments count explicitly for ir calls to reduce dependency on descriptors
(cherry picked from commit af76ae2)
This commit is contained in:
committed by
Dmitry Petrov
parent
f002e6030a
commit
686a3d631c
+6
-15
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.lower
|
||||
@@ -134,7 +123,8 @@ open class DefaultArgumentStubGenerator constructor(val context: CommonBackendCo
|
||||
startOffset = irFunction.startOffset,
|
||||
endOffset = irFunction.endOffset,
|
||||
type = context.irBuiltIns.unitType,
|
||||
symbol = irFunction.symbol, descriptor = irFunction.symbol.descriptor
|
||||
symbol = irFunction.symbol, descriptor = irFunction.symbol.descriptor,
|
||||
typeArgumentsCount = irFunction.typeParameters.size
|
||||
).apply {
|
||||
params.forEachIndexed { i, variable ->
|
||||
putValueArgument(i, irGet(variable))
|
||||
@@ -215,7 +205,8 @@ class DefaultParameterInjector constructor(val context: CommonBackendContext, pr
|
||||
endOffset = expression.endOffset,
|
||||
type = context.irBuiltIns.unitType,
|
||||
symbol = symbolForCall,
|
||||
descriptor = symbolForCall.descriptor
|
||||
descriptor = symbolForCall.descriptor,
|
||||
typeArgumentsCount = symbolForCall.owner.typeParameters.size
|
||||
)
|
||||
.apply {
|
||||
params.forEach {
|
||||
|
||||
+3
-1
@@ -289,7 +289,8 @@ class LocalDeclarationsLowering(val context: BackendContext, val localNameProvid
|
||||
expression.startOffset, expression.endOffset,
|
||||
context.irBuiltIns.unitType,
|
||||
newCallee.symbol,
|
||||
newCallee.descriptor
|
||||
newCallee.descriptor,
|
||||
expression.typeArgumentsCount
|
||||
).also {
|
||||
it.fillArguments(expression)
|
||||
it.copyTypeArgumentsFrom(expression)
|
||||
@@ -440,6 +441,7 @@ class LocalDeclarationsLowering(val context: BackendContext, val localNameProvid
|
||||
newCallee.returnType,
|
||||
newCallee.symbol,
|
||||
newCallee.descriptor,
|
||||
oldCall.typeArgumentsCount,
|
||||
oldCall.origin, oldCall.superQualifierSymbol
|
||||
).also {
|
||||
it.copyTypeArgumentsFrom(oldCall)
|
||||
|
||||
Reference in New Issue
Block a user