I want to develop a hook that will only modify the AST as an intermediate step, handing off the modified AST for the next pipeline stages (codegen, etc.). I thought that plugins were the way to go but I found that when using them Clang simply yields control of the pipeline to them, meaning further stages are not run and the execution of the plugin is the last one. Is this understanding correct?
If so, how can I execute a plugin as a simple hook in the whole process which modifies the in-memory AST before code generation?
Or, how can I trigger codegen inside my plugin if the above is not possible?
Any other ideas are welcome, possibly I’m doing things at the wrong place.