fn makeBlockInst(gz: *GenZir, tag: Zir.Inst.Tag, node: Ast.Node.Index) !Zir.Inst.Index 12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384 fn makeBlockInst(gz: *GenZir, tag: Zir.Inst.Tag, node: Ast.Node.Index) !Zir.Inst.Index {
const new_index: Zir.Inst.Index = @fromBackingInt(@intCast(gz.astgen.instructions.len));
const gpa = gz.astgen.gpa;
try gz.astgen.instructions.append(gpa, .{
.tag = tag,
.data = .{ .pl_node = .{
.src_node = gz.nodeIndexToRelative(node),
.payload_index = undefined,
} },
});
return new_index;
}
Note that this returns a
Zir.Inst.Indexnot a ref. Does not append the block instruction to the scope. Leaves thepayload_indexfield undefined.