From ab44bbb2757f899bc1dc3540042674beb083ec83 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 3 Sep 2024 12:37:32 +0200 Subject: [PATCH 1/2] hl: Make `LabelDeclOp` use `SymbolNameAttr`. --- include/vast/Dialect/HighLevel/HighLevelCF.td | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/vast/Dialect/HighLevel/HighLevelCF.td b/include/vast/Dialect/HighLevel/HighLevelCF.td index cc860caf2d..9f3bb54065 100644 --- a/include/vast/Dialect/HighLevel/HighLevelCF.td +++ b/include/vast/Dialect/HighLevel/HighLevelCF.td @@ -431,10 +431,10 @@ def HighLevel_DefaultOp def HighLevel_LabelDeclOp : HighLevel_Op< "label.decl", [Core_LabelSymbol] > - , Arguments<(ins StrAttr:$name)> + , Arguments<(ins SymbolNameAttr:$sym_name)> , Results<(outs HighLevel_LabelType:$result)> { - let assemblyFormat = [{ $name attr-dict `:` type($result) }]; + let assemblyFormat = [{ $sym_name attr-dict `:` type($result) }]; } def HighLevel_LabelStmt From 0aafd06831a5ff7db4122420c7c6909ab8137bd8 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 3 Sep 2024 12:37:43 +0200 Subject: [PATCH 2/2] test: Fix label naming. --- test/vast/Dialect/HighLevel/goto-a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/vast/Dialect/HighLevel/goto-a.c b/test/vast/Dialect/HighLevel/goto-a.c index 84b1bd2642..ee05916567 100644 --- a/test/vast/Dialect/HighLevel/goto-a.c +++ b/test/vast/Dialect/HighLevel/goto-a.c @@ -2,7 +2,7 @@ // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t - int main() { - // CHECK: [[L:%[0-9]+]] = hl.label.decl "end" : !hl.label + // CHECK: [[L:%[0-9]+]] = hl.label.decl @end : !hl.label // CHECK: hl.var @x : !hl.lvalue int x;