OSDN Git Service

Add a 'normalize' method to the Triple class, which takes a mucked up
authorDuncan Sands <baldrick@free.fr>
Thu, 12 Aug 2010 11:31:39 +0000 (11:31 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 12 Aug 2010 11:31:39 +0000 (11:31 +0000)
commit335db223926931db204bf54d4accac6677b8e6b1
tree897faf4c7a1ae316baa853b1e08de7781d4648bb
parent74862789001b62350fa1a316150fdab04689a0bc
Add a 'normalize' method to the Triple class, which takes a mucked up
target triple and straightens it out.  This does less than gcc's script
config.sub, for example it turns i386-mingw32 into i386--mingw32 not
i386-pc-mingw32, but it does a decent job of turning funky triples into
something that the rest of the Triple class can understand.  The plan
is to use this to canonicalize triple's when they are first provided
by users, and have the rest of LLVM only deal with canonical triples.
Once this is done the special case workarounds in the Triple constructor
can be removed, making the class more regular and easier to use.  The
comments and unittests for the Triple class are already adjusted in this
patch appropriately for this brave new world of increased uniformity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110909 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/Triple.h
lib/Support/Triple.cpp
unittests/ADT/TripleTest.cpp