From b2983850b698e3bdca4dbba945c2a0d3ad7ab385 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Wed, 30 Nov 2016 15:36:30 +0300 Subject: [PATCH] Moved Konan specific annotation "@Used" to "konan" package. --- .../jetbrains/kotlin/backend/konan/llvm/KonanPlatform.kt | 3 ++- .../jetbrains/kotlin/backend/konan/llvm/UsedAnnotation.kt | 2 +- runtime/src/main/kotlin/konan/Annotations.kt | 7 +++++++ runtime/src/main/kotlin/kotlin/Annotations.kt | 5 ----- 4 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 runtime/src/main/kotlin/konan/Annotations.kt diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/KonanPlatform.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/KonanPlatform.kt index 2dea8a8bf6f..89b272b3b16 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/KonanPlatform.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/KonanPlatform.kt @@ -36,7 +36,8 @@ class KonanBuiltIns: KotlinBuiltIns { object KonanPlatform : TargetPlatform("Konan") { override val defaultImports: List = Default.defaultImports + listOf( ImportPath("kotlin.*"), - ImportPath("kotlin.io.*") + ImportPath("kotlin.io.*"), + ImportPath("konan.*") ) override val platformConfigurator: PlatformConfigurator = KonanPlatformConfigurator diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/UsedAnnotation.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/UsedAnnotation.kt index de15a909460..c1299459e05 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/UsedAnnotation.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/UsedAnnotation.kt @@ -4,7 +4,7 @@ import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.descriptors.annotations.* import org.jetbrains.kotlin.name.FqName -private val annotationName = FqName("kotlin.Used") +private val annotationName = FqName("konan.Used") internal val FunctionDescriptor.usedAnnotation: Boolean get() { diff --git a/runtime/src/main/kotlin/konan/Annotations.kt b/runtime/src/main/kotlin/konan/Annotations.kt new file mode 100644 index 00000000000..59002456966 --- /dev/null +++ b/runtime/src/main/kotlin/konan/Annotations.kt @@ -0,0 +1,7 @@ +package konan + +/** + * Preserve the function entry point during global optimizations + */ +public annotation class Used + diff --git a/runtime/src/main/kotlin/kotlin/Annotations.kt b/runtime/src/main/kotlin/kotlin/Annotations.kt index 82051fca6aa..15ee8fc93c2 100644 --- a/runtime/src/main/kotlin/kotlin/Annotations.kt +++ b/runtime/src/main/kotlin/kotlin/Annotations.kt @@ -36,8 +36,3 @@ public annotation class Suppress(vararg val names: String) //@MustBeDocumented public annotation class UnsafeVariance -/** - * Preserve the function entry point during global optimizations - */ -public annotation class Used -