[IR] Drastically simplify the hierarchy of IR origins

IrStatementOriginImpl and IrDeclarationOriginImpl were made final
classes to simplify the creation of them (a delegate provider was
added) and to optimize performance when comparing the origins by type
and name
This commit is contained in:
Iaroslav Postovalov
2023-08-22 11:50:33 +02:00
committed by Space Team
parent f2ddae533e
commit a3b55cf758
67 changed files with 438 additions and 380 deletions
@@ -310,5 +310,7 @@ internal class WasmPropertyReferenceLowering(val context: WasmBackendContext) :
return type.classifier == expectedClass
}
private object DECLARATION_ORIGIN_KPROPERTIES_FOR_DELEGATION : IrDeclarationOriginImpl("KPROPERTIES_FOR_DELEGATION")
private companion object {
private val DECLARATION_ORIGIN_KPROPERTIES_FOR_DELEGATION = IrDeclarationOriginImpl("KPROPERTIES_FOR_DELEGATION")
}
}
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.ir.util.isElseBranch
import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
import org.jetbrains.kotlin.name.Name
private object OPTIMISED_WHEN_SUBJECT : IrDeclarationOriginImpl("OPTIMISED_WHEN_SUBJECT")
private val OPTIMISED_WHEN_SUBJECT by IrDeclarationOriginImpl
class WasmStringSwitchOptimizerLowering(
private val context: WasmBackendContext