Can Clang Plugin generate AST node? (original) (raw)

We are using clang20, it has an OpenACC solution but it is far away to be available. We wanna migrate clacc to clang20, but it will conflict. Is it possible to move clacc’s openacc parser to clang plugin?

I don’t really see how the plugin system could work like that. You’re right that conflicts between clacc and the current OpenACC implementation would be sizable…

As a status, at the moment, the OpenACC implementation has started lowering a handful of constructs and clauses to ClangIR, having completed the parsing/semantic analysis.

However, the amount of CIR that has been upstreamed is pretty small, which currently makes using most programs not really possible. Additionally, the OpenACC dialect doesn’t have any lowering to LLVM-IR, which needs to happen before an OpenACC application is usable. You’re welcome to help contribute to either of those efforts if you’d like to speed the process along! Let me know and I can get you(whoever ‘we’ is) together with the folks in charge of each effort.

The migration of Clacc to LLVM main would take quite a lot of work. We do not currently have sufficient funding to keep up.

In my experience, the parser has been one of the least conflicting parts of Clacc during merges from LLVM main. I do not think trying to separate it out is the solution.

I would be interested to hear more about your plans. Feel free to contact me privately if you prefer. My email address is in the README of the repo you linked.