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

toNewVariable

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

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

Params

File

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