[cfe-dev] How to add target to Clang?

Reid Kleckner rnk at google.com
Wed Nov 26 09:25:35 PST 2014

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.

On Wed, Nov 26, 2014 at 9:13 AM, Anton Smirnov <dev at antonsmirnov.name>

> Hi.
> I'm working on AVR backend/target and it's almost working:
> https://github.com/dylanmckay/llvm
> I've read how to add LLVM backend/Target:
> http://llvm.org/docs/WritingAnLLVMBackend.html
> But how can i add target (AVR) to Clang?
> Is it designed to add targets easily or should i hack the sources?
> That makes sense as some information is lost at the moment, f.e. attribute:
> __attribute__ ((section .. ))
> Regards, Anton.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141126/e01e5611/attachment.html>

More information about the cfe-dev mailing list