[FIR] Unify some special names to make code more uniform
This commit is contained in:
+3
-3
@@ -49,9 +49,9 @@ FILE: arraySetWithOperation.kt
|
||||
}
|
||||
public final fun test_2(a: R|A<C>|): R|kotlin/Unit| {
|
||||
{
|
||||
lval <<array>>: R|A<C>| = R|<local>/a|
|
||||
lval <<index_0>>: R|kotlin/Int| = Int(0)
|
||||
R|<local>/<<array>>|.R|SubstitutionOverride</A.set: R|kotlin/Unit|>|(R|<local>/<<index_0>>|, R|<local>/<<array>>|.R|SubstitutionOverride</A.get: R|C|>|(R|<local>/<<index_0>>|).R|/C.plus|(R|/C.C|()))
|
||||
lval <array>: R|A<C>| = R|<local>/a|
|
||||
lval <index_0>: R|kotlin/Int| = Int(0)
|
||||
R|<local>/<array>|.R|SubstitutionOverride</A.set: R|kotlin/Unit|>|(R|<local>/<index_0>|, R|<local>/<array>|.R|SubstitutionOverride</A.get: R|C|>|(R|<local>/<index_0>|).R|/C.plus|(R|/C.C|()))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+10
-10
@@ -174,18 +174,18 @@ FILE: arraySetWithPlusAssign.kt
|
||||
}
|
||||
public final fun test_7(x: R|G|): R|kotlin/Unit| {
|
||||
{
|
||||
lval <<array>>: R|G| = R|<local>/x|
|
||||
lval <<index_0>>: R|kotlin/Int| = Int(1)
|
||||
lval <<index_1>>: R|kotlin/Int| = Int(2)
|
||||
lval <<index_2>>: R|kotlin/Int| = Int(3)
|
||||
R|<local>/<<array>>|.R|/G.set|(R|<local>/<<index_0>>|, R|<local>/<<index_1>>|, R|<local>/<<index_2>>|, R|<local>/<<array>>|.R|/G.get|(R|<local>/<<index_0>>|, R|<local>/<<index_1>>|, R|<local>/<<index_2>>|).R|/G.plus|(fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
|
||||
lval <array>: R|G| = R|<local>/x|
|
||||
lval <index_0>: R|kotlin/Int| = Int(1)
|
||||
lval <index_1>: R|kotlin/Int| = Int(2)
|
||||
lval <index_2>: R|kotlin/Int| = Int(3)
|
||||
R|<local>/<array>|.R|/G.set|(R|<local>/<index_0>|, R|<local>/<index_1>|, R|<local>/<index_2>|, R|<local>/<array>|.R|/G.get|(R|<local>/<index_0>|, R|<local>/<index_1>|, R|<local>/<index_2>|).R|/G.plus|(fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
|
||||
R|/someCallInsideLambda|()
|
||||
{
|
||||
lval <<array>>: R|G| = R|<local>/x|
|
||||
lval <<index_0>>: R|kotlin/Int| = Int(1)
|
||||
lval <<index_1>>: R|kotlin/Int| = Int(2)
|
||||
lval <<index_2>>: R|kotlin/Int| = Int(3)
|
||||
R|<local>/<<array>>|.R|/G.set|(R|<local>/<<index_0>>|, R|<local>/<<index_1>>|, R|<local>/<<index_2>>|, R|<local>/<<array>>|.R|/G.get|(R|<local>/<<index_0>>|, R|<local>/<<index_1>>|, R|<local>/<<index_2>>|).R|/G.plus|(fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
|
||||
lval <array>: R|G| = R|<local>/x|
|
||||
lval <index_0>: R|kotlin/Int| = Int(1)
|
||||
lval <index_1>: R|kotlin/Int| = Int(2)
|
||||
lval <index_2>: R|kotlin/Int| = Int(3)
|
||||
R|<local>/<array>|.R|/G.set|(R|<local>/<index_0>|, R|<local>/<index_1>|, R|<local>/<index_2>|, R|<local>/<array>|.R|/G.get|(R|<local>/<index_0>|, R|<local>/<index_1>|, R|<local>/<index_2>|).R|/G.plus|(fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
|
||||
R|/someCallInsideLambda|()
|
||||
Q|kotlin/Unit|
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ fun FirClass.findNonInterfaceSupertype(context: CheckerContext): FirTypeRef? {
|
||||
}
|
||||
|
||||
val FirFunctionCall.isIterator: Boolean
|
||||
get() = this.calleeReference.name.asString() == "<iterator>"
|
||||
get() = this.calleeReference.name == SpecialNames.ITERATOR
|
||||
|
||||
fun ConeKotlinType.isSubtypeOfThrowable(session: FirSession): Boolean =
|
||||
session.builtinTypes.throwableType.type.isSupertypeOf(session.typeContext, this.fullyExpandedType(session))
|
||||
|
||||
Vendored
+36
-36
@@ -20,45 +20,45 @@ FILE: safeCallsWithUnaryOperators.kt
|
||||
R|<local>/<unary>|
|
||||
a#?.{ {
|
||||
lval <array>: <implicit> = $subj$.b#
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary>|.inc#())
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary>|.inc#())
|
||||
R|<local>/<unary>|
|
||||
}
|
||||
}
|
||||
a#?.{ $subj$.b# }?.{ {
|
||||
lval <array>: <implicit> = $subj$.c#
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary>|.inc#())
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary>|.inc#())
|
||||
R|<local>/<unary>|
|
||||
}
|
||||
}
|
||||
lval <array>: <implicit> = a#?.{ $subj$.b# }.c#
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary>|.inc#())
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary>|.inc#())
|
||||
R|<local>/<unary>|
|
||||
a#?.{ {
|
||||
lval <array>: <implicit> = $subj$.b#.get#(IntegerLiteral(0))
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary>|.inc#())
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary>|.inc#())
|
||||
R|<local>/<unary>|
|
||||
}
|
||||
}
|
||||
a#?.{ $subj$.b# }?.{ {
|
||||
lval <array>: <implicit> = $subj$.c#.get#(IntegerLiteral(0))
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary>|.inc#())
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary>|.inc#())
|
||||
R|<local>/<unary>|
|
||||
}
|
||||
}
|
||||
lval <array>: <implicit> = a#?.{ $subj$.b# }.c#.get#(IntegerLiteral(0))
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary>|.inc#())
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary>|.inc#())
|
||||
R|<local>/<unary>|
|
||||
lval <receiver>: <implicit> = a#?.{ $subj$.b# }
|
||||
lval <unary>: <implicit> = R|<local>/<receiver>|.d#()
|
||||
@@ -86,45 +86,45 @@ FILE: safeCallsWithUnaryOperators.kt
|
||||
R|<local>/<unary-result>|
|
||||
a#?.{ {
|
||||
lval <array>: <implicit> = $subj$.b#
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary-result>|)
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary-result>|)
|
||||
R|<local>/<unary-result>|
|
||||
}
|
||||
}
|
||||
a#?.{ $subj$.b# }?.{ {
|
||||
lval <array>: <implicit> = $subj$.c#
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary-result>|)
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary-result>|)
|
||||
R|<local>/<unary-result>|
|
||||
}
|
||||
}
|
||||
lval <array>: <implicit> = a#?.{ $subj$.b# }.c#
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary-result>|)
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary-result>|)
|
||||
R|<local>/<unary-result>|
|
||||
a#?.{ {
|
||||
lval <array>: <implicit> = $subj$.b#.get#(IntegerLiteral(0))
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary-result>|)
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary-result>|)
|
||||
R|<local>/<unary-result>|
|
||||
}
|
||||
}
|
||||
a#?.{ $subj$.b# }?.{ {
|
||||
lval <array>: <implicit> = $subj$.c#.get#(IntegerLiteral(0))
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary-result>|)
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary-result>|)
|
||||
R|<local>/<unary-result>|
|
||||
}
|
||||
}
|
||||
lval <array>: <implicit> = a#?.{ $subj$.b# }.c#.get#(IntegerLiteral(0))
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary-result>|)
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary-result>|)
|
||||
R|<local>/<unary-result>|
|
||||
lval <receiver>: <implicit> = a#?.{ $subj$.b# }
|
||||
lval <unary-result>: <implicit> = R|<local>/<receiver>|.d#().inc#()
|
||||
|
||||
@@ -58,17 +58,17 @@ FILE: unary.kt
|
||||
public? final? fun test3(arr: Array<Int>): R|kotlin/Unit| {
|
||||
lval x1: <implicit> = {
|
||||
lval <array>: <implicit> = arr#
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary>|.inc#())
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary>|.inc#())
|
||||
R|<local>/<unary>|
|
||||
}
|
||||
|
||||
lval x2: <implicit> = {
|
||||
lval <array>: <implicit> = arr#
|
||||
lval <index0>: <implicit> = IntegerLiteral(1)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary-result>|)
|
||||
lval <index_0>: <implicit> = IntegerLiteral(1)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary-result>|)
|
||||
R|<local>/<unary-result>|
|
||||
}
|
||||
|
||||
@@ -85,17 +85,17 @@ FILE: unary.kt
|
||||
public? final? fun test4(y: Y): R|kotlin/Unit| {
|
||||
lval x1: <implicit> = {
|
||||
lval <array>: <implicit> = y#.arr#
|
||||
lval <index0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary>|.inc#())
|
||||
lval <index_0>: <implicit> = IntegerLiteral(0)
|
||||
lval <unary>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|)
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary>|.inc#())
|
||||
R|<local>/<unary>|
|
||||
}
|
||||
|
||||
lval x2: <implicit> = {
|
||||
lval <array>: <implicit> = y#.arr#
|
||||
lval <index0>: <implicit> = IntegerLiteral(1)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index0>|, R|<local>/<unary-result>|)
|
||||
lval <index_0>: <implicit> = IntegerLiteral(1)
|
||||
lval <unary-result>: <implicit> = R|<local>/<array>|.get#(R|<local>/<index_0>|).inc#()
|
||||
R|<local>/<array>|.set#(R|<local>/<index_0>|, R|<local>/<unary-result>|)
|
||||
R|<local>/<unary-result>|
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -715,7 +715,7 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
|
||||
val argumentReceiverVariable = generateTemporaryVariable(
|
||||
baseModuleData,
|
||||
argumentReceiver?.toFirSourceElement(),
|
||||
Name.special("<receiver>"),
|
||||
SpecialNames.RECEIVER,
|
||||
initializer = receiverFir,
|
||||
).also { statements += it }
|
||||
|
||||
@@ -795,7 +795,7 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
|
||||
val arrayVariable = generateTemporaryVariable(
|
||||
baseModuleData,
|
||||
array?.toFirSourceElement(),
|
||||
Name.special("<array>"),
|
||||
name = SpecialNames.ARRAY,
|
||||
initializer = arrayReceiver,
|
||||
).also { statements += it }
|
||||
|
||||
@@ -803,7 +803,7 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
|
||||
generateTemporaryVariable(
|
||||
baseModuleData,
|
||||
index.toFirSourceElement(),
|
||||
Name.special("<index$i>"),
|
||||
name = SpecialNames.subscribeOperatorIndex(i),
|
||||
index.convert()
|
||||
).also { statements += it }
|
||||
}
|
||||
|
||||
+3
-2
@@ -44,6 +44,7 @@ import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
||||
import org.jetbrains.kotlin.fir.visitors.TransformData
|
||||
import org.jetbrains.kotlin.fir.visitors.transformSingle
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.name.SpecialNames
|
||||
import org.jetbrains.kotlin.name.StandardClassIds
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.buildAbstractResultingSubstitutor
|
||||
import org.jetbrains.kotlin.types.AbstractTypeChecker
|
||||
@@ -1304,7 +1305,7 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform
|
||||
val arrayVariable = generateTemporaryVariable(
|
||||
session.moduleData,
|
||||
source = lhsGetCall.explicitReceiver?.source?.fakeElement(KtFakeSourceElementKind.DesugaredCompoundAssignment),
|
||||
specialName = "<array>",
|
||||
name = SpecialNames.ARRAY,
|
||||
initializer = lhsGetCall.explicitReceiver ?: buildErrorExpression {
|
||||
source = augmentedArraySetCall.source
|
||||
?.fakeElement(KtFakeSourceElementKind.DesugaredCompoundAssignment)
|
||||
@@ -1321,7 +1322,7 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform
|
||||
generateTemporaryVariable(
|
||||
session.moduleData,
|
||||
source = index.source?.fakeElement(KtFakeSourceElementKind.DesugaredCompoundAssignment),
|
||||
specialName = "<index_$i>",
|
||||
name = SpecialNames.subscribeOperatorIndex(i),
|
||||
initializer = index
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user