David Coronel
06/25/2025, 5:06 PM.kt
file using Kotlin Poet during the FIR stage - for example, inside a FirFunctionCallChecker- and include it in the build source sets?jw
06/25/2025, 6:01 PMhfhbd
06/25/2025, 7:36 PMDavid Coronel
06/25/2025, 7:53 PM.kt
file with Kotlin Poet, which isn’t recognized in the source set and causes the initial build to fail (though a second build recognizes the generated file because it already exists).
• Creating a function declaration in the FIR stage using FirDeclarationGenerationExtension
, then implementing the function body during the IR stage using AbstractTransformerForGenerator
. However, this approach produces generated code that’s less transparent than a .kt
file, making it harder to view the content easily. Additionally, we face challenges passing information from FIR to IR—*how can we facilitate communication between them?*David Coronel
06/25/2025, 7:56 PMhfhbd
06/25/2025, 7:59 PMhfhbd
06/25/2025, 8:00 PMhfhbd
06/25/2025, 8:03 PMDavid Coronel
06/25/2025, 8:18 PMFirAdditionalCheckersExtension
but I don't know how to pass the Strings obtained during FIR, to the IrGenerationExtension
that generates the codeDavid Coronel
06/25/2025, 8:19 PMTóth István Zoltán
06/26/2025, 9:11 AMbnorm
07/01/2025, 12:03 PMFirExtensionRegistrar
and IrGenerationExtension
since you have to manually create both in the plugin registrar and can pass them constructor parameters.