Save scope object during visiting function in code generator
This commit is contained in:
committed by
LepilkinaElena
parent
ee0159633c
commit
93df6c45ac
+9
-2
@@ -1940,8 +1940,15 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
|
||||
|
||||
//-------------------------------------------------------------------------//
|
||||
|
||||
private fun IrFunction.scope(): DIScopeOpaqueRef? = if (startOffset != UNDEFINED_OFFSET)
|
||||
this.scope(startLine()) else null
|
||||
// Saved calculated IrFunction scope which is used several time for getting locations and generating debug info.
|
||||
private var irFunctionSavedScope: Pair<IrFunction, DIScopeOpaqueRef?>? = null
|
||||
|
||||
private fun IrFunction.scope(): DIScopeOpaqueRef? = if (startOffset != UNDEFINED_OFFSET) (
|
||||
if (irFunctionSavedScope != null && this == irFunctionSavedScope!!.first)
|
||||
irFunctionSavedScope!!.second
|
||||
else
|
||||
this.scope(startLine()).also { irFunctionSavedScope = Pair(this, it) }
|
||||
) else null
|
||||
|
||||
private val IrFunction.isReifiedInline:Boolean
|
||||
get() = isInline && typeParameters.any { it.isReified }
|
||||
|
||||
Reference in New Issue
Block a user