@@ -59,15 +59,27 @@ class ConstantIntOp : public arith::ConstantOp {
5959 // / Build a constant int op that produces an integer of the specified width.
6060 static void build (OpBuilder &builder, OperationState &result, int64_t value,
6161 unsigned width);
62+ static ConstantIntOp create (OpBuilder &builder, Location location,
63+ int64_t value, unsigned width);
64+ static ConstantIntOp create (ImplicitLocOpBuilder &builder, int64_t value,
65+ unsigned width);
6266
6367 // / Build a constant int op that produces an integer of the specified type,
6468 // / which must be an integer type.
6569 static void build (OpBuilder &builder, OperationState &result, Type type,
6670 int64_t value);
71+ static ConstantIntOp create (OpBuilder &builder, Location location, Type type,
72+ int64_t value);
73+ static ConstantIntOp create (ImplicitLocOpBuilder &builder, Type type,
74+ int64_t value);
6775
6876 // / Build a constant int op that produces an integer from an APInt
6977 static void build (OpBuilder &builder, OperationState &result, Type type,
7078 const APInt &value);
79+ static ConstantIntOp create (OpBuilder &builder, Location location, Type type,
80+ const APInt &value);
81+ static ConstantIntOp create (ImplicitLocOpBuilder &builder, Type type,
82+ const APInt &value);
7183
7284 inline int64_t value () {
7385 return cast<IntegerAttr>(arith::ConstantOp::getValue ()).getInt ();
@@ -85,6 +97,10 @@ class ConstantFloatOp : public arith::ConstantOp {
8597 // / Build a constant float op that produces a float of the specified type.
8698 static void build (OpBuilder &builder, OperationState &result, FloatType type,
8799 const APFloat &value);
100+ static ConstantFloatOp create (OpBuilder &builder, Location location,
101+ FloatType type, const APFloat &value);
102+ static ConstantFloatOp create (ImplicitLocOpBuilder &builder, FloatType type,
103+ const APFloat &value);
88104
89105 inline APFloat value () {
90106 return cast<FloatAttr>(arith::ConstantOp::getValue ()).getValue ();
@@ -100,6 +116,9 @@ class ConstantIndexOp : public arith::ConstantOp {
100116 static ::mlir::TypeID resolveTypeID () { return TypeID::get<ConstantOp>(); }
101117 // / Build a constant int op that produces an index.
102118 static void build (OpBuilder &builder, OperationState &result, int64_t value);
119+ static ConstantIndexOp create (OpBuilder &builder, Location location,
120+ int64_t value);
121+ static ConstantIndexOp create (ImplicitLocOpBuilder &builder, int64_t value);
103122
104123 inline int64_t value () {
105124 return cast<IntegerAttr>(arith::ConstantOp::getValue ()).getInt ();
0 commit comments