Commit 7a0ad42
authored
[HW] Extend ElementType parsing to support union types (#9318)
This PR fixes a bug where !hw.union types nested inside !hw.array failed to parse back in after being printed (round-trip failure). When printing nested types, printHWElementType elides the dialect prefix to produce a more readable output (e.g., union<...> instead of !hw.union<...>). However, the corresponding parser helper, parseHWElementType, relies on a hardcoded list of string prefixes to detect when a bare keyword is being used. This list currently includes struct, array, enum, etc., but is missing union. As a result, the parser fails to recognize union<...> as a valid HW type when parsing the output of a valid IR print.1 parent 678dc94 commit 7a0ad42
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
0 commit comments