pub fn toNewVariable(global: Index, builder: *Builder) Allocator.Error!Variable.Index 3420
3421
3422
3423
3424
3425
3426
3427 pub fn toNewVariable(global: Index, builder: *Builder) Allocator.Error!Variable.Index {
try builder.variables.ensureUnusedCapacity(builder.gpa, 1);
errdefer comptime unreachable;
const variable: Variable.Index = @fromBackingInt(@intCast(builder.variables.items.len));
builder.variables.appendAssumeCapacity(.{ .global = global });
global.ptr(builder).kind = .{ .variable = variable };
return variable;
}
Replaces whatever this
Globalcurrently contains with a newVariable. Similar toBuilder.addVariable, but the sameGlobalis reused.