[ADT] Add a remarkbly useful little helper routine to ArrayRef for
authorChandler Carruth <chandlerc@gmail.com>
Sun, 27 Jul 2014 01:11:19 +0000 (01:11 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 27 Jul 2014 01:11:19 +0000 (01:11 +0000)
commit3ea985b3758b6b8ca33a54e82d6fedc77ed53f9e
tree880d13180a3519c3cbc1514b1c051fcdaae48128
parentb72a2fdd722af7f56d4811ea403cf04521d71f35
[ADT] Add a remarkbly useful little helper routine to ArrayRef for
checking whether the ArrayRef is equal to an explicit list of arguments.

This is particularly easy to implement even without variadic templates
because ArrayRef happens to be homogeneously typed. As a consequence we
can use a "clever" wrapper type and default arguments to capture in
a single method many arguments as well as *how many* arguments the user
specified.

Thanks to Dave Blaikie for helping me pull together this little helper.
Suggestions for how to improve or generalize it are of course welcome.
I'll be using it immediately in my follow-up patch. =D

llvm-svn: 214041
llvm/include/llvm/ADT/ArrayRef.h
llvm/unittests/ADT/ArrayRefTest.cpp