JVM_IR: Remove $$forInline suffix for fake inliner variables
Otherwise, IDE will not be able to navigate to inline functions. #KT-36797 Fixed
This commit is contained in:
+3
-1
@@ -10,6 +10,7 @@ import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
|
|||||||
import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase
|
import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase
|
||||||
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
||||||
import org.jetbrains.kotlin.backend.jvm.ir.IrInlineReferenceLocator
|
import org.jetbrains.kotlin.backend.jvm.ir.IrInlineReferenceLocator
|
||||||
|
import org.jetbrains.kotlin.codegen.inline.coroutines.FOR_INLINE_SUFFIX
|
||||||
import org.jetbrains.kotlin.ir.builders.createTmpVariable
|
import org.jetbrains.kotlin.ir.builders.createTmpVariable
|
||||||
import org.jetbrains.kotlin.ir.builders.irBlockBody
|
import org.jetbrains.kotlin.ir.builders.irBlockBody
|
||||||
import org.jetbrains.kotlin.ir.builders.irInt
|
import org.jetbrains.kotlin.ir.builders.irInt
|
||||||
@@ -61,7 +62,8 @@ internal class FakeInliningLocalVariablesLowering(val context: JvmBackendContext
|
|||||||
body = irBlockBody {
|
body = irBlockBody {
|
||||||
// Create temporary variable, but make sure it's origin is `DEFINED` so that
|
// Create temporary variable, but make sure it's origin is `DEFINED` so that
|
||||||
// it will materialize in the code.
|
// it will materialize in the code.
|
||||||
createTmpVariable(irInt(0), name, origin = IrDeclarationOrigin.DEFINED)
|
// Also, do not forget to remove $$forInline suffix, otherwise, IDE will not be able to navigate to inline function.
|
||||||
|
createTmpVariable(irInt(0), name.removeSuffix(FOR_INLINE_SUFFIX), origin = IrDeclarationOrigin.DEFINED)
|
||||||
if (body is IrExpressionBody) {
|
if (body is IrExpressionBody) {
|
||||||
+irReturn((body as IrExpressionBody).expression)
|
+irReturn((body as IrExpressionBody).expression)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
-3
@@ -1,6 +1,3 @@
|
|||||||
// $$forInline suffix is not needed: KT-36797
|
|
||||||
// JVM_IR generates fake inliner variable with suffix $$forInline, when old BE does not do this
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
interface ApplicationCall
|
interface ApplicationCall
|
||||||
|
|
||||||
interface AuthenticationService {
|
interface AuthenticationService {
|
||||||
|
|||||||
Reference in New Issue
Block a user