Closed as not planned
Description
Reproducer:
int func(int v) {
switch(v) {
case 1:
return 43;
default:
if (v > 5) {
case 2:
return 35;
return 47;
}
return 99;
}
}
Reduced from Spec2017. https://godbolt.org/z/zrqxsM9K4
Now it will crash at
clangir/clang/lib/CIR/CodeGen/CIRGenFunction.h
Line 2205 in 24b2455
What confuses me is what is the expected CIR generated for the above code. A direct idea may be:
"cir.switch"(%value) (
case (equal, 1) {
codes for case 1
},
case (default) {
// codes for default case
"cir.scope"() {
// codes for if
if (v > 5)
cir.br ^bb2
return 47
}
},
case (equal, 2) {
// codes fro case2
^bb2:
return 35
})
I am hesitating since in
clangir/clang/lib/CIR/CodeGen/CIRGenFunction.h
Line 2171 in 24b2455
Metadata
Metadata
Assignees
Labels
No labels