[Mlir-commits] [mlir] caa5144 - [mlir] Use mlir::OpState::operator->() to get to Operation::getAttrs().

Christian Sigg llvmlistbot at llvm.org
Tue Mar 2 04:29:55 PST 2021


Author: Christian Sigg
Date: 2021-03-02T13:29:27+01:00
New Revision: caa5144d569cf8fef01a0e1e47c20d321e4f5949

URL: https://github.com/llvm/llvm-project/commit/caa5144d569cf8fef01a0e1e47c20d321e4f5949
DIFF: https://github.com/llvm/llvm-project/commit/caa5144d569cf8fef01a0e1e47c20d321e4f5949.diff

LOG: [mlir] Use mlir::OpState::operator->() to get to Operation::getAttrs().

This is a preparation step to remove getAttrs() from OpState.

Added: 
    

Modified: 
    mlir/examples/toy/Ch3/mlir/Dialect.cpp
    mlir/examples/toy/Ch5/mlir/Dialect.cpp
    mlir/examples/toy/Ch6/mlir/Dialect.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/examples/toy/Ch3/mlir/Dialect.cpp b/mlir/examples/toy/Ch3/mlir/Dialect.cpp
index e4391e3b6fa9..bd23c779d6e9 100644
--- a/mlir/examples/toy/Ch3/mlir/Dialect.cpp
+++ b/mlir/examples/toy/Ch3/mlir/Dialect.cpp
@@ -121,7 +121,7 @@ static mlir::ParseResult parseConstantOp(mlir::OpAsmParser &parser,
 /// strings, attributes, operands, types, etc.
 static void print(mlir::OpAsmPrinter &printer, ConstantOp op) {
   printer << "toy.constant ";
-  printer.printOptionalAttrDict(op.getAttrs(), /*elidedAttrs=*/{"value"});
+  printer.printOptionalAttrDict(op->getAttrs(), /*elidedAttrs=*/{"value"});
   printer << op.value();
 }
 

diff  --git a/mlir/examples/toy/Ch5/mlir/Dialect.cpp b/mlir/examples/toy/Ch5/mlir/Dialect.cpp
index a4ca119a9aaf..ce5901363be8 100644
--- a/mlir/examples/toy/Ch5/mlir/Dialect.cpp
+++ b/mlir/examples/toy/Ch5/mlir/Dialect.cpp
@@ -177,7 +177,7 @@ static mlir::ParseResult parseConstantOp(mlir::OpAsmParser &parser,
 /// strings, attributes, operands, types, etc.
 static void print(mlir::OpAsmPrinter &printer, ConstantOp op) {
   printer << "toy.constant ";
-  printer.printOptionalAttrDict(op.getAttrs(), /*elidedAttrs=*/{"value"});
+  printer.printOptionalAttrDict(op->getAttrs(), /*elidedAttrs=*/{"value"});
   printer << op.value();
 }
 

diff  --git a/mlir/examples/toy/Ch6/mlir/Dialect.cpp b/mlir/examples/toy/Ch6/mlir/Dialect.cpp
index a4ca119a9aaf..ce5901363be8 100644
--- a/mlir/examples/toy/Ch6/mlir/Dialect.cpp
+++ b/mlir/examples/toy/Ch6/mlir/Dialect.cpp
@@ -177,7 +177,7 @@ static mlir::ParseResult parseConstantOp(mlir::OpAsmParser &parser,
 /// strings, attributes, operands, types, etc.
 static void print(mlir::OpAsmPrinter &printer, ConstantOp op) {
   printer << "toy.constant ";
-  printer.printOptionalAttrDict(op.getAttrs(), /*elidedAttrs=*/{"value"});
+  printer.printOptionalAttrDict(op->getAttrs(), /*elidedAttrs=*/{"value"});
   printer << op.value();
 }
 


        


More information about the Mlir-commits mailing list