DoxigAlpha

Function parameters

Parameters

#
value:anytype

Expressions can be evaluated in different contexts, each requiring its own set of inputs.

Types

#
Context
Expressions can be evaluated in different contexts, each requiring its own set of inputs.

A stack machine that can decode and run DWARF expressions.

Functions

#
StackMachine
A stack machine that can decode and run DWARF expressions.

Error sets in this namespace

Error Sets

#

Source

Implementation

#
fn generic(value: anytype) Operand {
    const int_info = @typeInfo(@TypeOf(value)).int;
    if (@sizeOf(@TypeOf(value)) > options.addr_size) {
        return .{ .generic = switch (int_info.signedness) {
            .signed => @bitCast(@as(addr_type_signed, @truncate(value))),
            .unsigned => @truncate(value),
        } };
    } else {
        return .{ .generic = switch (int_info.signedness) {
            .signed => @bitCast(@as(addr_type_signed, @intCast(value))),
            .unsigned => @intCast(value),
        } };
    }
}