[Commonizer] Remove filter for simd_ functions (no more relevant)
This commit is contained in:
-1
@@ -57,7 +57,6 @@ internal inline fun FunctionCollector(
|
|||||||
if (candidate.kind.isReal
|
if (candidate.kind.isReal
|
||||||
&& !candidate.isKniBridgeFunction()
|
&& !candidate.isKniBridgeFunction()
|
||||||
&& !candidate.isDeprecatedTopLevelFunction()
|
&& !candidate.isDeprecatedTopLevelFunction()
|
||||||
&& !candidate.isIgnoredDarwinFunction()
|
|
||||||
) {
|
) {
|
||||||
typedCollector(candidate)
|
typedCollector(candidate)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.descriptors.commonizer.utils
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
|
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
|
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
|
||||||
import org.jetbrains.kotlin.types.getAbbreviation
|
|
||||||
|
|
||||||
internal const val KNI_BRIDGE_FUNCTION_PREFIX = "kniBridge"
|
internal const val KNI_BRIDGE_FUNCTION_PREFIX = "kniBridge"
|
||||||
|
|
||||||
@@ -16,22 +15,3 @@ internal fun SimpleFunctionDescriptor.isKniBridgeFunction() =
|
|||||||
|
|
||||||
internal fun SimpleFunctionDescriptor.isDeprecatedTopLevelFunction() =
|
internal fun SimpleFunctionDescriptor.isDeprecatedTopLevelFunction() =
|
||||||
containingDeclaration is PackageFragmentDescriptor && annotations.hasAnnotation(DEPRECATED_ANNOTATION_FQN)
|
containingDeclaration is PackageFragmentDescriptor && annotations.hasAnnotation(DEPRECATED_ANNOTATION_FQN)
|
||||||
|
|
||||||
// the following logic determines Kotlin functions with conflicting overloads in Darwin library:
|
|
||||||
internal fun SimpleFunctionDescriptor.isIgnoredDarwinFunction(): Boolean {
|
|
||||||
if ((containingDeclaration as? PackageFragmentDescriptor)?.fqName?.isUnderDarwinPackage != true)
|
|
||||||
return false
|
|
||||||
|
|
||||||
val name = name.asString()
|
|
||||||
if (!name.startsWith("simd_") && !name.startsWith("__"))
|
|
||||||
return false
|
|
||||||
|
|
||||||
return valueParameters.any { parameter ->
|
|
||||||
val type = parameter.type
|
|
||||||
val abbreviationType = type.getAbbreviation()
|
|
||||||
|
|
||||||
abbreviationType != null
|
|
||||||
&& abbreviationType.declarationDescriptor.name.asString().startsWith("simd_")
|
|
||||||
&& type.declarationDescriptor.name.asString() == "Vector128"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ private val KOTLIN_NATIVE_SYNTHETIC_PACKAGES = ForwardDeclarationsFqNames.synthe
|
|||||||
}
|
}
|
||||||
|
|
||||||
private const val CINTEROP_PACKAGE = "kotlinx.cinterop"
|
private const val CINTEROP_PACKAGE = "kotlinx.cinterop"
|
||||||
private const val DARWIN_PACKAGE = "platform.darwin"
|
|
||||||
|
|
||||||
private val OBJC_INTEROP_CALLABLE_ANNOTATIONS = listOf(
|
private val OBJC_INTEROP_CALLABLE_ANNOTATIONS = listOf(
|
||||||
"ObjCMethod",
|
"ObjCMethod",
|
||||||
@@ -56,9 +55,6 @@ internal val FqName.isUnderStandardKotlinPackages: Boolean
|
|||||||
internal val FqName.isUnderKotlinNativeSyntheticPackages: Boolean
|
internal val FqName.isUnderKotlinNativeSyntheticPackages: Boolean
|
||||||
get() = hasAnyPrefix(KOTLIN_NATIVE_SYNTHETIC_PACKAGES)
|
get() = hasAnyPrefix(KOTLIN_NATIVE_SYNTHETIC_PACKAGES)
|
||||||
|
|
||||||
internal val FqName.isUnderDarwinPackage: Boolean
|
|
||||||
get() = asString().hasPrefix(DARWIN_PACKAGE)
|
|
||||||
|
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
private inline fun FqName.hasAnyPrefix(prefixes: List<String>): Boolean =
|
private inline fun FqName.hasAnyPrefix(prefixes: List<String>): Boolean =
|
||||||
asString().let { fqName -> prefixes.any(fqName::hasPrefix) }
|
asString().let { fqName -> prefixes.any(fqName::hasPrefix) }
|
||||||
|
|||||||
Reference in New Issue
Block a user