[IR] Renamed a lowering

Former CallableReferenceLowering actually only lowers function references,
property references are lowered in DelegationLowering
This commit is contained in:
Igor Chevdar
2020-08-15 15:48:38 +05:00
parent 37f335b483
commit f8341d73ef
4 changed files with 11 additions and 11 deletions
@@ -290,10 +290,10 @@ internal val delegationPhase = makeKonanFileLoweringPhase(
description = "Delegation lowering"
)
internal val callableReferencePhase = makeKonanFileLoweringPhase(
::CallableReferenceLowering,
name = "CallableReference",
description = "Callable references lowering",
internal val functionReferencePhase = makeKonanFileLoweringPhase(
::FunctionReferenceLowering,
name = "FunctionReference",
description = "Function references lowering",
prerequisite = setOf(delegationPhase) // TODO: make weak dependency on `testProcessorPhase`
)
@@ -301,14 +301,14 @@ internal val interopPhase = makeKonanFileLoweringPhase(
::InteropLowering,
name = "Interop",
description = "Interop lowering",
prerequisite = setOf(inlinePhase, localFunctionsPhase, callableReferencePhase)
prerequisite = setOf(inlinePhase, localFunctionsPhase, functionReferencePhase)
)
internal val varargPhase = makeKonanFileLoweringPhase(
::VarargInjectionLowering,
name = "Vararg",
description = "Vararg lowering",
prerequisite = setOf(callableReferencePhase, defaultParameterExtentPhase, interopPhase)
prerequisite = setOf(functionReferencePhase, defaultParameterExtentPhase, interopPhase)
)
internal val compileTimeEvaluatePhase = makeKonanFileLoweringPhase(
@@ -376,7 +376,7 @@ internal val allLoweringsPhase = NamedCompilerPhase(
testProcessorPhase,
enumClassPhase,
delegationPhase,
callableReferencePhase,
functionReferencePhase,
interopPhase,
varargPhase,
compileTimeEvaluatePhase,
@@ -42,7 +42,7 @@ import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.Variance
import org.jetbrains.kotlin.util.OperatorNameConventions
import org.jetbrains.kotlin.backend.konan.getObjCMethodInfo
import org.jetbrains.kotlin.backend.konan.lower.CallableReferenceLowering
import org.jetbrains.kotlin.backend.konan.lower.FunctionReferenceLowering
import org.jetbrains.kotlin.builtins.StandardNames
import org.jetbrains.kotlin.ir.descriptors.*
@@ -263,7 +263,7 @@ private fun <R> KotlinToCCallBuilder.handleArgumentForVarargParameter(
} else {
stubs.throwCompilerError(initializer, "unexpected initializer")
}
} else if (variable is IrValueParameter && CallableReferenceLowering.isLoweredCallableReference(variable)) {
} else if (variable is IrValueParameter && FunctionReferenceLowering.isLoweredFunctionReference(variable)) {
val location = variable.parent // Parameter itself has incorrect location.
val kind = if (this.isObjCMethod) "Objective-C methods" else "C functions"
stubs.reportError(location, "callable references to variadic $kind are not supported")
@@ -40,12 +40,12 @@ import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
internal class CallableReferenceLowering(val context: Context): FileLoweringPass {
internal class FunctionReferenceLowering(val context: Context): FileLoweringPass {
private object DECLARATION_ORIGIN_FUNCTION_REFERENCE_IMPL : IrDeclarationOriginImpl("FUNCTION_REFERENCE_IMPL")
companion object {
fun isLoweredCallableReference(declaration: IrDeclaration): Boolean =
fun isLoweredFunctionReference(declaration: IrDeclaration): Boolean =
declaration.origin == DECLARATION_ORIGIN_FUNCTION_REFERENCE_IMPL
}