Commit 2947f38
authored
[CIR][CodeGen] Support return in TryOp (#1398)
This PR adds support for returns inside of a TryOp, for example:
```
void foo() {
int r = 1;
try {
return;
++r;
} catch (...) {
}
}
```
Currently, it fails during the CodeGen with:
```
error: 'cir.return' op expects parent op to be one of 'cir.func, cir.scope, cir.if, cir.switch, cir.do, cir.while, cir.for, cir.case'
```
were TryOp's omitted on purpose?1 parent d44a8e7 commit 2947f38
File tree
2 files changed
+23
-1
lines changed- clang
- include/clang/CIR/Dialect/IR
- test/CIR/CodeGen
2 files changed
+23
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
687 | | - | |
| 687 | + | |
| 688 | + | |
688 | 689 | | |
689 | 690 | | |
690 | 691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
0 commit comments