[PATCH] D18544: TypeBuilder: Use parameter pack to permit any number of function parameters

Markus Himmel via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 04:01:37 PDT 2016


TwoFx created this revision.
TwoFx added reviewers: lhames, foad.
TwoFx added a subscriber: llvm-commits.

This patch removes the partial specializations for TypeBuilder for a specific number of function parameters and replaces them with specializations that use variadic templates to accept any number of parameters rather than a maximum of five.

Instead of using an array, these new specializations use the constructor of ArrayRef which takes an std::initializer_list. The advantage of this approach is that no special case for zero (non-ellipsis) parameters is needed.

I added a few tests for functions with up to eight parameters, as the previous limit of five parameters no longer applies.

http://reviews.llvm.org/D18544

Files:
  include/llvm/IR/TypeBuilder.h
  unittests/IR/TypeBuilderTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18544.51890.patch
Type: text/x-patch
Size: 8008 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160329/11647c60/attachment.bin>


More information about the llvm-commits mailing list