Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

toNewFunction

Public Function
std.zig.llvm.Builder.Global.Index.toNewFunction
pub fn toNewFunction(global: Index, builder: *Builder) Allocator.Error!Function.Index

Replaces whatever this Global currently contains with a new Function. Similar to Builder.addFunction, but the same Global is reused.

Params

File

zig/llvm/Builder.zig:3406
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;
        }