Skip to content

Commit 2dd00c1

Browse files
committed
[mlir][ods] Cleanup of handling Op vs OpAdaptor
In preparation for implementation subrange lookup on attributes. Depends on D113039 Reviewed By: jpienaar, Chia-hungDuan Differential Revision: https://reviews.llvm.org/D113128
1 parent bb12ded commit 2dd00c1

File tree

2 files changed

+168
-128
lines changed

2 files changed

+168
-128
lines changed

mlir/test/mlir-tblgen/op-attribute.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,21 @@ def AOp : NS_Op<"a_op", []> {
8080
// ---
8181

8282
// DEF: some-attr-kind AOp::aAttrAttr()
83-
// DEF-NEXT: (*this)->getAttr(aAttrAttrName()).template cast<some-attr-kind>()
83+
// DEF-NEXT: (*this)->getAttr(aAttrAttrName()).cast<some-attr-kind>()
8484
// DEF: some-return-type AOp::aAttr() {
8585
// DEF-NEXT: auto attr = aAttrAttr()
8686
// DEF-NEXT: return attr.some-convert-from-storage();
8787

8888
// DEF: some-attr-kind AOp::bAttrAttr()
89-
// DEF-NEXT: return (*this)->getAttr(bAttrAttrName()).template dyn_cast_or_null<some-attr-kind>()
89+
// DEF-NEXT: return (*this)->getAttr(bAttrAttrName()).dyn_cast_or_null<some-attr-kind>()
9090
// DEF: some-return-type AOp::bAttr() {
9191
// DEF-NEXT: auto attr = bAttrAttr();
9292
// DEF-NEXT: if (!attr)
9393
// DEF-NEXT: return some-const-builder-call(::mlir::Builder((*this)->getContext()), 4.2).some-convert-from-storage();
9494
// DEF-NEXT: return attr.some-convert-from-storage();
9595

9696
// DEF: some-attr-kind AOp::cAttrAttr()
97-
// DEF-NEXT: return (*this)->getAttr(cAttrAttrName()).template dyn_cast_or_null<some-attr-kind>()
97+
// DEF-NEXT: return (*this)->getAttr(cAttrAttrName()).dyn_cast_or_null<some-attr-kind>()
9898
// DEF: ::llvm::Optional<some-return-type> AOp::cAttr() {
9999
// DEF-NEXT: auto attr = cAttrAttr()
100100
// DEF-NEXT: return attr ? ::llvm::Optional<some-return-type>(attr.some-convert-from-storage()) : (::llvm::None);
@@ -194,21 +194,21 @@ def AgetOp : Op<Test2_Dialect, "a_get_op", []> {
194194
// ---
195195

196196
// DEF: some-attr-kind AgetOp::getAAttrAttr()
197-
// DEF-NEXT: (*this)->getAttr(getAAttrAttrName()).template cast<some-attr-kind>()
197+
// DEF-NEXT: (*this)->getAttr(getAAttrAttrName()).cast<some-attr-kind>()
198198
// DEF: some-return-type AgetOp::getAAttr() {
199199
// DEF-NEXT: auto attr = getAAttrAttr()
200200
// DEF-NEXT: return attr.some-convert-from-storage();
201201

202202
// DEF: some-attr-kind AgetOp::getBAttrAttr()
203-
// DEF-NEXT: return (*this)->getAttr(getBAttrAttrName()).template dyn_cast_or_null<some-attr-kind>()
203+
// DEF-NEXT: return (*this)->getAttr(getBAttrAttrName()).dyn_cast_or_null<some-attr-kind>()
204204
// DEF: some-return-type AgetOp::getBAttr() {
205205
// DEF-NEXT: auto attr = getBAttrAttr();
206206
// DEF-NEXT: if (!attr)
207207
// DEF-NEXT: return some-const-builder-call(::mlir::Builder((*this)->getContext()), 4.2).some-convert-from-storage();
208208
// DEF-NEXT: return attr.some-convert-from-storage();
209209

210210
// DEF: some-attr-kind AgetOp::getCAttrAttr()
211-
// DEF-NEXT: return (*this)->getAttr(getCAttrAttrName()).template dyn_cast_or_null<some-attr-kind>()
211+
// DEF-NEXT: return (*this)->getAttr(getCAttrAttrName()).dyn_cast_or_null<some-attr-kind>()
212212
// DEF: ::llvm::Optional<some-return-type> AgetOp::getCAttr() {
213213
// DEF-NEXT: auto attr = getCAttrAttr()
214214
// DEF-NEXT: return attr ? ::llvm::Optional<some-return-type>(attr.some-convert-from-storage()) : (::llvm::None);

0 commit comments

Comments
 (0)