From: Manuel Klimek Date: Mon, 7 Jul 2014 12:55:16 +0000 (+0000) Subject: Increase argument limit of anyOf, allOf and eachOf from 5 to 9. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a8b850c98f392ec21d5b1e99338e0145d57fe69;p=platform%2Fupstream%2Fllvm.git Increase argument limit of anyOf, allOf and eachOf from 5 to 9. Patch by Alexey Sokolov. llvm-svn: 212452 --- diff --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h index 12680cf..12df77c 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h +++ b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h @@ -1126,16 +1126,25 @@ struct VariadicOperatorNoArg {}; template + typename P5 = VariadicOperatorNoArg, + typename P6 = VariadicOperatorNoArg, + typename P7 = VariadicOperatorNoArg, + typename P8 = VariadicOperatorNoArg, + typename P9 = VariadicOperatorNoArg> class VariadicOperatorMatcher { public: VariadicOperatorMatcher(VariadicOperatorFunction Func, const P1 &Param1, const P2 &Param2 = VariadicOperatorNoArg(), const P3 &Param3 = VariadicOperatorNoArg(), const P4 &Param4 = VariadicOperatorNoArg(), - const P5 &Param5 = VariadicOperatorNoArg()) + const P5 &Param5 = VariadicOperatorNoArg(), + const P6 &Param6 = VariadicOperatorNoArg(), + const P7 &Param7 = VariadicOperatorNoArg(), + const P8 &Param8 = VariadicOperatorNoArg(), + const P9 &Param9 = VariadicOperatorNoArg()) : Func(Func), Param1(Param1), Param2(Param2), Param3(Param3), - Param4(Param4), Param5(Param5) {} + Param4(Param4), Param5(Param5), Param6(Param6), Param7(Param7), + Param8(Param8), Param9(Param9) {} template operator Matcher() const { std::vector Matchers; @@ -1144,6 +1153,10 @@ public: addMatcher(Param3, Matchers); addMatcher(Param4, Matchers); addMatcher(Param5, Matchers); + addMatcher(Param6, Matchers); + addMatcher(Param7, Matchers); + addMatcher(Param8, Matchers); + addMatcher(Param9, Matchers); return Matcher( new VariadicOperatorMatcherInterface(Func, std::move(Matchers))); } @@ -1166,12 +1179,16 @@ private: const P3 Param3; const P4 Param4; const P5 Param5; + const P6 Param6; + const P7 Param7; + const P8 Param8; + const P9 Param9; }; /// \brief Overloaded function object to generate VariadicOperatorMatcher /// objects from arbitrary matchers. /// -/// It supports 1-5 argument overloaded operator(). More can be added if needed. +/// It supports 1-9 argument overloaded operator(). More can be added if needed. template struct VariadicOperatorMatcherFunc { VariadicOperatorFunction Func; @@ -1208,6 +1225,43 @@ struct VariadicOperatorMatcherFunc { return VariadicOperatorMatcher(Func, P1, P2, P3, P4, P5); } + template + typename EnableIfValidArity< + 6, VariadicOperatorMatcher >::type + operator()(const M1 &P1, const M2 &P2, const M3 &P3, const M4 &P4, + const M5 &P5, const M6 &P6) const { + return VariadicOperatorMatcher( + Func, P1, P2, P3, P4, P5, P6); + } + template + typename EnableIfValidArity< + 7, VariadicOperatorMatcher >::type + operator()(const M1 &P1, const M2 &P2, const M3 &P3, const M4 &P4, + const M5 &P5, const M6 &P6, const M7 &P7) const { + return VariadicOperatorMatcher( + Func, P1, P2, P3, P4, P5, P6, P7); + } + template + typename EnableIfValidArity< + 8, VariadicOperatorMatcher >::type + operator()(const M1 &P1, const M2 &P2, const M3 &P3, const M4 &P4, + const M5 &P5, const M6 &P6, const M7 &P7, const M8 &P8) const { + return VariadicOperatorMatcher( + Func, P1, P2, P3, P4, P5, P6, P7, P8); + } + template + typename EnableIfValidArity< + 9, VariadicOperatorMatcher >::type + operator()(const M1 &P1, const M2 &P2, const M3 &P3, const M4 &P4, + const M5 &P5, const M6 &P6, const M7 &P7, const M8 &P8, + const M9 &P9) const { + return VariadicOperatorMatcher( + Func, P1, P2, P3, P4, P5, P6, P7, P8, P9); + } }; /// @}