Commit 49ab600
committed
[compiler] Add fallthrough to branch terminal
Branch terminals didn't have a fallthrough because they correspond to an outer terminal (optional, logical, etc) that has the "real" fallthrough. But understanding how branch terminals correspond to these outer terminals requires knowing the branch fallthrough. For example, `foo?.bar?.baz` creates terminals along the lines of:
```
bb0:
optional fallthrough=bb4
bb1:
optional fallthrough=bb3
bb2:
...
branch ... (fallthrough=bb3)
...
bb3:
...
branch ... (fallthrough=bb4)
...
bb4:
...
```
Without a fallthrough on `branch` terminals, it's unclear that the optional from bb0 has its branch node in bb3. With the fallthroughs, we can see look for a branch with the same fallthrough as the outer optional terminal to match them up.
ghstack-source-id: 064178d
Pull Request resolved: facebook/react#308141 parent 7212340 commit 49ab600
File tree
5 files changed
+24
-7
lines changed- compiler/packages/babel-plugin-react-compiler/src
- HIR
- Inference
- ReactiveScopes
5 files changed
+24
-7
lines changedLines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
| 610 | + | |
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
| |||
656 | 657 | | |
657 | 658 | | |
658 | 659 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | 660 | | |
664 | 661 | | |
665 | 662 | | |
666 | 663 | | |
667 | 664 | | |
668 | 665 | | |
| 666 | + | |
669 | 667 | | |
670 | 668 | | |
671 | 669 | | |
| |||
975 | 973 | | |
976 | 974 | | |
977 | 975 | | |
| 976 | + | |
978 | 977 | | |
979 | 978 | | |
980 | 979 | | |
| |||
1118 | 1117 | | |
1119 | 1118 | | |
1120 | 1119 | | |
| 1120 | + | |
1121 | 1121 | | |
1122 | 1122 | | |
1123 | 1123 | | |
| |||
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
| 1206 | + | |
1206 | 1207 | | |
1207 | 1208 | | |
1208 | 1209 | | |
| |||
1800 | 1801 | | |
1801 | 1802 | | |
1802 | 1803 | | |
| 1804 | + | |
1803 | 1805 | | |
1804 | 1806 | | |
1805 | 1807 | | |
| |||
1878 | 1880 | | |
1879 | 1881 | | |
1880 | 1882 | | |
| 1883 | + | |
1881 | 1884 | | |
1882 | 1885 | | |
1883 | 1886 | | |
| |||
2611 | 2614 | | |
2612 | 2615 | | |
2613 | 2616 | | |
| 2617 | + | |
2614 | 2618 | | |
2615 | 2619 | | |
2616 | 2620 | | |
| |||
2750 | 2754 | | |
2751 | 2755 | | |
2752 | 2756 | | |
| 2757 | + | |
2753 | 2758 | | |
2754 | 2759 | | |
2755 | 2760 | | |
| |||
4025 | 4030 | | |
4026 | 4031 | | |
4027 | 4032 | | |
| 4033 | + | |
4028 | 4034 | | |
4029 | 4035 | | |
4030 | 4036 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
| 494 | + | |
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| 663 | + | |
663 | 664 | | |
664 | 665 | | |
665 | 666 | | |
666 | 667 | | |
667 | 668 | | |
| 669 | + | |
668 | 670 | | |
669 | 671 | | |
670 | 672 | | |
| |||
883 | 885 | | |
884 | 886 | | |
885 | 887 | | |
886 | | - | |
887 | 888 | | |
888 | 889 | | |
889 | 890 | | |
| |||
892 | 893 | | |
893 | 894 | | |
894 | 895 | | |
| 896 | + | |
895 | 897 | | |
896 | 898 | | |
897 | 899 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
0 commit comments