Gccjit.RValue
Given a numeric type (integer or floating point), build an rvalue
for the given constant int value.
Given a numeric type (integer or floating point), get the rvalue
for zero. Essentially this is just a shortcut for:
new_rvalue_from_int ctx numeric_type 0
Given a numeric type (integer or floating point), get the rvalue
for one. Essentially this is just a shortcut for:
new_rvalue_from_int ctx numeric_type 1
Given a numeric type (integer or floating point), build an rvalue
for the given constant double value.
Given a pointer type, build an rvalue
for the given address.
Given a pointer type, build an rvalue
for NULL
. Essentially this is just a shortcut for:
new_rvalue_from_ptr ctx pointer_type Ctypes.null
Generate an rvalue
for the given NIL
-terminated string, of type Const_char_ptr
.
Given a function and the given table of argument rvalues, construct a call to the function, with the result as an rvalue
.
Note
new_call
merely builds a rvalue
i.e. an expression that can be evaluated, perhaps as part of a more complicated expression. The call won't happen unless you add a statement to a function that evaluates the expression.
For example, if you want to call a function and discard the result (or to call a function with void
return type), use add_eval
:
(* Add "(void)printf (args);". *)
add_eval block (new_call ctx printf_func args)
Call through a function pointer.
val to_string : rvalue -> string
Get a human-readable description of this object.