Commit afde518
committed
[CIR] Remove return !cir.void from IR and textual representation
C/C++ functions returning void had an explicit !cir.void return type while not
having any returned value, which was breaking a lot of MLIR invariants when the
CIR dialect is used in a greater context, for example with the inliner.
Now, a C/C++ function returning void has no return type and no return values,
which does not break the MLIR invariant about the same number of return types
and returned values.
This change does not keeps the same parsing/pretty-printed syntax as before for
compatibility like in #1203 because it
requires some new features from the MLIR parser infrastructure itself, which is
not great.
For now use a list of return types.1 parent aceb0b0 commit afde518
File tree
7 files changed
+58
-24
lines changed- clang
- include/clang/CIR/Dialect/IR
- lib/CIR
- CodeGen
- Dialect
- IR
- Transforms/TargetLowering
- test/CIR/IR
7 files changed
+58
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3474 | 3474 | | |
3475 | 3475 | | |
3476 | 3476 | | |
3477 | | - | |
3478 | | - | |
3479 | 3477 | | |
3480 | 3478 | | |
3481 | 3479 | | |
| |||
3492 | 3490 | | |
3493 | 3491 | | |
3494 | 3492 | | |
3495 | | - | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
3496 | 3496 | | |
3497 | | - | |
3498 | | - | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
3499 | 3502 | | |
3500 | 3503 | | |
3501 | 3504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
386 | 387 | | |
387 | | - | |
| 388 | + | |
388 | 389 | | |
389 | 390 | | |
390 | | - | |
| 391 | + | |
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
| 395 | + | |
394 | 396 | | |
395 | 397 | | |
396 | 398 | | |
397 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
398 | 403 | | |
399 | 404 | | |
400 | 405 | | |
| |||
408 | 413 | | |
409 | 414 | | |
410 | 415 | | |
411 | | - | |
412 | | - | |
413 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
414 | 419 | | |
415 | | - | |
| 420 | + | |
416 | 421 | | |
417 | 422 | | |
418 | 423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2489 | 2489 | | |
2490 | 2490 | | |
2491 | 2491 | | |
2492 | | - | |
2493 | | - | |
2494 | | - | |
2495 | | - | |
2496 | | - | |
2497 | | - | |
2498 | | - | |
| 2492 | + | |
| 2493 | + | |
2499 | 2494 | | |
2500 | 2495 | | |
2501 | 2496 | | |
| |||
2564 | 2559 | | |
2565 | 2560 | | |
2566 | 2561 | | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
2567 | 2567 | | |
2568 | 2568 | | |
2569 | 2569 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
957 | 958 | | |
958 | 959 | | |
959 | 960 | | |
960 | | - | |
961 | | - | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
962 | 967 | | |
963 | 968 | | |
964 | | - | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
965 | 977 | | |
966 | 978 | | |
967 | 979 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments