fn setTryBody(gz: *GenZir, inst: Zir.Inst.Index, operand: Zir.Inst.Ref) !void 11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498 fn setTryBody(gz: *GenZir, inst: Zir.Inst.Index, operand: Zir.Inst.Ref) !void {
const astgen = gz.astgen;
const gpa = astgen.gpa;
const body = gz.instructionsSlice();
const body_len = astgen.countBodyLenAfterFixups(body);
try astgen.extra.ensureUnusedCapacity(
gpa,
@typeInfo(Zir.Inst.Try).@"struct".field_names.len + body_len,
);
const zir_datas = astgen.instructions.items(.data);
zir_datas[@backingInt(inst)].pl_node.payload_index = astgen.addExtraAssumeCapacity(
Zir.Inst.Try{
.operand = operand,
.body_len = body_len,
},
);
astgen.appendBodyWithFixups(body);
gz.unstack();
}
Assumes nothing stacked on
gz. Unstacksgz.