diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt index 1e03d59409c..c9c7e571bf1 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt @@ -520,6 +520,15 @@ internal abstract class FunctionGenerationContext( return result } + /** + * This function shouldn't be used normally. + * It is used to move block with strange debug info in the middle of function, to avoid last debug info being too strange, + * because it will break heuristics in CoreSymbolication + */ + fun moveBlockAfterEntry(block: LLVMBasicBlockRef) { + LLVMMoveBasicBlockAfter(block, this.entryBb) + } + fun alloca(type: LLVMTypeRef?, name: String = "", variableLocation: VariableDebugLocation? = null): LLVMValueRef { if (isObjectType(type!!)) { appendingTo(localsInitBb) { diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt index 2d4742308e7..98356767689 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt @@ -2378,6 +2378,8 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map