[LLVMdev] How to extend llvm IR and frontend?

Aaron Myles Landwehr snaphat at gmail.com
Fri Jan 21 07:32:13 PST 2011


Hi all,

Hypothetically, suppose I have a generic system with multiple address spaces
such that each address space is accessed using different instructions.

Now suppose, I wanted to add a new keywords 'foo' and 'bar' to the front of
c variables and function return types such that the following would be
valid:

foo void* a;
foo void* somefunc(){...}
bar int b;
int somefunc2(bar int*){...}

Furthermore, if I wanted this keyword to be added as part of the LLVM IR in
some manner such that the during the translation of LLVM IR to some target
machine ASM it could be used to switch which address spaces are used (e.g.
if I specify one of the keywords, I get some instruction or group of
instructions to access a certain address space), what would be the
correct/easiest place(s) to add this functionality, and would there be
existing code that does something similar that can be used as a starting
point?

More Info: suppose this uses clang as a frontend.

Thanks,
Aaron Landwehr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110121/d96c0631/attachment.html>


More information about the llvm-dev mailing list