@@ -1302,8 +1302,8 @@ if (!dict) {
1302
1302
}
1303
1303
// keep track of used keys in the input dictionary to be able to error out
1304
1304
// 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();
1307
1307
(void)ctx;
1308
1308
)decl" ;
1309
1309
@@ -1315,7 +1315,7 @@ auto setFromAttr = [] (auto &propStorage, ::mlir::Attribute propAttr,
1315
1315
::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) -> ::mlir::LogicalResult {{
1316
1316
{0};
1317
1317
};
1318
- auto {1}AttrName = StringAttr::get(ctx, "{1}");
1318
+ auto {1}AttrName = ::mlir:: StringAttr::get(ctx, "{1}");
1319
1319
usedKeys.insert({1}AttrName);
1320
1320
auto attr = dict.get({1}AttrName);
1321
1321
if (!attr && {2}) {{
@@ -1363,7 +1363,7 @@ if (attr && ::mlir::failed(setFromAttr(prop.{1}, attr, emitError)))
1363
1363
bool isRequired = !attr.isOptional () && !attr.hasDefaultValue ();
1364
1364
body << formatv (R"decl(
1365
1365
auto &propStorage = prop.{0};
1366
- auto {0}AttrName = StringAttr::get(ctx, "{0}");
1366
+ auto {0}AttrName = ::mlir:: StringAttr::get(ctx, "{0}");
1367
1367
auto attr = dict.get({0}AttrName);
1368
1368
usedKeys.insert({0}AttrName);
1369
1369
if (attr || /*isRequired=*/{1}) {{
@@ -1384,7 +1384,7 @@ if (attr || /*isRequired=*/{1}) {{
1384
1384
namedAttr.name , isRequired);
1385
1385
}
1386
1386
body << R"decl(
1387
- for (NamedAttribute attr : dict) {
1387
+ for (::mlir:: NamedAttribute attr : dict) {
1388
1388
if (!usedKeys.contains(attr.getName()))
1389
1389
return emitError() << "unknown key '" << attr.getName() <<
1390
1390
"' when parsing properties dictionary";
@@ -3848,8 +3848,14 @@ void mlir::tblgen::generateOpFormat(const Operator &constOp, OpClass &opClass,
3848
3848
// TODO: Operator doesn't expose all necessary functionality via
3849
3849
// the const interface.
3850
3850
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);
3852
3857
return ;
3858
+ }
3853
3859
3854
3860
// Parse the format description.
3855
3861
llvm::SourceMgr mgr;
0 commit comments