Commit 94a44d7
authored
[QoL][Relax] Return well-formed IR from relax::Function::CreateEmpty (#16861)
Prior to this commit, the static method `relax::Function::CreateEmpty`
returned a function with a nullptr as the body. While only intended for use in
bookkeeping for TVMScript, allowing nullptr in this location can cause
unexpected segfaults while debugging. For example, adding a print
statement
This commit updates the `relax::Function::CreateEmpty` function to
contain a placeholder body, consistent with the `ret_struct_info`
argument provided.1 parent 4cb4605 commit 94a44d7
2 files changed
+21
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1045 | 1045 | | |
1046 | 1046 | | |
1047 | 1047 | | |
| 1048 | + | |
| 1049 | + | |
1048 | 1050 | | |
1049 | 1051 | | |
1050 | 1052 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
562 | 570 | | |
563 | 571 | | |
564 | 572 | | |
565 | | - | |
| 573 | + | |
566 | 574 | | |
567 | 575 | | |
568 | 576 | | |
| |||
602 | 610 | | |
603 | 611 | | |
604 | 612 | | |
605 | | - | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
606 | 621 | | |
607 | 622 | | |
608 | 623 | | |
609 | | - | |
610 | | - | |
611 | | - | |
| 624 | + | |
| 625 | + | |
612 | 626 | | |
613 | 627 | | |
614 | 628 | | |
| |||
0 commit comments