Class Hlvm.state


class state : bool -> Llvm.llvalue -> object .. end
Create a state object that encapsulates our interface for emitting LLVM instructions.

val blk : Llvm.llbasicblock
val odepth : Llvm.llvalue Lazy.t
val gc_enabled : bool
val roots : bool
val thread_local : [ `Custom of Llvm.llvalue | `External | `Internal ]
method blk : Llvm.llbasicblock
Get the current LLVM instruction block.
method bb : Llvm.llbuilder
Get an LLVM instruction builder to insert instructions at the end of the current LLVM instruction block.
method gep : Llvm.llvalue -> Llvm.llvalue list -> Llvm.llvalue
Issue an LLVM get element pointer instruction.
method load : Llvm.llvalue -> Llvm.llvalue list -> Llvm.llvalue
Issue an LLVM load instruction.
method store : Llvm.llvalue -> Llvm.llvalue list -> Llvm.llvalue -> unit
Issue an LLVM store instruction.
method malloc : Llvm.lltype -> Llvm.llvalue -> Llvm.llvalue
Issue LLVM instructions to call the hlvm_alloc function.
method free : Llvm.llvalue -> unit
Issue LLVM instructions to call the hlvm_free function.
method define_global : string -> Llvm.llvalue -> Llvm.llvalue
Define a global LLVM variable.
method mk : string ->
(< alloca : Llvm.lltype -> Llvm.llvalue; bb : Llvm.llbuilder;
bitcast : Llvm.llvalue -> Llvm.lltype -> Llvm.llvalue;
blk : Llvm.llbasicblock; br : 'b -> unit;
call : int -> Llvm.llvalue -> Llvm.llvalue list -> Llvm.llvalue;
define_global : string -> Llvm.llvalue -> Llvm.llvalue;
free : Llvm.llvalue -> unit; gc : bool -> 'b; gc_enabled : bool;
gc_restore : unit -> unit; gc_root : Llvm.llvalue -> 'b;
gep : Llvm.llvalue -> Llvm.llvalue list -> Llvm.llvalue;
int_of_ptr : Llvm.llvalue -> Llvm.llvalue;
load : Llvm.llvalue -> Llvm.llvalue list -> Llvm.llvalue;
malloc : Llvm.lltype -> Llvm.llvalue -> Llvm.llvalue; mk : 'a;
odepth : Llvm.llvalue;
ptr_of_int : Llvm.llvalue -> Llvm.lltype -> Llvm.llvalue;
ret : Llvm.llvalue -> unit; set_depth : Llvm.llvalue Lazy.t -> 'b;
set_thread_local : Llvm.llvalue -> 'b; sret : Llvm.llvalue;
store : Llvm.llvalue -> Llvm.llvalue list -> Llvm.llvalue -> unit;
thread_local : Llvm.llvalue; time : Llvm.llvalue; .. >
as 'b)
as 'a
Create a new instruction block and return a new state that will insert instructions into it.
method ret : Llvm.llvalue -> unit
Issue an LLVM return instruction.
method br : 'b -> unit
Issue an LLVM unconditional branch instruction.
method bitcast : Llvm.llvalue -> Llvm.lltype -> Llvm.llvalue
Issue an LLVM bitcast instruction.
method call : int -> Llvm.llvalue -> Llvm.llvalue list -> Llvm.llvalue
Issue an LLVM call instruction using the given calling convention.
method sret : Llvm.llvalue
Get the LLVM value of the pointer to the return struct.
method alloca : Llvm.lltype -> Llvm.llvalue
Issue an LLVM alloca instruction to allocate on the stack.
method gc_enabled : bool
Are we emitting code to keep the GC informed.
method gc_root : Llvm.llvalue -> 'b
Push the given value of a reference type onto the shadow stack.
method gc_restore : unit -> unit
Restore the shadow stack depth to the value it was when this function was entered.
method gc : bool -> 'b
Return a "state" object that will not inject instructions to keep the GC informed if false.
method odepth : Llvm.llvalue
Depth the shadow stack was at when this function was entered.
method set_depth : Llvm.llvalue Lazy.t -> 'b
Prepare to reset the shadow stack depth to this value.
method set_thread_local : Llvm.llvalue -> 'b
Record the thread-local data.
method thread_local : Llvm.llvalue
Get the thread local data.
method int_of_ptr : Llvm.llvalue -> Llvm.llvalue
Issue an LLVM ptrtoint instruction.
method ptr_of_int : Llvm.llvalue -> Llvm.lltype -> Llvm.llvalue
Issue an LLVM inttoptr instruction.
method time : Llvm.llvalue
Issue LLVM instructions to call the hlvm_time function.