Commit 02bef56
authored
The `cir.va_arg` lowering may introduce an if-else control flow.
This breaks the verifier for control flow operations, e.g., `cir.for`,
where there can be only one block inside of the `cond` and `step`
regions.
This PR wraps the lowered code in a `cir.scope` (only if it will lower
to the if-else control flow). A
dded a test for `va_arg` inside for loop condition, the basic pattern
is: `for (; va_arg(...););`
1 parent ccb0498 commit 02bef56
File tree
2 files changed
+46
-8
lines changed- clang
- lib/CIR/Dialect/Transforms/TargetLowering/Targets
- test/CIR/Lowering
2 files changed
+46
-8
lines changedLines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
133 | 144 | | |
134 | 145 | | |
135 | 146 | | |
| |||
163 | 174 | | |
164 | 175 | | |
165 | 176 | | |
166 | | - | |
167 | 177 | | |
168 | 178 | | |
169 | 179 | | |
| |||
338 | 348 | | |
339 | 349 | | |
340 | 350 | | |
341 | | - | |
| 351 | + | |
342 | 352 | | |
343 | 353 | | |
344 | 354 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
349 | 364 | | |
350 | 365 | | |
351 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
185 | 188 | | |
186 | 189 | | |
187 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
0 commit comments