[llvm-branch-commits] [mlir] 6367306 - [mlir] Perfectly forward ImplicitLocOpBuilder ctors to OpBuilder

Benjamin Kramer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jan 25 02:55:51 PST 2021


Author: Benjamin Kramer
Date: 2021-01-25T11:48:58+01:00
New Revision: 6367306a1be3adf7125c0b8b8f87209b8fc836f7

URL: https://github.com/llvm/llvm-project/commit/6367306a1be3adf7125c0b8b8f87209b8fc836f7
DIFF: https://github.com/llvm/llvm-project/commit/6367306a1be3adf7125c0b8b8f87209b8fc836f7.diff

LOG: [mlir] Perfectly forward ImplicitLocOpBuilder ctors to OpBuilder

This is both cleaner and less prone to creating a mess out of overload
resolution.

Added: 
    

Modified: 
    mlir/include/mlir/IR/ImplicitLocOpBuilder.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/ImplicitLocOpBuilder.h b/mlir/include/mlir/IR/ImplicitLocOpBuilder.h
index ff85f2b5a382..862be32e6208 100644
--- a/mlir/include/mlir/IR/ImplicitLocOpBuilder.h
+++ b/mlir/include/mlir/IR/ImplicitLocOpBuilder.h
@@ -22,20 +22,11 @@ namespace mlir {
 /// as OpBuilder.
 class ImplicitLocOpBuilder : public mlir::OpBuilder {
 public:
-  /// Create an ImplicitLocOpBuilder using the insertion point and listener from
-  /// an existing OpBuilder.
-  ImplicitLocOpBuilder(Location loc, const OpBuilder &builder)
-      : OpBuilder(builder), curLoc(loc) {}
-
   /// OpBuilder has a bunch of convenience constructors - we support them all
   /// with the additional Location.
-  template <typename T>
-  ImplicitLocOpBuilder(Location loc, T &&operand, Listener *listener = nullptr)
-      : OpBuilder(std::forward<T>(operand), listener), curLoc(loc) {}
-
-  ImplicitLocOpBuilder(Location loc, Block *block, Block::iterator insertPoint,
-                       Listener *listener = nullptr)
-      : OpBuilder(block, insertPoint, listener), curLoc(loc) {}
+  template <typename... T>
+  ImplicitLocOpBuilder(Location loc, T &&...operands)
+      : OpBuilder(std::forward<T>(operands)...), curLoc(loc) {}
 
   /// Create a builder and set the insertion point to before the first operation
   /// in the block but still inside the block.


        


More information about the llvm-branch-commits mailing list