Update .getAttrs to ->getAttrs as it is deprecated.

Signed-off-by: Bairen Yi <yibairen.byron@bytedance.com>
pull/184/head
Bairen Yi 2021-03-11 11:32:55 +08:00 committed by Sean Silva
parent e7a8fd76e2
commit 5315598947
2 changed files with 7 additions and 7 deletions

View File

@ -73,9 +73,9 @@ static ParseResult parseNumericConstantOp(OpAsmParser &parser,
static void print(OpAsmPrinter &p, NumericConstantOp op) {
p << "basicpy.numeric_constant ";
p.printOptionalAttrDict(op.getAttrs(), /*elidedAttrs=*/{"value"});
p.printOptionalAttrDict(op->getAttrs(), /*elidedAttrs=*/{"value"});
if (op.getAttrs().size() > 1)
if (op->getAttrs().size() > 1)
p << ' ';
p << op.value();
@ -169,7 +169,7 @@ static ParseResult parseExecOp(OpAsmParser &parser, OperationState *result) {
static void print(OpAsmPrinter &p, ExecOp op) {
p << op.getOperationName();
p.printOptionalAttrDictWithKeyword(op.getAttrs());
p.printOptionalAttrDictWithKeyword(op->getAttrs());
p.printRegion(op.body());
}
@ -224,7 +224,7 @@ static ParseResult parseFuncTemplateOp(OpAsmParser &parser,
static void print(OpAsmPrinter &p, FuncTemplateOp op) {
p << op.getOperationName() << " ";
p.printSymbolName(op.getName());
p.printOptionalAttrDictWithKeyword(op.getAttrs(),
p.printOptionalAttrDictWithKeyword(op->getAttrs(),
{SymbolTable::getSymbolAttrName()});
p.printRegion(op.body());
}
@ -289,7 +289,7 @@ static void print(OpAsmPrinter &p, SlotObjectMakeOp op) {
p << op.getOperationName() << "(";
p.printOperands(op.slots());
p << ")";
p.printOptionalAttrDict(op.getAttrs(), {"className"});
p.printOptionalAttrDict(op->getAttrs(), {"className"});
// Not really a symbol but satisfies same rules.
p.printArrowTypeList(op.getOperation()->getResultTypes());
@ -353,7 +353,7 @@ static void print(OpAsmPrinter &p, SlotObjectGetOp op) {
p << op.getOperationName() << " ";
p.printOperand(op.object());
p << "[" << op.index() << "]";
p.printOptionalAttrDict(op.getAttrs(), {"index"});
p.printOptionalAttrDict(op->getAttrs(), {"index"});
p << " : ";
p.printType(op.object().getType());
}

View File

@ -22,7 +22,7 @@ using namespace mlir::NPCOMP::refbackrt;
static void printModuleMetadataOp(OpAsmPrinter &p, ModuleMetadataOp &op) {
p << "refbackrt.module_metadata";
p.printOptionalAttrDictWithKeyword(op.getAttrs());
p.printOptionalAttrDictWithKeyword(op->getAttrs());
p.printRegion(op.metadatas(), /*printEntryBlockArgs=*/false,
/*printBlockTerminators=*/false);
}