| ... | ... | @@ -4481,11 +4481,18 @@ fn findTrackableInner( |
| 4481 | 4481 | .func, |
| 4482 | 4482 | .func_inferred, |
| 4483 | 4483 | => { |
| 4484 | const inst_data = datas[@intFromEnum(inst)].pl_node; |
| 4485 | const extra = zir.extraData(Inst.Func, inst_data.payload_index); |
| 4486 | |
| 4487 | if (extra.data.body_len == 0) { |
| 4488 | // This is just a prototype. No need to track. |
| 4489 | assert(extra.data.ret_body_len < 2); |
| 4490 | return; |
| 4491 | } |
| 4492 | |
| 4484 | 4493 | assert(contents.func_decl == null); |
| 4485 | 4494 | contents.func_decl = inst; |
| 4486 | 4495 | |
| 4487 | | const inst_data = datas[@intFromEnum(inst)].pl_node; |
| 4488 | | const extra = zir.extraData(Inst.Func, inst_data.payload_index); |
| 4489 | 4496 | var extra_index: usize = extra.end; |
| 4490 | 4497 | switch (extra.data.ret_body_len) { |
| 4491 | 4498 | 0 => {}, |
| ... | ... | @@ -4500,11 +4507,19 @@ fn findTrackableInner( |
| 4500 | 4507 | return zir.findTrackableBody(gpa, contents, defers, body); |
| 4501 | 4508 | }, |
| 4502 | 4509 | .func_fancy => { |
| 4510 | const inst_data = datas[@intFromEnum(inst)].pl_node; |
| 4511 | const extra = zir.extraData(Inst.FuncFancy, inst_data.payload_index); |
| 4512 | |
| 4513 | if (extra.data.body_len == 0) { |
| 4514 | // This is just a prototype. No need to track. |
| 4515 | assert(!extra.data.bits.has_cc_body); |
| 4516 | assert(!extra.data.bits.has_ret_ty_body); |
| 4517 | return; |
| 4518 | } |
| 4519 | |
| 4503 | 4520 | assert(contents.func_decl == null); |
| 4504 | 4521 | contents.func_decl = inst; |
| 4505 | 4522 | |
| 4506 | | const inst_data = datas[@intFromEnum(inst)].pl_node; |
| 4507 | | const extra = zir.extraData(Inst.FuncFancy, inst_data.payload_index); |
| 4508 | 4523 | var extra_index: usize = extra.end; |
| 4509 | 4524 | |
| 4510 | 4525 | if (extra.data.bits.has_cc_body) { |
| ... | ... | @@ -5026,10 +5041,16 @@ pub fn assertTrackable(zir: Zir, inst_idx: Zir.Inst.Index) void { |
| 5026 | 5041 | .struct_init_ref, |
| 5027 | 5042 | .struct_init_anon, |
| 5028 | 5043 | => {}, // tracked in order, as the owner instructions of anonymous struct types |
| 5029 | | .func, |
| 5030 | | .func_inferred, |
| 5031 | | .func_fancy, |
| 5032 | | => {}, // tracked in order, as the owner instructions of function bodies |
| 5044 | .func, .func_inferred => { |
| 5045 | // These are tracked provided they are actual function declarations, not just bodies. |
| 5046 | const extra = zir.extraData(Inst.Func, inst.data.pl_node.payload_index); |
| 5047 | assert(extra.data.body_len != 0); |
| 5048 | }, |
| 5049 | .func_fancy => { |
| 5050 | // These are tracked provided they are actual function declarations, not just bodies. |
| 5051 | const extra = zir.extraData(Inst.FuncFancy, inst.data.pl_node.payload_index); |
| 5052 | assert(extra.data.body_len != 0); |
| 5053 | }, |
| 5033 | 5054 | .declaration => {}, // tracked by correlating names in the namespace of the parent container |
| 5034 | 5055 | .extended => switch (inst.data.extended.opcode) { |
| 5035 | 5056 | .struct_decl, |