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(
60166016 break :blk &case_scope.base;
60176017 }
60186018 const capture = if (case_node == special_node) capture: {
6019 const capture_tag: Zir.Inst.Tag = if (is_ptr)
6020 .switch_capture_else_ref
6021 else
6022 .switch_capture_else;
6023 break :capture try case_scope.add(.{
6024 .tag = capture_tag,
6025 .data = .{ .switch_capture = .{
6026 .switch_inst = switch_block,
6027 .prong_index = undefined,
6028 } },
6029 });
6019 const capture_tag: Zir.Inst.Tag = if (is_ptr)
6020 .switch_capture_else_ref
6021 else
6022 .switch_capture_else;
6023 break :capture try case_scope.add(.{
6024 .tag = capture_tag,
6025 .data = .{ .switch_capture = .{
6026 .switch_inst = switch_block,
6027 .prong_index = undefined,
6028 } },
6029 });
60306030 } else capture: {
60316031 const is_multi_case_bits: u2 = @boolToInt(is_multi_case);
60326032 const is_ptr_bits: u2 = @boolToInt(is_ptr);
......@@ -6160,8 +6160,7 @@ fn switchExpr(
61606160 const zir_datas = astgen.instructions.items(.data);
61616161 zir_datas[switch_block].pl_node.payload_index = @intCast(u32, payload_index);
61626162 // Documentation for this: `Zir.Inst.SwitchBlock` and `Zir.Inst.SwitchBlockMulti`.
6163 try astgen.extra.ensureUnusedCapacity(gpa,
6164 @as(usize, 2) + // operand, scalar_cases_len
6163 try astgen.extra.ensureUnusedCapacity(gpa, @as(usize, 2) + // operand, scalar_cases_len
61656164 @boolToInt(multi_cases_len != 0) +
61666165 special_case_payload.items.len +
61676166 scalar_cases_payload.items.len +