[LLVMdev] Target Triple Changes

Duncan Sands baldrick at free.fr
Sun Jan 23 05:33:21 PST 2011


Hi Renato,

>   1. Some ARM triples "arm*-none-eabi" don't get properly recognized,
> so Clang doesn't generate correct AAPCS (soft and hard) calls and
> don't pass the correct triple to LLC.

in order to have "eabi" be properly recognized by LLVM, it is enough to
add "eabi" as a valid environment value.  Then Triple::Normalize will
automatically move eabi to the environment position, resulting in
arm*-none--eabi  So I think this is easy to take care of.

>   2. Some options in Clang are chosen by parsing the triple directly,
> because triples don't have all properties necessary to make such
> decisions.

I think that's a good thing!  Clang's needs are different to LLVM's, so
probably clang should have it's own ClangTriple class.  Given a triple
string you probably first want to have Triple::Normalize crunch on it,
permuting recognized components into the correct positions, and then
have ClangTriple apply additional logic.

>   1. Adding the options to the triple, so EABI can be recognized and
> properly stored to avoid string comparisons. This is not as simple as
> it seems because "arm-none-eabi" actually puts EABI in the OS slot,

That's because Triple doesn't (or didn't) know that eabi is a valid value
for  environment.  If it did then Normalize would move it to the right
position.

Ciao, Duncan.



More information about the llvm-dev mailing list