Is there anything special that needs to be done to...
# arrow-meta
d
Is there anything special that needs to be done to get hooks into the IR phase to work? I've tried to create a CliPlugin that hooks into IRGeneration, and I can see the getter being called as it's added to the registry, but the
generate()
function is never called by the compiler (sample code in comment).
Copy code
val Meta.configProviderGenerator: CliPlugin
    get() = "quote thing" {
        listOf(object : IRGeneration {
            override fun CompilerContext.generate(moduleFragment: IrModuleFragment, pluginContext: IrPluginContext) {
                val a = 1 + 1 // do something so a breakpoint is settable
            }
        })
    }
r
either what @kralli said or enable ir as a compiler flag from the command line
d
Hm, I'll give that a try, I thought I had enabled it from the command line, but it was through compile-testing so maybe it didn't stick.
r
If you use enableIR() as phase in your meta plugin that overrides any command line args