[PATCH] D80250: Enclose verifier code for AttrSizedOperandSegments and AttrSizedResultSegments in a nested code block to avoid symbol collision.

Lei Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 17:40:56 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGfb8204b21031: [mlir][ods] Fix ops with both attribute-sized operands and results (authored by chky, committed by antiagainst).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80250/new/

https://reviews.llvm.org/D80250

Files:
  mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp


Index: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
===================================================================
--- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+++ mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
@@ -1464,11 +1464,13 @@
   auto &body = method.body();
 
   const char *checkAttrSizedValueSegmentsCode = R"(
-  auto sizeAttr = getAttrOfType<DenseIntElementsAttr>("{0}");
-  auto numElements = sizeAttr.getType().cast<ShapedType>().getNumElements();
-  if (numElements != {1}) {{
-    return emitOpError("'{0}' attribute for specifying {2} segments "
-                       "must have {1} elements");
+  {
+    auto sizeAttr = getAttrOfType<DenseIntElementsAttr>("{0}");
+    auto numElements = sizeAttr.getType().cast<ShapedType>().getNumElements();
+    if (numElements != {1}) {{
+      return emitOpError("'{0}' attribute for specifying {2} segments "
+                         "must have {1} elements");
+    }
   }
   )";
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80250.265103.patch
Type: text/x-patch
Size: 947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200520/01179261/attachment.bin>


More information about the llvm-commits mailing list