<div dir="ltr">LLVM IR isn't portable, and you will need to teach Clang about your target. The two big things it needs to know are record layout rules and calling convention lowering rules. Record layout should be easy, it is just the size and alignment of basic types like pointers and i64 (4 or 8 byte aligned?). Calling convention lowering is tricky, as you need to understand the ABI rules for struct passing, and how you implemented them in LLVM.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 26, 2014 at 9:13 AM, Anton Smirnov <span dir="ltr"><<a href="mailto:dev@antonsmirnov.name" target="_blank">dev@antonsmirnov.name</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi.<div><br></div><div><div>I'm working on AVR backend/target and it's almost working:</div><div><a href="https://github.com/dylanmckay/llvm" target="_blank">https://github.com/dylanmckay/llvm</a></div></div><div><br></div><div>I've read how to add LLVM backend/Target:</div><div><a href="http://llvm.org/docs/WritingAnLLVMBackend.html" target="_blank">http://llvm.org/docs/WritingAnLLVMBackend.html</a><br></div><div><br></div><div>But how can i add target (AVR) to Clang?</div><div>Is it designed to add targets easily or should i hack the sources?</div><div><br></div><div>That makes sense as some information is lost at the moment, f.e. attribute:</div><div>__attribute__ ((section .. ))<br></div><div><br></div><div>Regards, Anton.</div><div><br></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>