[cfe-dev] Policy for adding new TargetInfo to Clang?

Eli Friedman eli.friedman at gmail.com
Sat Apr 18 14:59:36 PDT 2009


On Sat, Apr 18, 2009 at 2:28 PM, Greg McGary <greg at mcgary.org> wrote:
> Clang has no target definitions for several LLVM targets, notably:
>      mips, xcore, ia64, alpha, cell

Yes... we've been adding targets as people send patches.

> not to mention the non-machine targets:
>      MSIL, CppBackend, CBackend

CppBackend and CBackend don't require a distinct clang target; they
generate code based on some real target.  I'm not sure about MSIL.

> My personal interest is to observe a variety of LLVM target backends in
> action and use clang to provide input for them.  Lacking experience and
> access to some of these, I probably won't be able to always provide
> complete& accurate sets of CPP predefines.  Question: will you accept
> patches for new XXXTargetInfo classes that are possibly
> incompete/inaccurate, but still useful for LLVM experimentation?

We don't have any restrictions on what targets we accept, but please
don't submit a target unless you have an actual machine that it
targets.

If you just want to see code generation for simple bits of C code, you
don't need a clang target; you can just use a command-line like "clang
-c -emit-llvm -o - -x c - | llc -arch=mips" to override the target
inside of code generation.  The ABI won't be correct for non-trivial
pieces of code, but it should generally generate something sane.

-Eli




More information about the cfe-dev mailing list