From 5529713ebe5966e8c7683fa0af28f7fec3a23245 Mon Sep 17 00:00:00 2001 From: Pavel Kunyavskiy Date: Wed, 25 Aug 2021 12:45:28 +0300 Subject: [PATCH] [K/N] Fix debug info in lazy initializers --- .../org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt | 4 ++-- .../org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 5fcf0800390..b4c2b6c95b3 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 @@ -123,8 +123,8 @@ val LLVMValueRef.isConst:Boolean internal inline fun generateFunction(codegen: CodeGenerator, function: IrFunction, - startLocation: LocationInfo? = null, - endLocation: LocationInfo? = null, + startLocation: LocationInfo?, + endLocation: LocationInfo?, code: FunctionGenerationContext.(FunctionGenerationContext) -> R) { val llvmFunction = codegen.llvmFunction(function) 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 6d62568240d..6a8d36b0ea6 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 @@ -370,7 +370,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map - generateFunction(codegen, fileInitFunction, null, null) { + generateFunction(codegen, fileInitFunction, fileInitFunction.location(start = true), fileInitFunction.location(start = false)) { using(FunctionScope(fileInitFunction, it)) { val parameterScope = ParameterScope(fileInitFunction, functionGenerationContext) using(parameterScope) usingParameterScope@{ @@ -387,7 +387,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map - generateFunction(codegen, fileInitFunction, null, null) { + generateFunction(codegen, fileInitFunction, fileInitFunction.location(start = true), fileInitFunction.location(start = false)) { using(FunctionScope(fileInitFunction, it)) { val parameterScope = ParameterScope(fileInitFunction, functionGenerationContext) using(parameterScope) usingParameterScope@{