================
@@ -2816,13 +2799,35 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, 
OperationState &state) {
   if (parser.parseOptionalAttrDictWithKeyword(parsedAttrs))
     return failure();
 
+  // memory_effects is the only declared attribute with no dedicated syntax, so
+  // it is the only one the explicit list may carry.
   for (StringRef disallowed : cir::FuncOp::getAttributeNames()) {
+    if (disallowed == CIRDialect::getMemoryEffectsAttrName())
+      continue;
     if (parsedAttrs.get(disallowed))
       return parser.emitError(loc, "attribute '")
              << disallowed
              << "' should not be specified in the explicit attribute list";
   }
 
+  // Being a declared attribute, memory_effects is stored as a property, so a
+  // value of the wrong kind would be dropped without a diagnostic.
+  if (mlir::Attribute effects =
+          parsedAttrs.get(CIRDialect::getMemoryEffectsAttrName()))
----------------
andykaylor wrote:

I didn't see anywhere that this is printed.

https://github.com/llvm/llvm-project/pull/223890
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to