Module Sarek_ppx_lib.Sarek_native_helpers

Location Conversion

val ppxlib_loc_of_sarek : Sarek_ast.loc -> Ppxlib.location

Convert Sarek_ast.loc to Ppxlib.location

Expression Helpers

val evar : loc:Ppxlib__.Location.t -> string -> Ppxlib__.Import.expression

Helper to create an identifier expression

val evar_qualified : loc:Ppxlib__.Location.t -> string list -> string -> Ppxlib__.Import.expression

Helper to create a qualified identifier expression

Variable Naming

val var_name : int -> string

Create a unique name for a variable by id

val mut_var_name : int -> string

Create a unique name for a mutable variable by id

val state_var : string

Thread state variable name - bound in kernel wrapper

val shared_var : string

Shared memory variable name - bound in block wrapper

Default Value Generation

val default_value_for_type : loc:Ppxlib.location -> Sarek_types.typ -> Ppxlib.expression

Generate default value expression for a given type. Used for array initialization and other contexts where a default is needed.