<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 27, 2016 at 6:08 AM, kuebler via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
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).<br>
<br>
We tried to add keyword to Tokenkinds.def, but we have not really an idea to go on from there?<br>
<br>
Where else are changes needed to get an AST Node and transform it later to LLVM IR?</blockquote><div><br></div><div>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.</div><div><br></div><div>However, if you really do want to add new keywords and syntax, you should read <a href="http://clang.llvm.org/docs/InternalsManual.html#how-to-add-an-expression-or-statement">http://clang.llvm.org/docs/InternalsManual.html#how-to-add-an-expression-or-statement</a></div></div></div></div>