IR: pass information about the declaration being lowered to the infrastructure

This commit is contained in:
Anton Bannykh
2021-07-06 17:30:18 +03:00
committed by teamcityserver
parent 5ee865437d
commit 002f4210f7
@@ -150,11 +150,14 @@ private class BodyLoweringVisitor(
override fun visitBody(body: IrBody, data: IrDeclaration?) {
if (withLocalDeclarations) body.acceptChildren(this, null)
if (allowDeclarationModification) {
loweringPass.lower(body, data!!)
} else {
data!!.factory.stageController.bodyLowering {
val stageController = data!!.factory.stageController
stageController.restrictTo(data) {
if (allowDeclarationModification) {
loweringPass.lower(body, data)
} else {
stageController.bodyLowering {
loweringPass.lower(body, data)
}
}
}
}