From: Smit Hinsu Date: Tue, 3 Sep 2019 02:59:08 +0000 (-0700) Subject: Enable OwningRewritePatternList insert overload with parameter pack only when X-Git-Tag: llvmorg-11-init~1466^2~854 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c05890e890da37d9671169725c867ed0ca1e0b9d;p=platform%2Fupstream%2Fllvm.git Enable OwningRewritePatternList insert overload with parameter pack only when there is at least one template pattern type Also remove the other insert overload with pattern pointer as there are no existing users nor any potential known use-case. PiperOrigin-RevId: 266842920 --- diff --git a/mlir/include/mlir/IR/PatternMatch.h b/mlir/include/mlir/IR/PatternMatch.h index b531a61..f3ed316 100644 --- a/mlir/include/mlir/IR/PatternMatch.h +++ b/mlir/include/mlir/IR/PatternMatch.h @@ -408,13 +408,12 @@ public: // Pattern Insertion //===--------------------------------------------------------------------===// - void insert(RewritePattern *pattern) { patterns.emplace_back(pattern); } - /// Add an instance of each of the pattern types 'Ts' to the pattern list with /// the given arguments. - // Note: ConstructorArg is necessary here to separate the two variadic lists. + /// Note: ConstructorArg is necessary here to separate the two variadic lists. template + typename... ConstructorArgs, + typename = std::enable_if_t> void insert(ConstructorArg &&arg, ConstructorArgs &&... args) { // The following expands a call to emplace_back for each of the pattern // types 'Ts'. This magic is necessary due to a limitation in the places