[mlir] Silence some deprecation warnings after dffc487b07

This commit is contained in:
Benjamin Kramer 2021-02-26 15:14:16 +01:00
parent 72b18a86e1
commit 4941fef9c4
3 changed files with 5 additions and 5 deletions

View File

@ -566,9 +566,9 @@ void FunctionLike<ConcreteType>::setArgAttrs(
SmallString<8> nameOut;
getArgAttrName(index, nameOut);
if (attributes.empty())
return (void)static_cast<ConcreteType *>(this)->removeAttr(nameOut);
Operation *op = this->getOperation();
if (attributes.empty())
return (void)op->removeAttr(nameOut);
op->setAttr(nameOut, DictionaryAttr::get(op->getContext(), attributes));
}

View File

@ -270,8 +270,8 @@ LogicalResult GPUFuncOpConversion::matchAndRewrite(
funcOp, *getTypeConverter(), rewriter, entryPointAttr, argABI);
if (!newFuncOp)
return failure();
newFuncOp.removeAttr(Identifier::get(gpu::GPUDialect::getKernelFuncAttrName(),
rewriter.getContext()));
newFuncOp->removeAttr(Identifier::get(
gpu::GPUDialect::getKernelFuncAttrName(), rewriter.getContext()));
return success();
}

View File

@ -1514,7 +1514,7 @@ const char *enumAttrBeginPrinterCode = R"(
static void genAttrDictPrinter(OperationFormat &fmt, Operator &op,
OpMethodBody &body, bool withKeyword) {
body << " p.printOptionalAttrDict" << (withKeyword ? "WithKeyword" : "")
<< "(getAttrs(), /*elidedAttrs=*/{";
<< "((*this)->getAttrs(), /*elidedAttrs=*/{";
// Elide the variadic segment size attributes if necessary.
if (!fmt.allOperands &&
op.getTrait("::mlir::OpTrait::AttrSizedOperandSegments"))