<div dir="ltr">Hi, Reid.<div><br></div><div>Thanks for replying.</div><div><br></div><div>I've found Attr.td and Targets.cpp filse to add AVR-specific attributes and AVR TargetInfo.</div><div>You're absolutely right and i should just consult AVR datasheets to write correct types sizes and so on.</div><div><br></div><div>Are there any other files to modufy to add AVR support?</div><div><br></div><div>Regards, Anton.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-26 23:25 GMT+06:00 Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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"><div><div class="h5">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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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></div></div>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">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>
</blockquote></div><br></div>