Andrew Kelley
dfb3231959
stage2: implement switching on unions
...
* AstGen: Move `refToIndex` and `indexToRef` to Zir
* ZIR: the switch_block_*_* instruction tags are collapsed into one
switch_block tag which uses 4 bits for flags, and reduces the
scalar_cases_len field from 32 to 28 bits.
This freed up more ZIR tags, 2 of which are now used for
`switch_cond` and `switch_cond_ref` for producing the switch
condition value. For example, for union values it returns the
corresponding enum value.
* switching with multiple cases and ranges is not yet supported because
I want to change the ZIR encoding to store index pointers into the
extra array rather than storing prong indexes. This will avoid O(N^2)
iteration over prongs.
* AstGen now adds a `switch_cond` on the operand and then passes the
result of that to the `switch_block` instruction.
* Sema: partially implement `switch_capture_*` instructions.
* Sema: `unionToTag` notices if the enum type has only one possible value.
2021-10-19 20:22:47 -07:00
..
2021-10-18 13:18:47 -04:00
2021-04-29 15:54:04 -07:00
2021-04-29 15:54:04 -07:00
2021-04-29 15:54:04 -07:00
2021-04-29 15:54:04 -07:00
2021-09-01 17:54:07 -07:00
2021-06-21 17:03:03 -07:00
2021-05-08 14:45:21 -07:00
2021-10-13 21:20:38 -07:00
2021-10-13 21:20:38 -07:00
2021-10-04 23:48:55 -07:00
2021-06-21 17:03:03 -07:00
2021-10-13 18:43:43 -07:00
2021-06-21 17:03:03 -07:00
2021-10-15 17:17:59 -07:00
2021-06-21 17:03:03 -07:00
2021-10-04 23:30:04 -07:00
2021-10-04 23:30:04 -07:00
2021-05-08 14:45:21 -07:00
2021-08-01 12:36:04 -07:00
2021-09-01 15:41:29 -07:00
2021-05-08 14:45:21 -07:00
2021-10-02 20:15:03 -07:00
2021-10-02 20:15:03 -07:00
2021-10-02 20:15:03 -07:00
2021-10-02 20:15:03 -07:00
2021-08-30 18:50:07 -04:00
2021-10-02 20:15:03 -07:00
2021-10-02 20:15:03 -07:00
2021-10-02 20:15:03 -07:00
2021-10-05 23:05:14 -07:00
2021-10-05 21:38:47 -07:00
2021-10-17 15:36:12 -07:00
2021-10-17 15:36:12 -07:00
2021-10-14 22:16:26 -07:00
2021-10-14 22:16:26 -07:00
2021-05-08 14:45:21 -07:00
2021-05-08 14:45:21 -07:00
2021-05-08 14:45:21 -07:00
2021-05-08 14:45:21 -07:00
2021-06-21 17:03:03 -07:00
2021-10-02 20:15:03 -07:00
2021-10-02 20:15:03 -07:00
2021-09-28 12:00:35 -05:00
2021-09-28 12:00:35 -05:00
2021-05-08 14:45:21 -07:00
2021-05-08 14:45:21 -07:00
2021-10-02 20:15:03 -07:00
2021-10-02 20:15:03 -07:00
2021-06-21 17:03:03 -07:00
2021-05-08 14:45:21 -07:00
2021-06-21 17:03:03 -07:00
2021-06-21 17:03:03 -07:00
2021-10-17 20:33:04 +02:00
2021-10-17 20:33:04 +02:00
2021-10-14 21:17:30 -07:00
2021-09-28 12:00:35 -05:00
2021-04-29 15:54:04 -07:00
2021-10-14 22:16:26 -07:00
2021-10-05 16:56:46 -07:00
2021-10-04 23:48:55 -07:00
2021-10-17 17:02:20 -07:00
2021-10-17 17:02:20 -07:00
2021-10-15 18:37:09 -07:00
2021-10-15 18:37:09 -07:00
2021-10-17 19:10:49 -07:00
2021-10-17 19:10:49 -07:00
2021-09-01 15:41:29 -07:00
2021-05-08 14:45:21 -07:00
2021-05-08 14:45:21 -07:00
2021-05-08 14:45:21 -07:00
2021-06-21 17:03:03 -07:00
2021-10-04 12:23:49 -07:00
2021-07-26 20:05:48 -04:00
2021-09-01 15:41:29 -07:00
2021-10-04 23:48:55 -07:00
2021-10-04 23:48:55 -07:00
2021-06-21 17:03:03 -07:00
2021-10-14 22:16:26 -07:00
2021-10-13 16:31:07 -07:00
2021-05-08 14:45:21 -07:00
2021-05-08 14:45:21 -07:00
2021-05-08 14:45:21 -07:00
2021-10-11 11:39:12 -07:00
2021-10-11 11:39:12 -07:00
2021-05-08 14:45:21 -07:00
2021-05-08 14:45:21 -07:00
2021-10-02 20:15:03 -07:00
2021-10-02 20:15:03 -07:00
2021-09-23 13:17:06 -04:00
2021-09-20 20:51:31 -07:00
2021-08-06 09:10:50 +03:00
2021-09-20 20:51:31 -07:00
2021-07-06 12:42:18 +03:00
2021-05-08 14:45:21 -07:00
2021-06-21 17:03:03 -07:00
2021-06-21 17:03:03 -07:00
2021-09-20 02:29:04 +02:00
2021-07-28 18:17:11 -04:00
2021-05-08 14:45:21 -07:00
2021-10-02 20:15:03 -07:00
2021-10-19 20:22:47 -07:00
2021-10-02 20:15:03 -07:00
2021-10-19 20:22:47 -07:00
2021-09-01 17:54:07 -07:00
2021-09-01 17:54:06 -07:00
2021-06-21 17:03:03 -07:00
2021-10-04 23:48:55 -07:00
2021-06-21 17:03:03 -07:00
2021-05-08 14:45:21 -07:00
2021-10-14 22:16:26 -07:00
2021-10-14 22:16:26 -07:00
2021-10-13 18:43:43 -07:00