[llvm-commits] EABI triples patch (1/2)

Renato Golin renato.golin at arm.com
Tue Jan 18 09:35:41 PST 2011


The attached patch adds support for EABI triples in LLVM (from today's
r123755) regarding bug #8957

http://llvm.org/bugs/show_bug.cgi?id=8957

Rationale:

Clang was not parsing target triples involving EABI and was generating
wrong IR (wrong PCS) and passing the wrong information down llc via
the target-triple printed in IR. I've fixed this by adding the parsing
of EABI into LLVM's Triple class and using it to choose the correct
PCS in Clang's Tools.

There's still some edges to cover, such as the decisions of which PCS
to use based on Darwin's defaults (v6/v7). We should add support for
architecture definitions (TargetData?) to Clang, to be able to
correctly pass the options to llc AND re-generate the correct target
triple in the final IR.

This patch (1/2):

This is the LLVM part, that adds EABI, GNUEABI and GNU Environments to
the EnvironmentType enum, as well as support for the "none" in the
triple. Parsing of the "arm-none-eabi" triple is done by guessing
Environment from OS when OS is "none". Not the best way to do it, but
the triple support in LLVM is not that deterministic.

I also fixed a problem created by adding the environment parsing with
triple "x86_64-gnu-linux" from one of the Clang tests, since "gnu" now
is an environment. Test cases were added to test the new functionality
and the change didn't break any other unit test.

The second part of the patch (clang side) will be sent in a different email.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-triple.patch
Type: text/x-patch
Size: 5252 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110118/25c708eb/attachment.bin>


More information about the llvm-commits mailing list