From a2d8e2435fbd93e52ee047d8e0dbf61adf945dd9 Mon Sep 17 00:00:00 2001 From: Leonid Startsev Date: Fri, 13 Dec 2019 15:27:49 +0300 Subject: [PATCH] Reorder steps in psi2ir so postprocessing goes before unbound symbols stub generating This is required because currently IR compiler plugins are launched during 'postprocess' step and for correct work they require unbound symbols for plugin-provided declarations (see commit message of 3e18350a for detailed explanation) --- .../src/org/jetbrains/kotlin/psi2ir/Psi2IrTranslator.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/Psi2IrTranslator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/Psi2IrTranslator.kt index d1c9d47faf5..ca1b188eff4 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/Psi2IrTranslator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/Psi2IrTranslator.kt @@ -73,9 +73,11 @@ class Psi2IrTranslator( val moduleGenerator = ModuleGenerator(context) val irModule = moduleGenerator.generateModuleFragmentWithoutDependencies(ktFiles) - moduleGenerator.generateUnboundSymbolsAsDependencies(irProviders) irModule.patchDeclarationParents() postprocess(context, irModule) + // do not generate unbound symbols before postprocessing, + // since plugins must work with non-lazy IR + moduleGenerator.generateUnboundSymbolsAsDependencies(irProviders) irModule.computeUniqIdForDeclarations(context.symbolTable) moduleGenerator.generateUnboundSymbolsAsDependencies(irProviders)