Does something special need to be configured to ho...
# compiler
r
Does something special need to be configured to hook into the analysis phase on Native? Messing around with this sample https://github.com/nhachicha/sample-KMP-compiler-plugin/ and while the
IrGenerationExtension
in there runs fine on JVM and native, when I add a
AnalysisHandlerExtension
it's only being run on JVM.
👀 3
s
I don't think we have access to analysis handler on native You can use SyntheticResolve to add parts to classes or some checkers (DeclarationChecker, CallChecker) to run some inspections.
Also there is a SyntheticScopes thing which adds some descriptors on call resolution stage (i think). That one should also work on mpp iirc.
r
Ok good to know. A little surprising that you wouldn't have access to the analysis handler on native, since it seems like it should be doing platform-independent things, but I definitely don't have a good understanding of compiler internals so I should be careful making assumptions
s
Well, to be fair, your assumption should be true, but some of the compiler APIs were made to accommodate particular use cases. For example, analysis handler in question is tied to kapt and stubs generation, so not surprising to see it available on jvm only.
I think that stable and extensive compiler api is still not the main focus of the team for now. Afaik, they are reworking frontend for now, so maybe after we will get something like IrGenerationExtension but during analysis phase 🤷‍♂️
r
Yeah fair. Definitely playing with stuff way early at this point. Thanks for the insight.