vgvassilev wrote: > > do you use a plugin to swap clang's CodeGen > > We swap LLVM's CodeGen (the machine code generation part), but want to keep > Clang's CodeGen (the part that generates LLVM IR and optimizes that). We want > the front-end and middle-end optimizations to behave as usual and only > replace the back-end with our own back-end. > > > why the standard plugin system does not work well there? > > The standard front-end plugins permit replacing, e.g., the CodeGenAction with > something else. But we do want Clang's CodeGen to work normally. > CodeGenAction and emitBackendOutput are very inflexible; adding a custom > back-end through a PluginASTAction would essentially require us to copy large > parts of CodeGenAction.cpp and BackendUtil.cpp, which is not maintainable.
Would it make more sense to make the CodeGenAction and emitBackendOutput more flexible? Maybe checking if the `BackendAction` kind is plugin we can give back the control to the frontend plugin code... It would be great to enhance the existing clang plugin system rather than adding a new plugin extension point. cc: @lhames. https://github.com/llvm/llvm-project/pull/165257 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
