Join Slack
Powered by
Hi all, assuming I want to inspect (no transformat...
# compiler
n
Nick Chong
08/17/2024, 6:49 AM
Hi all, assuming I want to inspect (no transformation) IrCall and its parent IrElements. Right now I am using IrElementVisitor but from what I understand, the visitor visits top(eg. module/file)-down(IrElement). Just for reference in the project I am working on:
https://github.com/nicchongwb/kotlin-jooq-checker/blob/main/kotlin-ir-plugin/src/main/kotlin/com/nicchongwb/plugins/PlainSqlCheckerVisitor.kt
Are there any other visitors that I can use to inspect IrCall immediately and also check its parent node meta information?
p
PHondogo
08/17/2024, 8:27 AM
IrElementTransformerVoidWithContext
PHondogo
08/17/2024, 8:28 AM
currentDeclarationParent
PHondogo
08/17/2024, 8:38 AM
I don't renember if it has track of nested expressions. If not you can handle it by yourself by creating stack and put on it expressions while visiting them. You can see how it can be implemented in above visitor.
👍 1
13
Views
Open in Slack
Previous
Next