Open krzema12 opened 2 years ago
Thanks to the below snippet I was able to generate a dependency diagram of lowerings:
(to be pasted in compiler/ir/backend.py/src/org/jetbrains/kotlin/ir/backend/py/JsLoweringPhases.kt
)
fun main() {
println("@startuml")
println("skinparam componentStyle rectangle")
println("left to right direction")
loweringList.forEach { lowering ->
println("component \"${lowering.modulePhase.name}\"")
lowering.modulePhase.prerequisite.forEach { prerequisite ->
println("component \"${prerequisite.name}\"")
println("[${lowering.modulePhase.name}] --> [${prerequisite.name}]")
}
}
println("@enduml")
}
The generated code can be rendered with any PlantUML renderer, e.g. http://www.plantuml.com/
Lowerings are a big part of backend logic, so let's ensure we know what happens there and that we don't have anything surplus or weird.
95