From 1794f0863871ee80e3c47bc9d1b9b630d1c23c50 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Fri, 14 Sep 2018 17:00:45 +0300 Subject: [PATCH] Fix @Retain annotation behavior. (#2068) --- Interop/JsRuntime/src/main/kotlin/jsinterop.kt | 4 +--- .../org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt | 2 +- .../konan/llvm/{UsedAnnotation.kt => RetainAnnotation.kt} | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) rename backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/{UsedAnnotation.kt => RetainAnnotation.kt} (79%) diff --git a/Interop/JsRuntime/src/main/kotlin/jsinterop.kt b/Interop/JsRuntime/src/main/kotlin/jsinterop.kt index feb92373d28..7eee3eb0967 100644 --- a/Interop/JsRuntime/src/main/kotlin/jsinterop.kt +++ b/Interop/JsRuntime/src/main/kotlin/jsinterop.kt @@ -25,10 +25,8 @@ typealias Object = Int typealias Pointer = Int /** - * Used annotation is required to preserve functions - * from internalization and DCE + * @Retain annotation is required to preserve functions from internalization and DCE. */ - @Retain @SymbolName("Konan_js_allocateArena") external public fun allocateArena(): Arena diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt index 1f68e807d78..80930d2bf2c 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt @@ -738,7 +738,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map