Fix omitted kw in type alias printer

* Fixing missing `type` keyword in alias print
* Add test for large tuple type alias & rerun output to verify printed
form can be parsed (which caught the above).
This commit is contained in:
Jacques Pienaar 2021-01-31 14:06:58 -08:00
parent 2de4f19ecd
commit 2eb5f34542
2 changed files with 6 additions and 2 deletions

View File

@ -731,7 +731,7 @@ void AliasState::printAliases(raw_ostream &os, NewLineCounter &newLine,
}
for (const auto &it : llvm::make_filter_range(typeToAlias, filterFn)) {
it.second.print(os << '!');
os << " = " << it.first << newLine;
os << " = type " << it.first << newLine;
}
}

View File

@ -1,5 +1,6 @@
// RUN: mlir-opt %s | FileCheck %s
// Verify printer of type & attr aliases.
// RUN: mlir-opt %s | mlir-opt | FileCheck %s
// CHECK-DAG: #test2Ealias = "alias_test:dot_in_name"
"test.op"() {alias_test = "alias_test:dot_in_name"} : () -> ()
@ -13,3 +14,6 @@
// CHECK-DAG: #test_alias_conflict0_0 = "alias_test:sanitize_conflict_a"
// CHECK-DAG: #test_alias_conflict0_1 = "alias_test:sanitize_conflict_b"
"test.op"() {alias_test = ["alias_test:sanitize_conflict_a", "alias_test:sanitize_conflict_b"]} : () -> ()
// CHECK-DAG: !tuple = type tuple<i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32>
"test.op"() {alias_test = "alias_test:large_tuple"} : () -> (tuple<i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32>)