Skip to content

Commit 882dc18

Browse files
kunyavskiySpace Team
authored and
Space Team
committed
[IrActualizer] Don't copy attributeOwnerId in actualizer
In before, actualizer was copying attributeOwnerId to new nodes. This leads to attributeOwnerId linked to non-actualized node. It's unclear what it leads to, so we just stop doing that. In particular, if attributeOwnerId references another node, this information would be lost. ^KT-64895
1 parent e49b28d commit 882dc18

File tree

13 files changed

+131
-44
lines changed

13 files changed

+131
-44
lines changed

analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/ir/ir.actualization/src/main/kotlin/org/jetbrains/kotlin/backend/common/actualizer/ExpectActualLinker.kt

+5
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ internal class ActualizerSymbolRemapper(private val expectActualMap: Map<IrSymbo
7575

7676
internal open class ActualizerVisitor(private val symbolRemapper: SymbolRemapper, typeRemapper: TypeRemapper) :
7777
DeepCopyIrTreeWithSymbols(symbolRemapper, typeRemapper, SymbolRenamer.DEFAULT) {
78+
79+
// We shouldn't touch attributes, because Fir2Ir wouldn't set them to anything meaningful anyway.
80+
// So it would be better to have them as is, i.e. referring to `this`, not some random node removed from the tree
81+
override fun <D : IrAttributeContainer> D.processAttributes(other: IrAttributeContainer?): D = this
82+
7883
override fun visitModuleFragment(declaration: IrModuleFragment) =
7984
declaration.also { it.transformChildren(this, null) }
8085

0 commit comments

Comments
 (0)