[descriptors] Move some annotation-related utilities to the core module

- AnnotationDescriptor#argumentValue is not frontend-specific
- AnnotationDescriptor#getAnnotationStringValue is not Native-specific

We are going to need these functions in the IR code, so it makes
sense to factor them out to the core module.
This commit is contained in:
Sergej Jaskiewicz
2023-08-22 20:27:53 +02:00
committed by teamcity
parent 56cb0bf071
commit dff2d2ed60
8 changed files with 47 additions and 26 deletions
@@ -33,9 +33,8 @@ fun DeclarationDescriptor.hasJvmStaticAnnotation(): Boolean {
return annotations.findAnnotation(JVM_STATIC_ANNOTATION_FQ_NAME) != null
}
fun AnnotationDescriptor.argumentValue(parameterName: String): ConstantValue<*>? {
return allValueArguments[Name.identifier(parameterName)].takeUnless { it is ErrorValue }
}
@Deprecated("Moved to the ':core:descriptors' module", level = DeprecationLevel.HIDDEN)
fun AnnotationDescriptor.argumentValue(parameterName: String): ConstantValue<*>? = argumentValue(parameterName)
@Deprecated(
"Use org.jetbrains.kotlin.load.java.JvmAbi.JVM_FIELD_ANNOTATION_FQ_NAME or " +