unionstd.zig.llvm.Builder.DebugLocation[src]

Fields

no_location: void
location: Location

Functions

FunctiontoMetadata[src]

pub fn toMetadata(self: DebugLocation, builder: *Builder) Allocator.Error!Metadata

Parameters

builder: *Builder

Source Code

Source code
pub fn toMetadata(self: DebugLocation, builder: *Builder) Allocator.Error!Metadata {
    return switch (self) {
        .no_location => .none,
        .location => |location| try builder.debugLocation(
            location.line,
            location.column,
            location.scope,
            location.inlined_at,
        ),
    };
}

Source Code

Source code
pub const DebugLocation = union(enum) {
    no_location: void,
    location: Location,

    pub const Location = struct {
        line: u32,
        column: u32,
        scope: Builder.Metadata,
        inlined_at: Builder.Metadata,
    };

    pub fn toMetadata(self: DebugLocation, builder: *Builder) Allocator.Error!Metadata {
        return switch (self) {
            .no_location => .none,
            .location => |location| try builder.debugLocation(
                location.line,
                location.column,
                location.scope,
                location.inlined_at,
            ),
        };
    }
}