You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CIR][CodeGen] Handle the case of 'case' after label statement after 'case' (#879)
Motivation example:
```
extern "C" void action1();
extern "C" void action2();
extern "C" void case_follow_label(int v) {
switch (v) {
case 1:
label:
case 2:
action1();
break;
default:
action2();
goto label;
}
}
```
When we compile it, we will meet:
```
case Stmt::CaseStmtClass:
case Stmt::DefaultStmtClass:
assert(0 &&
"Should not get here, currently handled directly from SwitchStmt");
break;
```
in `buildStmt`. The cause is clear. We call `buildStmt` when we build
the label stmt.
To solve this, I think we should be able to build case stmt in
buildStmt. But the new problem is, we need to pass the information like
caseAttr and condType. So I tried to add such informations in
CIRGenFunction as data member.
0 commit comments