Gccjit.Function
type function_kind =
| Exported
Function is defined by the client code and visible by name outside of the JIT.
*)| Internal
Function is defined by the client code, but is invisible outside of the JIT. Analogous to a "static"
function.
| Imported
Function is not defined by the client code; we're merely referring to it. Analogous to using an "extern"
function from a header file.
| Always_inline
Function is only ever inlined into other functions, and is invisible outside of the JIT. Analogous to prefixing with "inline"
and adding __attribute__((always_inline))
. Inlining will only occur when the optimization level is above 0; when optimization is off, this is essentially the same as FUNCTION_Internal
.
Kinds of function.
val create :
context ->
?loc:location ->
?variadic:bool ->
function_kind ->
type_ ->
string ->
param list ->
function_
Create a function with the given name and parameters.
Create a reference to a builtin function (sometimes called intrinsic functions).
val dump_dot : function_ -> string -> unit
Emit the function in graphviz format to the given path.
Add a new local variable within the function, of the given type and name.
val to_string : function_ -> string
Get a human-readable description of this object.