| ... | @@ -2475,7 +2475,7 @@ struct IrBasicBlockGen { | ... | @@ -2475,7 +2475,7 @@ struct IrBasicBlockGen { |
| 2475 | // Src instructions are generated by ir_gen_* functions in ir.cpp from AST. | 2475 | // Src instructions are generated by ir_gen_* functions in ir.cpp from AST. |
| 2476 | // ir_analyze_* functions consume Src instructions and produce Gen instructions. | 2476 | // ir_analyze_* functions consume Src instructions and produce Gen instructions. |
| 2477 | // Src instructions do not have type information; Gen instructions do. | 2477 | // Src instructions do not have type information; Gen instructions do. |
| 2478 | enum IrInstSrcId { | 2478 | enum IrInstSrcId : uint8_t { |
| 2479 | IrInstSrcIdInvalid, | 2479 | IrInstSrcIdInvalid, |
| 2480 | IrInstSrcIdDeclVar, | 2480 | IrInstSrcIdDeclVar, |
| 2481 | IrInstSrcIdBr, | 2481 | IrInstSrcIdBr, |
| ... | @@ -2620,7 +2620,7 @@ enum IrInstSrcId { | ... | @@ -2620,7 +2620,7 @@ enum IrInstSrcId { |
| 2620 | | 2620 | |
| 2621 | // ir_render_* functions in codegen.cpp consume Gen instructions and produce LLVM IR. | 2621 | // ir_render_* functions in codegen.cpp consume Gen instructions and produce LLVM IR. |
| 2622 | // Src instructions do not have type information; Gen instructions do. | 2622 | // Src instructions do not have type information; Gen instructions do. |
| 2623 | enum IrInstGenId { | 2623 | enum IrInstGenId : uint8_t { |
| 2624 | IrInstGenIdInvalid, | 2624 | IrInstGenIdInvalid, |
| 2625 | IrInstGenIdDeclVar, | 2625 | IrInstGenIdDeclVar, |
| 2626 | IrInstGenIdBr, | 2626 | IrInstGenIdBr, |
| ... | @@ -2714,14 +2714,13 @@ enum IrInstGenId { | ... | @@ -2714,14 +2714,13 @@ enum IrInstGenId { |
| 2714 | }; | 2714 | }; |
| 2715 | | 2715 | |
| 2716 | struct IrInstSrc { | 2716 | struct IrInstSrc { |
| 2717 | uint32_t ref_count; | 2717 | IrInstSrcId id; |
| | 2718 | uint16_t ref_count; |
| 2718 | uint32_t debug_id; | 2719 | uint32_t debug_id; |
| 2719 | | 2720 | |
| 2720 | Scope *scope; | 2721 | Scope *scope; |
| 2721 | AstNode *source_node; | 2722 | AstNode *source_node; |
| 2722 | | 2723 | |
| 2723 | IrInstSrcId id; | | |
| 2724 | | | |
| 2725 | // When analyzing IR, instructions that point to this instruction in the "old ir" | 2724 | // When analyzing IR, instructions that point to this instruction in the "old ir" |
| 2726 | // can find the instruction that corresponds to this value in the "new ir" | 2725 | // can find the instruction that corresponds to this value in the "new ir" |
| 2727 | // with this child field. | 2726 | // with this child field. |
| ... | @@ -2737,7 +2736,7 @@ struct IrInstGen { | ... | @@ -2737,7 +2736,7 @@ struct IrInstGen { |
| 2737 | IrInstGenId id; | 2736 | IrInstGenId id; |
| 2738 | // if ref_count is zero and the instruction has no side effects, | 2737 | // if ref_count is zero and the instruction has no side effects, |
| 2739 | // the instruction can be omitted in codegen | 2738 | // the instruction can be omitted in codegen |
| 2740 | uint32_t ref_count; | 2739 | uint16_t ref_count; |
| 2741 | uint32_t debug_id; | 2740 | uint32_t debug_id; |
| 2742 | | 2741 | |
| 2743 | Scope *scope; | 2742 | Scope *scope; |