[IR] Move coroutine-related helpers to a more appropriate place
The `isBuiltInSuspendCoroutine` and `isBuiltInSuspendCoroutineUninterceptedOrReturn` helpers are not inherently related to function inlining.
This commit is contained in:
committed by
Space Team
parent
919abe483a
commit
acee8da283
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.util
|
||||
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.ir.*
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
@@ -324,3 +325,12 @@ fun IrClassSymbol.getPropertySetter(name: String): IrSimpleFunctionSymbol? = own
|
||||
fun filterOutAnnotations(fqName: FqName, annotations: List<IrConstructorCall>): List<IrConstructorCall> {
|
||||
return annotations.filterNot { it.annotationClass.hasEqualFqName(fqName) }
|
||||
}
|
||||
|
||||
fun IrFunction.isBuiltInSuspendCoroutine(): Boolean =
|
||||
isTopLevelInPackage("suspendCoroutine", StandardNames.COROUTINES_PACKAGE_FQ_NAME)
|
||||
|
||||
fun IrFunction.isBuiltInSuspendCoroutineUninterceptedOrReturn(): Boolean =
|
||||
isTopLevelInPackage(
|
||||
"suspendCoroutineUninterceptedOrReturn",
|
||||
StandardNames.COROUTINES_INTRINSICS_PACKAGE_FQ_NAME
|
||||
)
|
||||
Reference in New Issue
Block a user