authorgravatar for matthew.h.borkowski@gmail.comMatthew Borkowski <matthew.h.borkowski@gmail.com> 2021-10-02 11:44:51-04:00
committergravatar for matthew.h.borkowski@gmail.comMatthew Borkowski <matthew.h.borkowski@gmail.com> 2021-10-02 11:44:51-04:00
logbb3ef76434bf365ca6beb6a0709bcde251b0f771
tree78ee298b4e2bcfe8bbb072b55dc46cec5b8bb579
parentada72c7aa91600f6bbc7d45f6efe09d6104dc93a

astgen.zig formatting


1 files changed, 12 insertions(+), 13 deletions(-)

src/AstGen.zig+12-13
...@@ -6016,17 +6016,17 @@ fn switchExpr(...@@ -6016,17 +6016,17 @@ fn switchExpr(
6016 break :blk &case_scope.base;6016 break :blk &case_scope.base;
6017 }6017 }
6018 const capture = if (case_node == special_node) capture: {6018 const capture = if (case_node == special_node) capture: {
6019 const capture_tag: Zir.Inst.Tag = if (is_ptr)6019 const capture_tag: Zir.Inst.Tag = if (is_ptr)
6020 .switch_capture_else_ref6020 .switch_capture_else_ref
6021 else6021 else
6022 .switch_capture_else;6022 .switch_capture_else;
6023 break :capture try case_scope.add(.{6023 break :capture try case_scope.add(.{
6024 .tag = capture_tag,6024 .tag = capture_tag,
6025 .data = .{ .switch_capture = .{6025 .data = .{ .switch_capture = .{
6026 .switch_inst = switch_block,6026 .switch_inst = switch_block,
6027 .prong_index = undefined,6027 .prong_index = undefined,
6028 } },6028 } },
6029 });6029 });
6030 } else capture: {6030 } else capture: {
6031 const is_multi_case_bits: u2 = @boolToInt(is_multi_case);6031 const is_multi_case_bits: u2 = @boolToInt(is_multi_case);
6032 const is_ptr_bits: u2 = @boolToInt(is_ptr);6032 const is_ptr_bits: u2 = @boolToInt(is_ptr);
...@@ -6160,8 +6160,7 @@ fn switchExpr(...@@ -6160,8 +6160,7 @@ fn switchExpr(
6160 const zir_datas = astgen.instructions.items(.data);6160 const zir_datas = astgen.instructions.items(.data);
6161 zir_datas[switch_block].pl_node.payload_index = @intCast(u32, payload_index);6161 zir_datas[switch_block].pl_node.payload_index = @intCast(u32, payload_index);
6162 // Documentation for this: `Zir.Inst.SwitchBlock` and `Zir.Inst.SwitchBlockMulti`.6162 // Documentation for this: `Zir.Inst.SwitchBlock` and `Zir.Inst.SwitchBlockMulti`.
6163 try astgen.extra.ensureUnusedCapacity(gpa,6163 try astgen.extra.ensureUnusedCapacity(gpa, @as(usize, 2) + // operand, scalar_cases_len
6164 @as(usize, 2) + // operand, scalar_cases_len
6165 @boolToInt(multi_cases_len != 0) +6164 @boolToInt(multi_cases_len != 0) +
6166 special_case_payload.items.len +6165 special_case_payload.items.len +
6167 scalar_cases_payload.items.len +6166 scalar_cases_payload.items.len +