I would think clang would be more appropriate for adding a c-declaration descriptor. However, assuming that no translation down to llvm exists, you would need to create the information as either metadata (preferred) or as a new type (ugly and time consuming). If you can keep it as metadata, then some later passes may gather that meta-data and execute properly. A new type requires much in the way of hacking other passes to inform them what to do upon seeing the new type. <div>
<br></div><div>- My 2 cents,</div><div>Jeff Kunkel<br><br><div class="gmail_quote">On Fri, Jan 21, 2011 at 10:32 AM, Aaron Myles Landwehr <span dir="ltr"><<a href="mailto:snaphat@gmail.com">snaphat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,
<div><br></div><div>Hypothetically, suppose I have a generic system with multiple address spaces such that each address space is accessed using different instructions.</div><div><br></div><div>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:</div>
<div><br></div><div>foo void* a;</div><div>foo void* somefunc(){...}</div><div><div>bar int b;</div><div>int somefunc2(bar int*){...}</div></div><div><br></div><div>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?</div>
<div><br></div><div>More Info: suppose this uses clang as a frontend.</div><div><br></div><div>Thanks,</div><div>Aaron Landwehr</div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>