Extending Clang with new keywords

my name is Timo and I am part of a project group at the University of Paderborn (Germany). The goal of our pg is to create an approximate cpu. We currently trying to extend Clang with some new keywords. Our idea is to introduce some keywords, so that Clang produces new LLVM IR Code (our approximate instructions).

We tried to add keyword to Tokenkinds.def, but we have not really an idea to go on from there?

Where else are changes needed to get an AST Node and transform it later to LLVM IR?


The first thing to decide is whether you really need new keywords at all.
We typically expose custom machine instructions as builtin functions, not
with keywords, and doing so is much simpler than adding new keywords,
grammar productions, AST nodes, semantic analysis and so on.

However, if you really do want to add new keywords and syntax, you should