@@ -1302,8 +1302,8 @@ if (!dict) {
13021302}
13031303// keep track of used keys in the input dictionary to be able to error out
13041304// if there are some unknown ones.
1305- DenseSet<StringAttr> usedKeys;
1306- MLIRContext *ctx = dict.getContext();
1305+ ::mlir:: DenseSet<::mlir:: StringAttr> usedKeys;
1306+ ::mlir:: MLIRContext *ctx = dict.getContext();
13071307(void)ctx;
13081308)decl" ;
13091309
@@ -1315,7 +1315,7 @@ auto setFromAttr = [] (auto &propStorage, ::mlir::Attribute propAttr,
13151315 ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) -> ::mlir::LogicalResult {{
13161316 {0};
13171317};
1318- auto {1}AttrName = StringAttr::get(ctx, "{1}");
1318+ auto {1}AttrName = ::mlir:: StringAttr::get(ctx, "{1}");
13191319usedKeys.insert({1}AttrName);
13201320auto attr = dict.get({1}AttrName);
13211321if (!attr && {2}) {{
@@ -1363,7 +1363,7 @@ if (attr && ::mlir::failed(setFromAttr(prop.{1}, attr, emitError)))
13631363 bool isRequired = !attr.isOptional () && !attr.hasDefaultValue ();
13641364 body << formatv (R"decl(
13651365auto &propStorage = prop.{0};
1366- auto {0}AttrName = StringAttr::get(ctx, "{0}");
1366+ auto {0}AttrName = ::mlir:: StringAttr::get(ctx, "{0}");
13671367auto attr = dict.get({0}AttrName);
13681368usedKeys.insert({0}AttrName);
13691369if (attr || /*isRequired=*/{1}) {{
@@ -1384,7 +1384,7 @@ if (attr || /*isRequired=*/{1}) {{
13841384 namedAttr.name , isRequired);
13851385 }
13861386 body << R"decl(
1387- for (NamedAttribute attr : dict) {
1387+ for (::mlir:: NamedAttribute attr : dict) {
13881388 if (!usedKeys.contains(attr.getName()))
13891389 return emitError() << "unknown key '" << attr.getName() <<
13901390 "' when parsing properties dictionary";
@@ -3848,8 +3848,14 @@ void mlir::tblgen::generateOpFormat(const Operator &constOp, OpClass &opClass,
38483848 // TODO: Operator doesn't expose all necessary functionality via
38493849 // the const interface.
38503850 Operator &op = const_cast <Operator &>(constOp);
3851- if (!op.hasAssemblyFormat ())
3851+ if (!op.hasAssemblyFormat ()) {
3852+ // We still need to generate the parsed attribute properties setter for
3853+ // allowing it to be reused in custom assembly implementations.
3854+ OperationFormat format (op, hasProperties);
3855+ format.hasPropDict = true ;
3856+ genParsedAttrPropertiesSetter (format, op, opClass);
38523857 return ;
3858+ }
38533859
38543860 // Parse the format description.
38553861 llvm::SourceMgr mgr;
0 commit comments