From 1243cdda6330139c55e8ecc033fcb559581e6870 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 17 Dec 2011 10:20:15 +0000 Subject: As Doug pointed out (and I really should know), it is perfectly easy to make VariadicFunction actually be trivial. Do so, and also make it look more like your standard trivial functor by making it a struct with no access specifiers. The unit test is updated to initialize its functors properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146827 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/VariadicFunction.h | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'include/llvm/ADT/VariadicFunction.h') diff --git a/include/llvm/ADT/VariadicFunction.h b/include/llvm/ADT/VariadicFunction.h index 00ae347dc7..a9a0dc6b6e 100644 --- a/include/llvm/ADT/VariadicFunction.h +++ b/include/llvm/ADT/VariadicFunction.h @@ -103,10 +103,7 @@ namespace llvm { /// fixed leading arguments and up-to 32 optional arguments. template )> -class VariadicFunction { - public: - VariadicFunction() {} - +struct VariadicFunction { ResultT operator()() const { return Func(ArrayRef()); } @@ -153,10 +150,7 @@ class VariadicFunction { template )> -class VariadicFunction1 { - public: - VariadicFunction1() {} - +struct VariadicFunction1 { ResultT operator()(Param0T P0) const { return Func(P0, ArrayRef()); } @@ -203,10 +197,7 @@ class VariadicFunction1 { template )> -class VariadicFunction2 { - public: - VariadicFunction2() {} - +struct VariadicFunction2 { ResultT operator()(Param0T P0, Param1T P1) const { return Func(P0, P1, ArrayRef()); } @@ -255,10 +246,7 @@ class VariadicFunction2 { template )> -class VariadicFunction3 { - public: - VariadicFunction3() {} - +struct VariadicFunction3 { ResultT operator()(Param0T P0, Param1T P1, Param2T P2) const { return Func(P0, P1, P2, ArrayRef()); } -- cgit v1.2.3