[IR] Combine IrInterpreterNameCheck with common one

This way we achieve faster compilation time. We want to traverse
IR tree as little as possible. If we add new checker than the time
to evaluate constants basically doubles.

#KT-58923
This commit is contained in:
Ivan Kylchik
2023-05-25 01:38:29 +02:00
committed by Space Team
parent e5ed1714d1
commit 8067df3c94
6 changed files with 50 additions and 80 deletions
@@ -15,7 +15,7 @@ const val methodName = A::foo.<!EVALUATED("foo")!>name<!>
const val suspendMethodName = A::bar.<!EVALUATED("bar")!>name<!>
const val className = ::A.<!EVALUATED("<init>")!>name<!>
const val topLevelPropName = ::topLevelProp.<!EVALUATED("topLevelProp")!>name<!>
const val nameInComplexExpression = A::OK.<!EVALUATED("OK")!>name<!> <!EVALUATED("OK!")!>+ "!"<!>
const val nameInComplexExpression = A::OK.name <!EVALUATED("OK!")!>+ "!"<!>
// STOP_EVALUATION_CHECKS
fun box(): String {
@@ -27,7 +27,7 @@ class A {
val insideStringConcat = "${temp::b.<!EVALUATED("b")!>name<!>}"
val complexExpression1 = A()::a.<!EVALUATED("a")!>name<!> + A()::b.<!EVALUATED("b")!>name<!>
val complexExpression2 = A::a.<!EVALUATED("a")!>name<!> <!EVALUATED("ab")!>+ A::b.<!EVALUATED("b")!>name<!><!>
val complexExpression2 = A::a.name <!EVALUATED("ab")!>+ A::b.name<!>
var recursive = ::test.<!EVALUATED("test")!>name<!>
}