Function debugValue [src]

Prototype

pub fn debugValue(self: *WipFunction, value: Value) Allocator.Error!Metadata

Parameters

self: *WipFunctionvalue: Value

Source

pub fn debugValue(self: *WipFunction, value: Value) Allocator.Error!Metadata { if (self.strip) return .none; return switch (value.unwrap()) { .instruction => |instr_index| blk: { const gop = try self.debug_values.getOrPut(self.builder.gpa, instr_index); const metadata: Metadata = @enumFromInt(Metadata.first_local_metadata + gop.index); if (!gop.found_existing) gop.key_ptr.* = instr_index; break :blk metadata; }, .constant => |constant| try self.builder.metadataConstant(constant), .metadata => |metadata| metadata, }; }