Skip to content

Commit 3ea39a5

Browse files
authored
[utils] Process attribute references in lines defining attrs. (#156541)
Here is an example of TBAA attributes generated by Flang: ``` #tbaa_root = #llvm.tbaa_root<id = "Flang function root _QPtest6"> #tbaa_type_desc = #llvm.tbaa_type_desc<id = "any access", members = {<#tbaa_root, 0>}> ``` We have to process the text after `=` to replace the attribute references with proper check variables.
1 parent aac4eb5 commit 3ea39a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mlir/utils/generate-test-checks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ def process_attribute_definition(line, attribute_namer):
229229
"// CHECK: #[["
230230
+ attribute_name
231231
+ ":.+]] ="
232-
+ line[len(m.group(0)) :]
232+
# The rest of the line may contain attribute references,
233+
# so we have to process them.
234+
+ process_attribute_references(line[len(m.group(0)) :], attribute_namer)
233235
+ "\n"
234236
)
235237
return None

0 commit comments

Comments
 (0)