Make MLIREmitter::bindConstant variadic
authorNicolas Vasilache <ntv@google.com>
Tue, 22 Jan 2019 13:00:01 +0000 (05:00 -0800)
committerjpienaar <jpienaar@google.com>
Fri, 29 Mar 2019 22:29:13 +0000 (15:29 -0700)
This is needed to allow binding to more constant types.
Tests that exercise this behavior will come in a followup CL.
In the meantime this does not breaks things.

PiperOrigin-RevId: 230320621

mlir/include/mlir/EDSC/MLIREmitter.h

index 24b5a5f16a375fa15177498cdd754b38fd9e01e8..a696914eee28841e5bb58331d0d99651aebc75c2 100644 (file)
@@ -67,9 +67,9 @@ struct MLIREmitter {
   /// registered, makes sure the Value is of the proper type.
   MLIREmitter &bind(Bindable e, Value *v);
   /// Constant values can be created on the spot and bound.
-  template <typename SSAConstantType, typename T>
-  MLIREmitter &bindConstant(Bindable e, T value) {
-    return bind(e, builder->create<SSAConstantType>(location, value));
+  template <typename SSAConstantType, typename... Args>
+  MLIREmitter &bindConstant(Bindable e, Args... args) {
+    return bind(e, builder->create<SSAConstantType>(location, args...));
   }
 
   /// Registers new bindings and type-checks. If a certain Expr type is