[llvm-commits] PATCH: Refactor LLVM's triple normalization

Chandler Carruth chandlerc at gmail.com
Wed Feb 22 04:15:27 PST 2012


Latest patch in the series re-working llvm::Triple to be more suitable for
use inside of a cross-compiling FE.

I think this version is easier to read. It burns most of the lines of code
on asserts and an enum now. It is however much less efficient. ;] Let me
know if there is some concern with that. It at least shouldn't need the
heap for any sane inputs. The variable names are lame. Let me know if you
have better ideas. If you see any ways to simplify further, please point
them out. More details in the commit log....

Commit Log:

    Rewrite the normalization logic to be a bit simpler, and to take
    advantage of the fact that a triplet cannot parse as more than a single
    kind. The primary shift is to do less permuting of the triplets as they
    are parsed, and to do the parse is phases.

    One of the benefits is that this structure lends itself to further
    refactorings I'm working on for the Triple, to allow it to parse an
    un-normalized triple non-destructively.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120222/20eb91e0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: triple-normalize-refactor.patch
Type: text/x-patch
Size: 11423 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120222/20eb91e0/attachment.bin>


More information about the llvm-commits mailing list