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

debugValue

Public Function
std.zig.llvm.Builder.WipFunction.debugValue
pub fn debugValue(self: *WipFunction, value: Value) Allocator.Error!Metadata.Optional

Params

File

zig/llvm/Builder.zig:7393
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
    pub fn debugValue(self: *WipFunction, value: Value) Allocator.Error!Metadata.Optional {
        if (self.strip) return .none;
        const metadata: Metadata = metadata: switch (value.unwrap()) {
            .instruction => |instr_index| {
                const gop = try self.debug_values.getOrPut(self.builder.gpa, instr_index);
                if (!gop.found_existing) gop.key_ptr.* = instr_index;
                break :metadata .{ .index = @intCast(gop.index), .kind = .local };
            },
            .constant => |constant| try self.builder.metadataConstant(constant),
            .metadata => |metadata| metadata,
        };
        return metadata.toOptional();
    }