/// Print the given attribute/type, visiting any nested aliases that would be
/// generated as part of printing.
void printAndVisitNestedAliasesImpl(Attribute attr, bool elideType) {
- if (!isa<BuiltinDialect>(attr.getDialect()))
- return attr.getDialect().printAttribute(attr, *this);
+ if (!isa<BuiltinDialect>(attr.getDialect())) {
+ attr.getDialect().printAttribute(attr, *this);
- // Process the builtin attributes.
- if (attr.isa<AffineMapAttr, DenseArrayAttr, FloatAttr, IntegerAttr,
- IntegerSetAttr, UnitAttr>())
+ // Process the builtin attributes.
+ } else if (attr.isa<AffineMapAttr, DenseArrayAttr, FloatAttr, IntegerAttr,
+ IntegerSetAttr, UnitAttr>()) {
return;
- if (auto dictAttr = dyn_cast<DictionaryAttr>(attr)) {
+ } else if (auto dictAttr = dyn_cast<DictionaryAttr>(attr)) {
for (const NamedAttribute &nestedAttr : dictAttr.getValue()) {
printAttribute(nestedAttr.getName());
printAttribute(nestedAttr.getValue());
// -----
+// Ensure self type parameters get considered for aliases.
+// CHECK: !test_ui8_ = !test.int<unsigned, 8>
+// CHECK: #test.attr_with_self_type_param : !test_ui8_
+"test.op"() {alias_test = #test.attr_with_self_type_param : !test.int<unsigned, 8> } : () -> ()
+
+// -----
+
// Check that we don't print aliases for things that aren't printed.
// CHECK: #loc1 = loc(fused<memref<1xi32>
// CHECK-NOT: #map