pub fn toNewFunction(global: Index, builder: *Builder) Allocator.Error!Function.Index 3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416 pub fn toNewFunction(global: Index, builder: *Builder) Allocator.Error!Function.Index {
try builder.functions.ensureUnusedCapacity(builder.gpa, 1);
errdefer comptime unreachable;
const function: Function.Index = @fromBackingInt(@intCast(builder.functions.items.len));
builder.functions.appendAssumeCapacity(.{
.global = global,
.strip = undefined,
});
global.ptr(builder).kind = .{ .function = function };
return function;
}
Replaces whatever this
Globalcurrently contains with a newFunction. Similar toBuilder.addFunction, but the sameGlobalis reused.