This is an archive of the discontinued LLVM Phabricator instance.

[ADT] Normalize empty triple components
ClosedPublic

Authored by phosek on Aug 2 2018, 8:19 PM.

Details

Summary

LLVM triple normalization is handling "unknown" and empty components
differently; for example given "x86_64-unknown-linux-gnu" and
"x86_64-linux-gnu" which should be equivalent, triple normalization
returns "x86_64-unknown-linux-gnu" and "x86_64--linux-gnu". autoconf's
config.sub returns "x86_64-unknown-linux-gnu" for both
"x86_64-linux-gnu" and "x86_64-unknown-linux-gnu". This changes the
triple normalization to behave the same way, replacing empty triple
components with "unknown".

This addresses PR37129.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.Aug 2 2018, 8:19 PM
rnk accepted this revision.Aug 6 2018, 12:15 PM
rnk added a reviewer: rnk.

lgtm

This revision is now accepted and ready to land.Aug 6 2018, 12:15 PM

LGTM. One inline comment.

-eric

llvm/unittests/ADT/TripleTest.cpp
1178 ↗(On Diff #158903)

What should we do here instead?

phosek added inline comments.Aug 6 2018, 1:11 PM
llvm/unittests/ADT/TripleTest.cpp
1178 ↗(On Diff #158903)

I'm not sure I understand the question? armv6-netbsd-eabi got normalized to armv6-unknown-netbsd-eabi, isn't that expected?

echristo accepted this revision.Aug 6 2018, 1:13 PM
echristo added inline comments.
llvm/unittests/ADT/TripleTest.cpp
1178 ↗(On Diff #158903)

Oh, I was reading it backwards. Nevermind.

This revision was automatically updated to reflect the committed changes.