Commit ab83d90
committed
Sema: Fix cycle between closure type computation and EmittedMembersRequest
EmittedMembersRequest needs a stable order for synthesized members
to ensure that vtable layout is computed consistently across frontend
jobs. This used to use the mangled name as the sort key.
However, the mangling includes the type of all outer contexts, and if
an outer type is a closure, we would need to compute the type of the
closure. Computing the type of a closure might require type checking
its body though, which would in turn type check the local class, which
would invoke EmittedMembersRequest, introducing a cycle.
Instead, let's use the DeclName and string-ified type as the sort key.
This is simpler to compute than th mangled name, and breaks the cycle.
Fixes <rdar://problem/67842221>.1 parent 6cad1c2 commit ab83d90
File tree
3 files changed
+26
-11
lines changed- lib/Sema
- test/multifile
- Inputs
3 files changed
+26
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
2463 | 2462 | | |
2464 | 2463 | | |
2465 | 2464 | | |
2466 | | - | |
| 2465 | + | |
| 2466 | + | |
2467 | 2467 | | |
2468 | 2468 | | |
2469 | 2469 | | |
2470 | 2470 | | |
2471 | | - | |
2472 | | - | |
2473 | | - | |
2474 | | - | |
2475 | | - | |
2476 | | - | |
2477 | | - | |
2478 | | - | |
| 2471 | + | |
2479 | 2472 | | |
2480 | | - | |
| 2473 | + | |
| 2474 | + | |
2481 | 2475 | | |
2482 | 2476 | | |
2483 | 2477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments