fn countBodyLenAfterFixupsExtraRefs(astgen: *AstGen, body: []const Zir.Inst.Index, extra_refs: []const Zir.Inst.Index) u32 13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257fn countBodyLenAfterFixupsExtraRefs(astgen: *AstGen, body: []const Zir.Inst.Index, extra_refs: []const Zir.Inst.Index) u32 {
var count = body.len;
for (body) |body_inst| {
var check_inst = body_inst;
while (astgen.ref_table.get(check_inst)) |ref_inst| {
count += 1;
check_inst = ref_inst;
}
}
for (extra_refs) |extra_inst| {
var check_inst = extra_inst;
while (astgen.ref_table.get(check_inst)) |ref_inst| {
count += 1;
check_inst = ref_inst;
}
}
return @intCast(count);
}
Return the number of instructions in
bodyafter prepending therefinstructions inref_table. As well as all instructions inbody, we also prependrefs of any instruction inextra_refs. For instance, if an index has been reserved with a special meaning to a child block, it must be passed toextra_refsto ensurerefs of that index are added correctly.