Skip to content

Commit 5a581ac

Browse files
authored
[CIR] Rename allEnumCasesCovered to all_enum_cases_covered (#172153)
Use the convetional snake_case for MLIR assembly and align with operation documentation that already mentions snake_cased attribute.
1 parent 35315a8 commit 5a581ac

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ def CIR_SwitchOp : CIR_Op<"switch", [
12161216

12171217
let arguments = (ins
12181218
CIR_IntType:$condition,
1219-
UnitAttr:$allEnumCasesCovered
1219+
UnitAttr:$all_enum_cases_covered
12201220
);
12211221

12221222
let regions = (region AnyRegion:$body);
@@ -1229,7 +1229,7 @@ def CIR_SwitchOp : CIR_Op<"switch", [
12291229

12301230
let assemblyFormat = [{
12311231
`(` $condition `:` qualified(type($condition)) `)`
1232-
(`allEnumCasesCovered` $allEnumCasesCovered^)?
1232+
(`all_enum_cases_covered` $all_enum_cases_covered^)?
12331233
$body
12341234
attr-dict
12351235
}];

clang/test/CIR/CodeGen/switch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ void testSwitchCoverAllCase(M m) {
12821282
break;
12831283
}
12841284
}
1285-
// CIR: cir.switch(%[[ARG:.*]] : !s32i) allEnumCasesCovered {
1285+
// CIR: cir.switch(%[[ARG:.*]] : !s32i) all_enum_cases_covered {
12861286

12871287
void testSwitchNotCoverAllCase(M m) {
12881288
switch (m) {

clang/test/CIR/IR/switch.cir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cir.func @s0() {
4040

4141
// Pretends that this is lowered from a C file and was tagged with allEnumCasesCovered = true
4242
cir.func @s1(%1 : !s32i) {
43-
cir.switch (%1 : !s32i) allEnumCasesCovered {
43+
cir.switch (%1 : !s32i) all_enum_cases_covered {
4444
cir.case (default, []) {
4545
cir.return
4646
}
@@ -54,7 +54,7 @@ cir.func @s1(%1 : !s32i) {
5454
} { }
5555
cir.return
5656
}
57-
// CHECK: cir.switch(%[[ARG:.*]] : !s32i) allEnumCasesCovered {
57+
// CHECK: cir.switch(%[[ARG:.*]] : !s32i) all_enum_cases_covered {
5858
// CHECK-NEXT: cir.case(default, []) {
5959
// CHECK-NEXT: cir.return
6060
// CHECK-NEXT: }

0 commit comments

Comments
 (0)