Porting Clang to a new architecture

Joerg Sonnenberger via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 2 01:41:04 PST 2015


On Mon, Oct 26, 2015 at 12:58:46PM -0300, Ariel Arelovich via cfe-commits wrote:
> So this is what I wanted to know. I think understand what you are saying.
> You are saying that most of the work that I would need to do from the AST
> (I'm assuming that this stands from Abstract Syntax Tree) is allready being
> done by LLVM and I should look to modify for a my new arquitecture. Right?

To complement Justin's reply: there are few target specific parts in
clang. It needs some ABI knowledge to layout structures etc correctly
and lower function calls (especially variadic functions) to certain
primitive forms that LLVM's IR can deal with. It may optionally provide
a bunch of intrinsincs (__builtin_* etc) and lower them to
corresponding target intrinsincs in IR. This is primarily used for
special purpose instructions and SIMD operations.

In short, the primary work for adding a new architecture is in LLVM
itself and not so much clang.

Joerg


More information about the cfe-commits mailing list