Kotlin: Move useFunctionCommon

This commit is contained in:
Ian Lynagh
2022-06-23 17:59:28 +01:00
parent 298f4ab899
commit ab19d8c3c3

View File

@@ -1146,15 +1146,6 @@ open class KotlinUsesExtractor(
return res
}
fun <T: DbCallable> useFunctionCommon(f: IrFunction, label: String): Label<out T> {
val id: Label<T> = tw.getLabelFor(label)
if (isExternalDeclaration(f)) {
extractFunctionLaterIfExternalFileMember(f)
extractExternalEnclosingClassLater(f)
}
return id
}
// These are classes with Java equivalents, but whose methods don't all exist on those Java equivalents--
// for example, the numeric classes define arithmetic functions (Int.plus, Long.or and so on) that lower to
// primitive arithmetic on the JVM, but which we extract as calls to reflect the source syntax more closely.
@@ -1224,6 +1215,15 @@ open class KotlinUsesExtractor(
useFunctionCommon<T>(it, getFunctionLabel(it, parentId, classTypeArgsIncludingOuterClasses))
}
private fun <T: DbCallable> useFunctionCommon(f: IrFunction, label: String): Label<out T> {
val id: Label<T> = tw.getLabelFor(label)
if (isExternalDeclaration(f)) {
extractFunctionLaterIfExternalFileMember(f)
extractExternalEnclosingClassLater(f)
}
return id
}
fun getTypeArgumentLabel(
arg: IrTypeArgument
): TypeResult<DbReftype> {