[llvm-commits] PATCH: Add several convenience predicates to llvm::Triple

Chandler Carruth chandlerc at gmail.com
Sun Jan 29 15:23:01 PST 2012


Hello,

Lots of the consumers of llvm::Triple are making very similar queries which
test a range of values. These typically fall into a general classification
pattern -- trying to classify various componenst of the triple according to
categories, commonalities, etc.

This patch starts moving some of these predicates into the triple class
itself so that the repeated code can be collapsed. I've taught
X86SubTarget.h to use these predicates. I'll be combing both LLVM and Clang
for more uses and fixing those as I find them if this general direction
looks good to folks.

My plan is to post patches when adding predicates to llvm::Triple, but to
rely on post-commit review when simply switching clients to use the new
helpers and the latter is very straightforward. I do appreciate any
feedback or comments on the API inside of llvm::Triple that is being built
up, it seems important to get that right. The patch has a couple of FIXMEs
where I have specific uncertainty about the API.

-Chandler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120129/b6b38680/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: triple-predicates1.patch
Type: text/x-patch
Size: 4785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120129/b6b38680/attachment.bin>


More information about the llvm-commits mailing list