[RFC] Building MLIR operation: observed caveats and proposed solution

Taking arith::ConstantIntOp as an example, why not just duplicate create with the args fully spelled out i.e. add

class ConstantIntOp {
  ...
  static arith::ConstantIntOp create(Builder& builder, Location location, int64_t value, unsigned width) {
    OperationState state(location, getOperationName());
    arith::ConstantIntOp::build(builder, state, value, width);
    auto *op = builder.create(state);
    auto result = dyn_cast<arith::ConstantIntOp>(op);
    return result;
  }
  ...
}

to the cpp emitted by tablegen? It’s basically the same signature we currently have (except with builder passed as the first arg instead of builder.create<arith::ConstantIntOp>) and it autocompletes (i.e., shows hints).