Add builders for memory ops that did not have them (tested in forthcoming CL).
PiperOrigin-RevId: 211147994
diff --git a/lib/IR/StandardOps.cpp b/lib/IR/StandardOps.cpp
index 427de7a..3070621 100644
--- a/lib/IR/StandardOps.cpp
+++ b/lib/IR/StandardOps.cpp
@@ -179,6 +179,12 @@
// AllocOp
//===----------------------------------------------------------------------===//
+void AllocOp::build(Builder *builder, OperationState *result,
+ MemRefType *memrefType, ArrayRef<SSAValue *> operands) {
+ result->addOperands(operands);
+ result->types.push_back(memrefType);
+}
+
void AllocOp::print(OpAsmPrinter *p) const {
MemRefType *type = cast<MemRefType>(getMemRef()->getType());
*p << "alloc";
@@ -476,6 +482,11 @@
// DeallocOp
//===----------------------------------------------------------------------===//
+void DeallocOp::build(Builder *builder, OperationState *result,
+ SSAValue *memref) {
+ result->addOperands(memref);
+}
+
void DeallocOp::print(OpAsmPrinter *p) const {
*p << "dealloc " << *getMemRef() << " : " << *getMemRef()->getType();
}
@@ -706,6 +717,14 @@
// StoreOp
//===----------------------------------------------------------------------===//
+void StoreOp::build(Builder *builder, OperationState *result,
+ SSAValue *valueToStore, SSAValue *memref,
+ ArrayRef<SSAValue *> indices) {
+ result->addOperands(valueToStore);
+ result->addOperands(memref);
+ result->addOperands(indices);
+}
+
void StoreOp::print(OpAsmPrinter *p) const {
*p << "store " << *getValueToStore();
*p << ", " << *getMemRef() << '[';