[llvm-commits] [llvm] r123990 - in /llvm/trunk: include/llvm/ADT/Triple.h lib/Support/Triple.cpp unittests/ADT/TripleTest.cpp

Duncan Sands baldrick at free.fr
Mon Jan 24 02:12:19 PST 2011


Hi Renato,

> I personally don't think it's too much to add NoOS and NoEnvironment to
> the Triple class, since many of the OSs would end up having the same
> codegen anyway. But if you feel strongly about it, I can add the option
> to a supposedly Clang's Triple class.

I don't see the point of having "none" be turned into "NoVendor" rather than
"UnknownVendor" if you aren't go to do anything with that information anyway.
However if you have a good reason to want "none" to be parsed then I will
drop my objections to "none" :)  There is an additional problem with "none",
which is that it is ambiguous: if you see a "none" component, is it a vendor,
an O/S or an environment?  For example, suppose you have "arm*-none-eabi".
Then the architecture is clearly "arm*".  The environment could be "none" or
"eabi"; since "none" could also be a vendor or an O/S while "eabi" can only
be an environment, we can deduce that the environment is "eabi" (I don't think
Normalize does this reasoning right now, but it could and probably should be
enhanced to do so).  At this point "none" could be the O/S or the vendor.
Since it is in the vendor position, currently we will suppose it is the
vendor.  Is that the right conclusion or should it mean the O/S?  If "none" was
only valid as an O/S (and not as a vendor or environment) then the current code
would turn this triple into "arm*--none-eabi", which is probably what you
want.  But if you have "arm*-none-eabi-linux" (does this kind of triple really
occur?) then it is still ambiguous as to whether the O/S should be "none" or
"linux".  On the other hand, if you don't say that "none" is valid for
anything, then "arm*-none-eabi" will become "arm*-none--eabi" (leaving "none"
in the vendor position) which is probably fine as far as LLVM is concerned
since it wouldn't make different decisions with an O/S of "none" as compared to
an UnknownOS.  In short, whether "none" is parsed at all, or only parsed as a
valid "O/S", or parsed as a valid vendor and a valid O/S etc depends on what
triples occur in the real world and what you plan to do with the information.
So can you please give some examples.

Thanks, Duncan.



More information about the llvm-commits mailing list