@copying
@quotation
-libgccjit 8.0.0 (experimental 20170809), August 09, 2017
+libgccjit 8.0.0 (experimental 20170927), September 27, 2017
David Malcolm
* Binary Operations::
* Comparisons::
* Function calls::
+* Function pointers::
* Type-coercion::
Lvalues
* LIBGCCJIT_ABI_6::
* LIBGCCJIT_ABI_7::
* LIBGCCJIT_ABI_8::
+* LIBGCCJIT_ABI_9::
Performance
* Binary Operations: Binary Operations<2>.
* Comparisons: Comparisons<2>.
* Function calls: Function calls<2>.
+* Function pointers: Function pointers<2>.
* Type-coercion: Type-coercion<2>.
Lvalues
* Binary Operations::
* Comparisons::
* Function calls::
+* Function pointers::
* Type-coercion::
Lvalues
* LIBGCCJIT_ABI_6::
* LIBGCCJIT_ABI_7::
* LIBGCCJIT_ABI_8::
+* LIBGCCJIT_ABI_9::
Performance
* Binary Operations::
* Comparisons::
* Function calls::
+* Function pointers::
* Type-coercion::
Lvalues
* Binary Operations::
* Comparisons::
* Function calls::
+* Function pointers::
* Type-coercion::
@end menu
@end multitable
-@node Function calls,Type-coercion,Comparisons,Rvalues
+@node Function calls,Function pointers,Comparisons,Rvalues
@anchor{topics/expressions function-calls}@anchor{b0}
@subsubsection Function calls
@noindent
@end deffn
-@node Type-coercion,,Function calls,Rvalues
-@anchor{topics/expressions type-coercion}@anchor{b6}
+@node Function pointers,Type-coercion,Function calls,Rvalues
+@anchor{topics/expressions function-pointers}@anchor{b6}
+@subsubsection Function pointers
+
+
+@geindex gcc_jit_function_get_address (C function)
+@anchor{topics/expressions gcc_jit_function_get_address}@anchor{b7}
+@deffn {C Function} gcc_jit_rvalue * gcc_jit_function_get_address (gcc_jit_function@w{ }*fn, gcc_jit_location@w{ }*loc)
+
+Get the address of a function as an rvalue, of function pointer
+type.
+
+This entrypoint was added in @pxref{b8,,LIBGCCJIT_ABI_9}; you can test
+for its presence using
+
+@example
+#ifdef LIBGCCJIT_HAVE_gcc_jit_function_get_address
+@end example
+
+@noindent
+@end deffn
+
+@node Type-coercion,,Function pointers,Rvalues
+@anchor{topics/expressions type-coercion}@anchor{b9}
@subsubsection Type-coercion
@geindex gcc_jit_context_new_cast (C function)
-@anchor{topics/expressions gcc_jit_context_new_cast}@anchor{b7}
+@anchor{topics/expressions gcc_jit_context_new_cast}@anchor{ba}
@deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_cast (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, gcc_jit_rvalue@w{ }*rvalue, gcc_jit_type@w{ }*type)
Given an rvalue of T, construct another rvalue of another type.
@end deffn
@node Lvalues,Working with pointers structs and unions,Rvalues,Expressions
-@anchor{topics/expressions lvalues}@anchor{b8}
+@anchor{topics/expressions lvalues}@anchor{bb}
@subsection Lvalues
where the rvalue is computed by reading from the storage area.
@geindex gcc_jit_lvalue_as_object (C function)
-@anchor{topics/expressions gcc_jit_lvalue_as_object}@anchor{b9}
+@anchor{topics/expressions gcc_jit_lvalue_as_object}@anchor{bc}
@deffn {C Function} gcc_jit_object * gcc_jit_lvalue_as_object (gcc_jit_lvalue@w{ }*lvalue)
Upcast an lvalue to be an object.
@end deffn
@geindex gcc_jit_lvalue_as_rvalue (C function)
-@anchor{topics/expressions gcc_jit_lvalue_as_rvalue}@anchor{ba}
+@anchor{topics/expressions gcc_jit_lvalue_as_rvalue}@anchor{bd}
@deffn {C Function} gcc_jit_rvalue * gcc_jit_lvalue_as_rvalue (gcc_jit_lvalue@w{ }*lvalue)
Upcast an lvalue to be an rvalue.
@end deffn
@geindex gcc_jit_lvalue_get_address (C function)
-@anchor{topics/expressions gcc_jit_lvalue_get_address}@anchor{bb}
+@anchor{topics/expressions gcc_jit_lvalue_get_address}@anchor{be}
@deffn {C Function} gcc_jit_rvalue * gcc_jit_lvalue_get_address (gcc_jit_lvalue@w{ }*lvalue, gcc_jit_location@w{ }*loc)
Take the address of an lvalue; analogous to:
@end menu
@node Global variables,,,Lvalues
-@anchor{topics/expressions global-variables}@anchor{bc}
+@anchor{topics/expressions global-variables}@anchor{bf}
@subsubsection Global variables
@geindex gcc_jit_context_new_global (C function)
-@anchor{topics/expressions gcc_jit_context_new_global}@anchor{bd}
+@anchor{topics/expressions gcc_jit_context_new_global}@anchor{c0}
@deffn {C Function} gcc_jit_lvalue * gcc_jit_context_new_global (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, enum gcc_jit_global_kind@w{ }kind, gcc_jit_type@w{ }*type, const char@w{ }*name)
Add a new global variable of the given type and name to the context.
of the @pxref{16,,gcc_jit_result}:
@geindex gcc_jit_global_kind (C type)
-@anchor{topics/expressions gcc_jit_global_kind}@anchor{be}
+@anchor{topics/expressions gcc_jit_global_kind}@anchor{c1}
@deffn {C Type} enum gcc_jit_global_kind
@end deffn
@geindex GCC_JIT_GLOBAL_EXPORTED (C macro)
-@anchor{topics/expressions GCC_JIT_GLOBAL_EXPORTED}@anchor{bf}
+@anchor{topics/expressions GCC_JIT_GLOBAL_EXPORTED}@anchor{c2}
@deffn {C Macro} GCC_JIT_GLOBAL_EXPORTED
Global is defined by the client code and is visible
by name outside of this JIT context via
-@pxref{c0,,gcc_jit_result_get_global()} (and this value is required for
+@pxref{c3,,gcc_jit_result_get_global()} (and this value is required for
the global to be accessible via that entrypoint).
@end deffn
@geindex GCC_JIT_GLOBAL_INTERNAL (C macro)
-@anchor{topics/expressions GCC_JIT_GLOBAL_INTERNAL}@anchor{c1}
+@anchor{topics/expressions GCC_JIT_GLOBAL_INTERNAL}@anchor{c4}
@deffn {C Macro} GCC_JIT_GLOBAL_INTERNAL
Global is defined by the client code, but is invisible
@end deffn
@geindex GCC_JIT_GLOBAL_IMPORTED (C macro)
-@anchor{topics/expressions GCC_JIT_GLOBAL_IMPORTED}@anchor{c2}
+@anchor{topics/expressions GCC_JIT_GLOBAL_IMPORTED}@anchor{c5}
@deffn {C Macro} GCC_JIT_GLOBAL_IMPORTED
Global is not defined by the client code; we're merely
@end deffn
@node Working with pointers structs and unions,,Lvalues,Expressions
-@anchor{topics/expressions working-with-pointers-structs-and-unions}@anchor{c3}
+@anchor{topics/expressions working-with-pointers-structs-and-unions}@anchor{c6}
@subsection Working with pointers, structs and unions
@geindex gcc_jit_rvalue_dereference (C function)
-@anchor{topics/expressions gcc_jit_rvalue_dereference}@anchor{c4}
+@anchor{topics/expressions gcc_jit_rvalue_dereference}@anchor{c7}
@deffn {C Function} gcc_jit_lvalue * gcc_jit_rvalue_dereference (gcc_jit_rvalue@w{ }*rvalue, gcc_jit_location@w{ }*loc)
Given an rvalue of pointer type @code{T *}, dereferencing the pointer,
Field access is provided separately for both lvalues and rvalues.
@geindex gcc_jit_lvalue_access_field (C function)
-@anchor{topics/expressions gcc_jit_lvalue_access_field}@anchor{c5}
+@anchor{topics/expressions gcc_jit_lvalue_access_field}@anchor{c8}
@deffn {C Function} gcc_jit_lvalue * gcc_jit_lvalue_access_field (gcc_jit_lvalue@w{ }*struct_, gcc_jit_location@w{ }*loc, gcc_jit_field@w{ }*field)
Given an lvalue of struct or union type, access the given field,
@end deffn
@geindex gcc_jit_rvalue_access_field (C function)
-@anchor{topics/expressions gcc_jit_rvalue_access_field}@anchor{c6}
+@anchor{topics/expressions gcc_jit_rvalue_access_field}@anchor{c9}
@deffn {C Function} gcc_jit_rvalue * gcc_jit_rvalue_access_field (gcc_jit_rvalue@w{ }*struct_, gcc_jit_location@w{ }*loc, gcc_jit_field@w{ }*field)
Given an rvalue of struct or union type, access the given field
@end deffn
@geindex gcc_jit_rvalue_dereference_field (C function)
-@anchor{topics/expressions gcc_jit_rvalue_dereference_field}@anchor{c7}
+@anchor{topics/expressions gcc_jit_rvalue_dereference_field}@anchor{ca}
@deffn {C Function} gcc_jit_lvalue * gcc_jit_rvalue_dereference_field (gcc_jit_rvalue@w{ }*ptr, gcc_jit_location@w{ }*loc, gcc_jit_field@w{ }*field)
Given an rvalue of pointer type @code{T *} where T is of struct or union
@c <http://www.gnu.org/licenses/>.
@node Creating and using functions,Source Locations,Expressions,Topic Reference
-@anchor{topics/functions doc}@anchor{c8}@anchor{topics/functions creating-and-using-functions}@anchor{c9}
+@anchor{topics/functions doc}@anchor{cb}@anchor{topics/functions creating-and-using-functions}@anchor{cc}
@section Creating and using functions
@end menu
@node Params,Functions,,Creating and using functions
-@anchor{topics/functions params}@anchor{ca}
+@anchor{topics/functions params}@anchor{cd}
@subsection Params
following upcasts are available:
@geindex gcc_jit_param_as_lvalue (C function)
-@anchor{topics/functions gcc_jit_param_as_lvalue}@anchor{cb}
+@anchor{topics/functions gcc_jit_param_as_lvalue}@anchor{ce}
@deffn {C Function} gcc_jit_lvalue * gcc_jit_param_as_lvalue (gcc_jit_param@w{ }*param)
Upcasting from param to lvalue.
@end deffn
@geindex gcc_jit_param_as_rvalue (C function)
-@anchor{topics/functions gcc_jit_param_as_rvalue}@anchor{cc}
+@anchor{topics/functions gcc_jit_param_as_rvalue}@anchor{cf}
@deffn {C Function} gcc_jit_rvalue * gcc_jit_param_as_rvalue (gcc_jit_param@w{ }*param)
Upcasting from param to rvalue.
@end deffn
@geindex gcc_jit_param_as_object (C function)
-@anchor{topics/functions gcc_jit_param_as_object}@anchor{cd}
+@anchor{topics/functions gcc_jit_param_as_object}@anchor{d0}
@deffn {C Function} gcc_jit_object * gcc_jit_param_as_object (gcc_jit_param@w{ }*param)
Upcasting from param to object.
@end deffn
@node Functions,Blocks,Params,Creating and using functions
-@anchor{topics/functions functions}@anchor{ce}
+@anchor{topics/functions functions}@anchor{d1}
@subsection Functions
Create a gcc_jit_function with the given name and parameters.
@geindex gcc_jit_function_kind (C type)
-@anchor{topics/functions gcc_jit_function_kind}@anchor{cf}
+@anchor{topics/functions gcc_jit_function_kind}@anchor{d2}
@deffn {C Type} enum gcc_jit_function_kind
@end deffn
@quotation
@geindex GCC_JIT_FUNCTION_EXPORTED (C macro)
-@anchor{topics/functions GCC_JIT_FUNCTION_EXPORTED}@anchor{d0}
+@anchor{topics/functions GCC_JIT_FUNCTION_EXPORTED}@anchor{d3}
@deffn {C Macro} GCC_JIT_FUNCTION_EXPORTED
Function is defined by the client code and visible
@end deffn
@geindex GCC_JIT_FUNCTION_INTERNAL (C macro)
-@anchor{topics/functions GCC_JIT_FUNCTION_INTERNAL}@anchor{d1}
+@anchor{topics/functions GCC_JIT_FUNCTION_INTERNAL}@anchor{d4}
@deffn {C Macro} GCC_JIT_FUNCTION_INTERNAL
Function is defined by the client code, but is invisible
@end deffn
@geindex GCC_JIT_FUNCTION_IMPORTED (C macro)
-@anchor{topics/functions GCC_JIT_FUNCTION_IMPORTED}@anchor{d2}
+@anchor{topics/functions GCC_JIT_FUNCTION_IMPORTED}@anchor{d5}
@deffn {C Macro} GCC_JIT_FUNCTION_IMPORTED
Function is not defined by the client code; we're merely
@end deffn
@geindex GCC_JIT_FUNCTION_ALWAYS_INLINE (C macro)
-@anchor{topics/functions GCC_JIT_FUNCTION_ALWAYS_INLINE}@anchor{d3}
+@anchor{topics/functions GCC_JIT_FUNCTION_ALWAYS_INLINE}@anchor{d6}
@deffn {C Macro} GCC_JIT_FUNCTION_ALWAYS_INLINE
Function is only ever inlined into other functions, and is
@end deffn
@geindex gcc_jit_context_get_builtin_function (C function)
-@anchor{topics/functions gcc_jit_context_get_builtin_function}@anchor{d4}
+@anchor{topics/functions gcc_jit_context_get_builtin_function}@anchor{d7}
@deffn {C Function} gcc_jit_function *gcc_jit_context_get_builtin_function (gcc_jit_context@w{ }*ctxt, const char@w{ }*name)
@end deffn
@geindex gcc_jit_function_as_object (C function)
-@anchor{topics/functions gcc_jit_function_as_object}@anchor{d5}
+@anchor{topics/functions gcc_jit_function_as_object}@anchor{d8}
@deffn {C Function} gcc_jit_object * gcc_jit_function_as_object (gcc_jit_function@w{ }*func)
Upcasting from function to object.
@end deffn
@geindex gcc_jit_function_get_param (C function)
-@anchor{topics/functions gcc_jit_function_get_param}@anchor{d6}
+@anchor{topics/functions gcc_jit_function_get_param}@anchor{d9}
@deffn {C Function} gcc_jit_param * gcc_jit_function_get_param (gcc_jit_function@w{ }*func, int@w{ }index)
Get the param of the given index (0-based).
@end deffn
@node Blocks,Statements,Functions,Creating and using functions
-@anchor{topics/functions blocks}@anchor{d7}
+@anchor{topics/functions blocks}@anchor{da}
@subsection Blocks
@end deffn
@geindex gcc_jit_function_new_block (C function)
-@anchor{topics/functions gcc_jit_function_new_block}@anchor{d8}
+@anchor{topics/functions gcc_jit_function_new_block}@anchor{db}
@deffn {C Function} gcc_jit_block * gcc_jit_function_new_block (gcc_jit_function@w{ }*func, const char@w{ }*name)
Create a basic block of the given name. The name may be NULL, but
@end deffn
@geindex gcc_jit_block_as_object (C function)
-@anchor{topics/functions gcc_jit_block_as_object}@anchor{d9}
+@anchor{topics/functions gcc_jit_block_as_object}@anchor{dc}
@deffn {C Function} gcc_jit_object * gcc_jit_block_as_object (gcc_jit_block@w{ }*block)
Upcast from block to object.
@end deffn
@geindex gcc_jit_block_get_function (C function)
-@anchor{topics/functions gcc_jit_block_get_function}@anchor{da}
+@anchor{topics/functions gcc_jit_block_get_function}@anchor{dd}
@deffn {C Function} gcc_jit_function * gcc_jit_block_get_function (gcc_jit_block@w{ }*block)
Which function is this block within?
@end deffn
@node Statements,,Blocks,Creating and using functions
-@anchor{topics/functions statements}@anchor{db}
+@anchor{topics/functions statements}@anchor{de}
@subsection Statements
@end deffn
@geindex gcc_jit_block_end_with_jump (C function)
-@anchor{topics/functions gcc_jit_block_end_with_jump}@anchor{dc}
+@anchor{topics/functions gcc_jit_block_end_with_jump}@anchor{df}
@deffn {C Function} void gcc_jit_block_end_with_jump (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc, gcc_jit_block@w{ }*target)
Terminate a block by adding a jump to the given target block.
@end deffn
@geindex gcc_jit_block_end_with_return (C function)
-@anchor{topics/functions gcc_jit_block_end_with_return}@anchor{dd}
+@anchor{topics/functions gcc_jit_block_end_with_return}@anchor{e0}
@deffn {C Function} void gcc_jit_block_end_with_return (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc, gcc_jit_rvalue@w{ }*rvalue)
Terminate a block by adding evaluation of an rvalue, returning the value.
@end deffn
@geindex gcc_jit_block_end_with_void_return (C function)
-@anchor{topics/functions gcc_jit_block_end_with_void_return}@anchor{de}
+@anchor{topics/functions gcc_jit_block_end_with_void_return}@anchor{e1}
@deffn {C Function} void gcc_jit_block_end_with_void_return (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc)
Terminate a block by adding a valueless return, for use within a function
@end deffn
@geindex gcc_jit_block_end_with_switch (C function)
-@anchor{topics/functions gcc_jit_block_end_with_switch}@anchor{df}
+@anchor{topics/functions gcc_jit_block_end_with_switch}@anchor{e2}
@deffn {C Function} void gcc_jit_block_end_with_switch (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc, gcc_jit_rvalue@w{ }*expr, gcc_jit_block@w{ }*default_block, int@w{ }num_cases, gcc_jit_case@w{ }**cases)
Terminate a block by adding evalation of an rvalue, then performing
@itemize *
@item
-@pxref{df,,gcc_jit_block_end_with_switch()}
+@pxref{e2,,gcc_jit_block_end_with_switch()}
@item
-@pxref{e0,,gcc_jit_case_as_object()}
+@pxref{e3,,gcc_jit_case_as_object()}
@item
-@pxref{e1,,gcc_jit_context_new_case()}
+@pxref{e4,,gcc_jit_context_new_case()}
@end itemize
@end quotation
-were added in @pxref{e2,,LIBGCCJIT_ABI_3}; you can test for their presence
+were added in @pxref{e5,,LIBGCCJIT_ABI_3}; you can test for their presence
using
@example
@noindent
@geindex gcc_jit_case (C type)
-@anchor{topics/functions gcc_jit_case}@anchor{e3}
+@anchor{topics/functions gcc_jit_case}@anchor{e6}
@deffn {C Type} gcc_jit_case
@end deffn
A @cite{gcc_jit_case} represents a case within a switch statement, and
is created within a particular @pxref{8,,gcc_jit_context} using
-@pxref{e1,,gcc_jit_context_new_case()}.
+@pxref{e4,,gcc_jit_context_new_case()}.
Each case expresses a multivalued range of integer values. You
can express single-valued cases by passing in the same value for
both @cite{min_value} and @cite{max_value}.
@geindex gcc_jit_context_new_case (C function)
-@anchor{topics/functions gcc_jit_context_new_case}@anchor{e1}
+@anchor{topics/functions gcc_jit_context_new_case}@anchor{e4}
@deffn {C Function} gcc_jit_case * gcc_jit_context_new_case (gcc_jit_context@w{ }*ctxt, gcc_jit_rvalue@w{ }*min_value, gcc_jit_rvalue@w{ }*max_value, gcc_jit_block@w{ }*dest_block)
Create a new gcc_jit_case instance for use in a switch statement.
@end deffn
@geindex gcc_jit_case_as_object (C function)
-@anchor{topics/functions gcc_jit_case_as_object}@anchor{e0}
+@anchor{topics/functions gcc_jit_case_as_object}@anchor{e3}
@deffn {C Function} gcc_jit_object * gcc_jit_case_as_object (gcc_jit_case@w{ }*case_)
Upcast from a case to an object.
@c <http://www.gnu.org/licenses/>.
@node Source Locations,Compiling a context,Creating and using functions,Topic Reference
-@anchor{topics/locations source-locations}@anchor{e4}@anchor{topics/locations doc}@anchor{e5}
+@anchor{topics/locations source-locations}@anchor{e7}@anchor{topics/locations doc}@anchor{e8}
@section Source Locations
@end menu
@node Faking it,,,Source Locations
-@anchor{topics/locations faking-it}@anchor{e6}
+@anchor{topics/locations faking-it}@anchor{e9}
@subsection Faking it
@c <http://www.gnu.org/licenses/>.
@node Compiling a context,ABI and API compatibility,Source Locations,Topic Reference
-@anchor{topics/compilation compiling-a-context}@anchor{e7}@anchor{topics/compilation doc}@anchor{e8}
+@anchor{topics/compilation compiling-a-context}@anchor{ea}@anchor{topics/compilation doc}@anchor{eb}
@section Compiling a context
@end menu
@node In-memory compilation,Ahead-of-time compilation,,Compiling a context
-@anchor{topics/compilation in-memory-compilation}@anchor{e9}
+@anchor{topics/compilation in-memory-compilation}@anchor{ec}
@subsection In-memory compilation
with a name matching @cite{funcname} must have been created on
@cite{result}'s context (or a parent context) via a call to
@pxref{11,,gcc_jit_context_new_function()} with @cite{kind}
-@pxref{d0,,GCC_JIT_FUNCTION_EXPORTED}:
+@pxref{d3,,GCC_JIT_FUNCTION_EXPORTED}:
@example
gcc_jit_context_new_function (ctxt,
@end deffn
@geindex gcc_jit_result_get_global (C function)
-@anchor{topics/compilation gcc_jit_result_get_global}@anchor{c0}
+@anchor{topics/compilation gcc_jit_result_get_global}@anchor{c3}
@deffn {C Function} void * gcc_jit_result_get_global (gcc_jit_result@w{ }*result, const char@w{ }*name)
Locate a given global within the built machine code.
Globals are looked up by name. For this to succeed, a global
with a name matching @cite{name} must have been created on
@cite{result}'s context (or a parent context) via a call to
-@pxref{bd,,gcc_jit_context_new_global()} with @cite{kind}
-@pxref{bf,,GCC_JIT_GLOBAL_EXPORTED}.
+@pxref{c0,,gcc_jit_context_new_global()} with @cite{kind}
+@pxref{c2,,GCC_JIT_GLOBAL_EXPORTED}.
If the global is found, the result will need to be cast to a
pointer of the correct type before it can be called.
This cleans up the result; after calling this, it's no longer
valid to use the result, or any code or globals that were obtained
by calling @pxref{17,,gcc_jit_result_get_code()} or
-@pxref{c0,,gcc_jit_result_get_global()} on it.
+@pxref{c3,,gcc_jit_result_get_global()} on it.
@end deffn
@node Ahead-of-time compilation,,In-memory compilation,Compiling a context
-@anchor{topics/compilation ahead-of-time-compilation}@anchor{ea}
+@anchor{topics/compilation ahead-of-time-compilation}@anchor{ed}
@subsection Ahead-of-time compilation
@end cartouche
@geindex gcc_jit_output_kind (C type)
-@anchor{topics/compilation gcc_jit_output_kind}@anchor{eb}
+@anchor{topics/compilation gcc_jit_output_kind}@anchor{ee}
@deffn {C Type} enum gcc_jit_output_kind
@end deffn
@item
-@pxref{ec,,GCC_JIT_OUTPUT_KIND_ASSEMBLER}
+@pxref{ef,,GCC_JIT_OUTPUT_KIND_ASSEMBLER}
@tab
@item
-@pxref{ed,,GCC_JIT_OUTPUT_KIND_OBJECT_FILE}
+@pxref{f0,,GCC_JIT_OUTPUT_KIND_OBJECT_FILE}
@tab
@item
-@pxref{ee,,GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY}
+@pxref{f1,,GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY}
@tab
@item
-@pxref{ef,,GCC_JIT_OUTPUT_KIND_EXECUTABLE}
+@pxref{f2,,GCC_JIT_OUTPUT_KIND_EXECUTABLE}
@tab
@geindex GCC_JIT_OUTPUT_KIND_ASSEMBLER (C macro)
-@anchor{topics/compilation GCC_JIT_OUTPUT_KIND_ASSEMBLER}@anchor{ec}
+@anchor{topics/compilation GCC_JIT_OUTPUT_KIND_ASSEMBLER}@anchor{ef}
@deffn {C Macro} GCC_JIT_OUTPUT_KIND_ASSEMBLER
Compile the context to an assembler file.
@end deffn
@geindex GCC_JIT_OUTPUT_KIND_OBJECT_FILE (C macro)
-@anchor{topics/compilation GCC_JIT_OUTPUT_KIND_OBJECT_FILE}@anchor{ed}
+@anchor{topics/compilation GCC_JIT_OUTPUT_KIND_OBJECT_FILE}@anchor{f0}
@deffn {C Macro} GCC_JIT_OUTPUT_KIND_OBJECT_FILE
Compile the context to an object file.
@end deffn
@geindex GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY (C macro)
-@anchor{topics/compilation GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY}@anchor{ee}
+@anchor{topics/compilation GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY}@anchor{f1}
@deffn {C Macro} GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY
Compile the context to a dynamic library.
@end deffn
@geindex GCC_JIT_OUTPUT_KIND_EXECUTABLE (C macro)
-@anchor{topics/compilation GCC_JIT_OUTPUT_KIND_EXECUTABLE}@anchor{ef}
+@anchor{topics/compilation GCC_JIT_OUTPUT_KIND_EXECUTABLE}@anchor{f2}
@deffn {C Macro} GCC_JIT_OUTPUT_KIND_EXECUTABLE
Compile the context to an executable.
@c <http://www.gnu.org/licenses/>.
@node ABI and API compatibility,Performance,Compiling a context,Topic Reference
-@anchor{topics/compatibility abi-and-api-compatibility}@anchor{f0}@anchor{topics/compatibility doc}@anchor{f1}
+@anchor{topics/compatibility abi-and-api-compatibility}@anchor{f3}@anchor{topics/compatibility doc}@anchor{f4}
@section ABI and API compatibility
* LIBGCCJIT_ABI_6::
* LIBGCCJIT_ABI_7::
* LIBGCCJIT_ABI_8::
+* LIBGCCJIT_ABI_9::
@end menu
@node ABI symbol tags,,,ABI and API compatibility
-@anchor{topics/compatibility abi-symbol-tags}@anchor{f2}
+@anchor{topics/compatibility abi-symbol-tags}@anchor{f5}
@subsection ABI symbol tags
* LIBGCCJIT_ABI_6::
* LIBGCCJIT_ABI_7::
* LIBGCCJIT_ABI_8::
+* LIBGCCJIT_ABI_9::
@end menu
@node LIBGCCJIT_ABI_0,LIBGCCJIT_ABI_1,,ABI symbol tags
-@anchor{topics/compatibility libgccjit-abi-0}@anchor{f3}@anchor{topics/compatibility id1}@anchor{f4}
+@anchor{topics/compatibility libgccjit-abi-0}@anchor{f6}@anchor{topics/compatibility id1}@anchor{f7}
@subsubsection @code{LIBGCCJIT_ABI_0}
(see this post@footnote{https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02126.html})
@node LIBGCCJIT_ABI_1,LIBGCCJIT_ABI_2,LIBGCCJIT_ABI_0,ABI symbol tags
-@anchor{topics/compatibility libgccjit-abi-1}@anchor{73}@anchor{topics/compatibility id2}@anchor{f5}
+@anchor{topics/compatibility libgccjit-abi-1}@anchor{73}@anchor{topics/compatibility id2}@anchor{f8}
@subsubsection @code{LIBGCCJIT_ABI_1}
@pxref{72,,gcc_jit_context_add_command_line_option()}
@node LIBGCCJIT_ABI_2,LIBGCCJIT_ABI_3,LIBGCCJIT_ABI_1,ABI symbol tags
-@anchor{topics/compatibility libgccjit-abi-2}@anchor{6c}@anchor{topics/compatibility id3}@anchor{f6}
+@anchor{topics/compatibility libgccjit-abi-2}@anchor{6c}@anchor{topics/compatibility id3}@anchor{f9}
@subsubsection @code{LIBGCCJIT_ABI_2}
@pxref{6b,,gcc_jit_context_set_bool_allow_unreachable_blocks()}
@node LIBGCCJIT_ABI_3,LIBGCCJIT_ABI_4,LIBGCCJIT_ABI_2,ABI symbol tags
-@anchor{topics/compatibility libgccjit-abi-3}@anchor{e2}@anchor{topics/compatibility id4}@anchor{f7}
+@anchor{topics/compatibility libgccjit-abi-3}@anchor{e5}@anchor{topics/compatibility id4}@anchor{fa}
@subsubsection @code{LIBGCCJIT_ABI_3}
@itemize *
@item
-@pxref{df,,gcc_jit_block_end_with_switch()}
+@pxref{e2,,gcc_jit_block_end_with_switch()}
@item
-@pxref{e0,,gcc_jit_case_as_object()}
+@pxref{e3,,gcc_jit_case_as_object()}
@item
-@pxref{e1,,gcc_jit_context_new_case()}
+@pxref{e4,,gcc_jit_context_new_case()}
@end itemize
@end quotation
@node LIBGCCJIT_ABI_4,LIBGCCJIT_ABI_5,LIBGCCJIT_ABI_3,ABI symbol tags
-@anchor{topics/compatibility id5}@anchor{f8}@anchor{topics/compatibility libgccjit-abi-4}@anchor{f9}
+@anchor{topics/compatibility id5}@anchor{fb}@anchor{topics/compatibility libgccjit-abi-4}@anchor{fc}
@subsubsection @code{LIBGCCJIT_ABI_4}
@itemize *
@item
-@pxref{fa,,gcc_jit_context_get_timer()}
+@pxref{fd,,gcc_jit_context_get_timer()}
@item
-@pxref{fb,,gcc_jit_context_set_timer()}
+@pxref{fe,,gcc_jit_context_set_timer()}
@item
-@pxref{fc,,gcc_jit_timer_new()}
+@pxref{ff,,gcc_jit_timer_new()}
@item
-@pxref{fd,,gcc_jit_timer_release()}
+@pxref{100,,gcc_jit_timer_release()}
@item
-@pxref{fe,,gcc_jit_timer_push()}
+@pxref{101,,gcc_jit_timer_push()}
@item
-@pxref{ff,,gcc_jit_timer_pop()}
+@pxref{102,,gcc_jit_timer_pop()}
@item
-@pxref{100,,gcc_jit_timer_print()}
+@pxref{103,,gcc_jit_timer_print()}
@end itemize
@end quotation
@node LIBGCCJIT_ABI_5,LIBGCCJIT_ABI_6,LIBGCCJIT_ABI_4,ABI symbol tags
-@anchor{topics/compatibility id6}@anchor{101}@anchor{topics/compatibility libgccjit-abi-5}@anchor{6e}
+@anchor{topics/compatibility id6}@anchor{104}@anchor{topics/compatibility libgccjit-abi-5}@anchor{6e}
@subsubsection @code{LIBGCCJIT_ABI_5}
@pxref{6d,,gcc_jit_context_set_bool_use_external_driver()}
@node LIBGCCJIT_ABI_6,LIBGCCJIT_ABI_7,LIBGCCJIT_ABI_5,ABI symbol tags
-@anchor{topics/compatibility id7}@anchor{102}@anchor{topics/compatibility libgccjit-abi-6}@anchor{b5}
+@anchor{topics/compatibility id7}@anchor{105}@anchor{topics/compatibility libgccjit-abi-6}@anchor{b5}
@subsubsection @code{LIBGCCJIT_ABI_6}
@pxref{b4,,gcc_jit_rvalue_set_bool_require_tail_call()}
@node LIBGCCJIT_ABI_7,LIBGCCJIT_ABI_8,LIBGCCJIT_ABI_6,ABI symbol tags
-@anchor{topics/compatibility libgccjit-abi-7}@anchor{81}@anchor{topics/compatibility id8}@anchor{103}
+@anchor{topics/compatibility libgccjit-abi-7}@anchor{81}@anchor{topics/compatibility id8}@anchor{106}
@subsubsection @code{LIBGCCJIT_ABI_7}
@code{LIBGCCJIT_ABI_7} covers the addition of
@pxref{80,,gcc_jit_type_get_aligned()}
-@node LIBGCCJIT_ABI_8,,LIBGCCJIT_ABI_7,ABI symbol tags
-@anchor{topics/compatibility libgccjit-abi-8}@anchor{84}@anchor{topics/compatibility id9}@anchor{104}
+@node LIBGCCJIT_ABI_8,LIBGCCJIT_ABI_9,LIBGCCJIT_ABI_7,ABI symbol tags
+@anchor{topics/compatibility libgccjit-abi-8}@anchor{84}@anchor{topics/compatibility id9}@anchor{107}
@subsubsection @code{LIBGCCJIT_ABI_8}
@code{LIBGCCJIT_ABI_8} covers the addition of
@pxref{83,,gcc_jit_type_get_vector()}
+@node LIBGCCJIT_ABI_9,,LIBGCCJIT_ABI_8,ABI symbol tags
+@anchor{topics/compatibility id10}@anchor{108}@anchor{topics/compatibility libgccjit-abi-9}@anchor{b8}
+@subsubsection @code{LIBGCCJIT_ABI_9}
+
+
+@code{LIBGCCJIT_ABI_9} covers the addition of
+@pxref{b7,,gcc_jit_function_get_address()}
+
@c Copyright (C) 2015-2017 Free Software Foundation, Inc.
@c Originally contributed by David Malcolm <dmalcolm@redhat.com>
@c
@c <http://www.gnu.org/licenses/>.
@node Performance,,ABI and API compatibility,Topic Reference
-@anchor{topics/performance performance}@anchor{105}@anchor{topics/performance doc}@anchor{106}
+@anchor{topics/performance performance}@anchor{109}@anchor{topics/performance doc}@anchor{10a}
@section Performance
@end menu
@node The timing API,,,Performance
-@anchor{topics/performance the-timing-api}@anchor{107}
+@anchor{topics/performance the-timing-api}@anchor{10b}
@subsection The timing API
As of GCC 6, libgccjit exposes a timing API, for printing reports on
how long was spent in different parts of code.
-You can create a @pxref{108,,gcc_jit_timer} instance, which will
+You can create a @pxref{10c,,gcc_jit_timer} instance, which will
measure time spent since its creation. The timer maintains a stack
of "timer items": as control flow moves through your code, you can push
and pop named items relating to your code onto the stack, and the timer
The exact format is intended to be human-readable, and is subject to change.
@geindex LIBGCCJIT_HAVE_TIMING_API (C macro)
-@anchor{topics/performance LIBGCCJIT_HAVE_TIMING_API}@anchor{109}
+@anchor{topics/performance LIBGCCJIT_HAVE_TIMING_API}@anchor{10d}
@deffn {C Macro} LIBGCCJIT_HAVE_TIMING_API
The timer API was added to libgccjit in GCC 6.
@end deffn
@geindex gcc_jit_timer (C type)
-@anchor{topics/performance gcc_jit_timer}@anchor{108}
+@anchor{topics/performance gcc_jit_timer}@anchor{10c}
@deffn {C Type} gcc_jit_timer
@end deffn
@geindex gcc_jit_timer_new (C function)
-@anchor{topics/performance gcc_jit_timer_new}@anchor{fc}
+@anchor{topics/performance gcc_jit_timer_new}@anchor{ff}
@deffn {C Function} gcc_jit_timer * gcc_jit_timer_new (void)
-Create a @pxref{108,,gcc_jit_timer} instance, and start timing:
+Create a @pxref{10c,,gcc_jit_timer} instance, and start timing:
@example
gcc_jit_timer *t = gcc_jit_timer_new ();
@noindent
-This API entrypoint was added in @pxref{f9,,LIBGCCJIT_ABI_4}; you can test
+This API entrypoint was added in @pxref{fc,,LIBGCCJIT_ABI_4}; you can test
for its presence using
@example
@end deffn
@geindex gcc_jit_timer_release (C function)
-@anchor{topics/performance gcc_jit_timer_release}@anchor{fd}
+@anchor{topics/performance gcc_jit_timer_release}@anchor{100}
@deffn {C Function} void gcc_jit_timer_release (gcc_jit_timer@w{ }*timer)
-Release a @pxref{108,,gcc_jit_timer} instance:
+Release a @pxref{10c,,gcc_jit_timer} instance:
@example
gcc_jit_timer_release (t);
This should be called exactly once on a timer.
-This API entrypoint was added in @pxref{f9,,LIBGCCJIT_ABI_4}; you can test
+This API entrypoint was added in @pxref{fc,,LIBGCCJIT_ABI_4}; you can test
for its presence using
@example
@end deffn
@geindex gcc_jit_context_set_timer (C function)
-@anchor{topics/performance gcc_jit_context_set_timer}@anchor{fb}
+@anchor{topics/performance gcc_jit_context_set_timer}@anchor{fe}
@deffn {C Function} void gcc_jit_context_set_timer (gcc_jit_context@w{ }*ctxt, gcc_jit_timer@w{ }*timer)
-Associate a @pxref{108,,gcc_jit_timer} instance with a context:
+Associate a @pxref{10c,,gcc_jit_timer} instance with a context:
@example
gcc_jit_context_set_timer (ctxt, t);
must provide your own locks if more than one thread could be working
with the same timer via timer-associated contexts.
-This API entrypoint was added in @pxref{f9,,LIBGCCJIT_ABI_4}; you can test
+This API entrypoint was added in @pxref{fc,,LIBGCCJIT_ABI_4}; you can test
for its presence using
@example
@end deffn
@geindex gcc_jit_context_get_timer (C function)
-@anchor{topics/performance gcc_jit_context_get_timer}@anchor{fa}
+@anchor{topics/performance gcc_jit_context_get_timer}@anchor{fd}
@deffn {C Function} gcc_jit_timer *gcc_jit_context_get_timer (gcc_jit_context@w{ }*ctxt)
Get the timer associated with a context (if any).
-This API entrypoint was added in @pxref{f9,,LIBGCCJIT_ABI_4}; you can test
+This API entrypoint was added in @pxref{fc,,LIBGCCJIT_ABI_4}; you can test
for its presence using
@example
@end deffn
@geindex gcc_jit_timer_push (C function)
-@anchor{topics/performance gcc_jit_timer_push}@anchor{fe}
+@anchor{topics/performance gcc_jit_timer_push}@anchor{101}
@deffn {C Function} void gcc_jit_timer_push (gcc_jit_timer@w{ }*timer, const char@w{ }*item_name)
Push the given item onto the timer's stack:
@noindent
-This API entrypoint was added in @pxref{f9,,LIBGCCJIT_ABI_4}; you can test
+This API entrypoint was added in @pxref{fc,,LIBGCCJIT_ABI_4}; you can test
for its presence using
@example
@end deffn
@geindex gcc_jit_timer_pop (C function)
-@anchor{topics/performance gcc_jit_timer_pop}@anchor{ff}
+@anchor{topics/performance gcc_jit_timer_pop}@anchor{102}
@deffn {C Function} void gcc_jit_timer_pop (gcc_jit_timer@w{ }*timer, const char@w{ }*item_name)
Pop the top item from the timer's stack.
If "item_name" is provided, it must match that of the top item.
Alternatively, @code{NULL} can be passed in, to suppress checking.
-This API entrypoint was added in @pxref{f9,,LIBGCCJIT_ABI_4}; you can test
+This API entrypoint was added in @pxref{fc,,LIBGCCJIT_ABI_4}; you can test
for its presence using
@example
@end deffn
@geindex gcc_jit_timer_print (C function)
-@anchor{topics/performance gcc_jit_timer_print}@anchor{100}
+@anchor{topics/performance gcc_jit_timer_print}@anchor{103}
@deffn {C Function} void gcc_jit_timer_print (gcc_jit_timer@w{ }*timer, FILE@w{ }*f_out)
Print timing information to the given stream about activity since
the timer was started.
-This API entrypoint was added in @pxref{f9,,LIBGCCJIT_ABI_4}; you can test
+This API entrypoint was added in @pxref{fc,,LIBGCCJIT_ABI_4}; you can test
for its presence using
@example
@c <http://www.gnu.org/licenses/>.
@node C++ bindings for libgccjit,Internals,Topic Reference,Top
-@anchor{cp/index c-bindings-for-libgccjit}@anchor{10a}@anchor{cp/index doc}@anchor{10b}
+@anchor{cp/index c-bindings-for-libgccjit}@anchor{10e}@anchor{cp/index doc}@anchor{10f}
@chapter C++ bindings for libgccjit
* Binary Operations: Binary Operations<2>.
* Comparisons: Comparisons<2>.
* Function calls: Function calls<2>.
+* Function pointers: Function pointers<2>.
* Type-coercion: Type-coercion<2>.
Lvalues
@node Tutorial<2>,Topic Reference<2>,,C++ bindings for libgccjit
-@anchor{cp/intro/index doc}@anchor{10c}@anchor{cp/intro/index tutorial}@anchor{10d}
+@anchor{cp/intro/index doc}@anchor{110}@anchor{cp/intro/index tutorial}@anchor{111}
@section Tutorial
@end menu
@node Tutorial part 1 "Hello world"<2>,Tutorial part 2 Creating a trivial machine code function<2>,,Tutorial<2>
-@anchor{cp/intro/tutorial01 doc}@anchor{10e}@anchor{cp/intro/tutorial01 tutorial-part-1-hello-world}@anchor{10f}
+@anchor{cp/intro/tutorial01 doc}@anchor{112}@anchor{cp/intro/tutorial01 tutorial-part-1-hello-world}@anchor{113}
@subsection Tutorial part 1: "Hello world"
@c <http://www.gnu.org/licenses/>.
@node Tutorial part 2 Creating a trivial machine code function<2>,Tutorial part 3 Loops and variables<2>,Tutorial part 1 "Hello world"<2>,Tutorial<2>
-@anchor{cp/intro/tutorial02 doc}@anchor{110}@anchor{cp/intro/tutorial02 tutorial-part-2-creating-a-trivial-machine-code-function}@anchor{111}
+@anchor{cp/intro/tutorial02 doc}@anchor{114}@anchor{cp/intro/tutorial02 tutorial-part-2-creating-a-trivial-machine-code-function}@anchor{115}
@subsection Tutorial part 2: Creating a trivial machine code function
@code{gccjit::context}, which is a thin C++ wrapper around the C API's
@pxref{8,,gcc_jit_context *}.
-Create one using @pxref{112,,gccjit;;context;;acquire()}:
+Create one using @pxref{116,,gccjit;;context;;acquire()}:
@example
gccjit::context ctxt;
expression is of a specific type, fixed at compile-time. In our example,
all of the expressions are of the C @cite{int} type, so let's obtain this from
the context, as a @code{gccjit::type}, using
-@pxref{113,,gccjit;;context;;get_type()}:
+@pxref{117,,gccjit;;context;;get_type()}:
@example
gccjit::type int_type = ctxt.get_type (GCC_JIT_TYPE_INT);
Memory management is easy: all such "contextual" objects are automatically
cleaned up for you when the context is released, using
-@pxref{114,,gccjit;;context;;release()}:
+@pxref{118,,gccjit;;context;;release()}:
@example
ctxt.release ();
One thing you can do with a @code{gccjit::object} is
to ask it for a human-readable description as a @code{std::string}, using
-@pxref{115,,gccjit;;object;;get_debug_string()}:
+@pxref{119,,gccjit;;object;;get_debug_string()}:
@example
printf ("obj: %s\n", obj.get_debug_string ().c_str ());
Let's create the function. To do so, we first need to construct
its single parameter, specifying its type and giving it a name,
-using @pxref{116,,gccjit;;context;;new_param()}:
+using @pxref{11a,,gccjit;;context;;new_param()}:
@example
gccjit::param param_i = ctxt.new_param (int_type, "i");
Our basic block is relatively simple: it immediately terminates by
returning the value of an expression.
-We can build the expression using @pxref{117,,gccjit;;context;;new_binary_op()}:
+We can build the expression using @pxref{11b,,gccjit;;context;;new_binary_op()}:
@example
gccjit::rvalue expr =
A @code{gccjit::rvalue} is another example of a
@code{gccjit::object} subclass. As before, we can print it with
-@pxref{115,,gccjit;;object;;get_debug_string()}.
+@pxref{119,,gccjit;;object;;get_debug_string()}.
@example
printf ("expr: %s\n", expr.get_debug_string ().c_str ());
@noindent
OK, we've populated the context. We can now compile it using
-@pxref{118,,gccjit;;context;;compile()}:
+@pxref{11c,,gccjit;;context;;compile()}:
@example
gcc_jit_result *result;
@end menu
@node Options<3>,Full example<3>,,Tutorial part 2 Creating a trivial machine code function<2>
-@anchor{cp/intro/tutorial02 options}@anchor{119}
+@anchor{cp/intro/tutorial02 options}@anchor{11d}
@subsubsection Options
To get more information on what's going on, you can set debugging flags
-on the context using @pxref{11a,,gccjit;;context;;set_bool_option()}.
+on the context using @pxref{11e,,gccjit;;context;;set_bool_option()}.
@c (I'm deliberately not mentioning
@c :c:macro:`GCC_JIT_BOOL_OPTION_DUMP_INITIAL_TREE` here since I think
By default, no optimizations are performed, the equivalent of GCC's
@cite{-O0} option. We can turn things up to e.g. @cite{-O3} by calling
-@pxref{11b,,gccjit;;context;;set_int_option()} with
+@pxref{11f,,gccjit;;context;;set_int_option()} with
@pxref{1f,,GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL}:
@example
Naturally this has only a small effect on such a trivial function.
@node Full example<3>,,Options<3>,Tutorial part 2 Creating a trivial machine code function<2>
-@anchor{cp/intro/tutorial02 full-example}@anchor{11c}
+@anchor{cp/intro/tutorial02 full-example}@anchor{120}
@subsubsection Full example
@c <http://www.gnu.org/licenses/>.
@node Tutorial part 3 Loops and variables<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>,Tutorial part 2 Creating a trivial machine code function<2>,Tutorial<2>
-@anchor{cp/intro/tutorial03 tutorial-part-3-loops-and-variables}@anchor{11d}@anchor{cp/intro/tutorial03 doc}@anchor{11e}
+@anchor{cp/intro/tutorial03 tutorial-part-3-loops-and-variables}@anchor{121}@anchor{cp/intro/tutorial03 doc}@anchor{122}
@subsection Tutorial part 3: Loops and variables
@end menu
@node Expressions lvalues and rvalues<2>,Control flow<2>,,Tutorial part 3 Loops and variables<2>
-@anchor{cp/intro/tutorial03 expressions-lvalues-and-rvalues}@anchor{11f}
+@anchor{cp/intro/tutorial03 expressions-lvalues-and-rvalues}@anchor{123}
@subsubsection Expressions: lvalues and rvalues
Our new example has a new kind of expression: we have two local
variables. We create them by calling
-@pxref{120,,gccjit;;function;;new_local()}, supplying a type and a name:
+@pxref{124,,gccjit;;function;;new_local()}, supplying a type and a name:
@example
/* Build locals: */
an assignment of @cite{0} to @cite{local_i} at the beginning of the function.
@node Control flow<2>,Visualizing the control flow graph<2>,Expressions lvalues and rvalues<2>,Tutorial part 3 Loops and variables<2>
-@anchor{cp/intro/tutorial03 control-flow}@anchor{121}
+@anchor{cp/intro/tutorial03 control-flow}@anchor{125}
@subsubsection Control flow
The entry block @cite{b_initial} consists of initializations followed by a jump
to the conditional. We assign @cite{0} to @cite{i} and to @cite{sum}, using
-@pxref{122,,gccjit;;block;;add_assignment()} to add
-an assignment statement, and using @pxref{123,,gccjit;;context;;zero()} to get
+@pxref{126,,gccjit;;block;;add_assignment()} to add
+an assignment statement, and using @pxref{127,,gccjit;;context;;zero()} to get
the constant value @cite{0} for the relevant type for the right-hand side of
the assignment:
one of two destination blocks depending on a boolean
@code{gccjit::rvalue}, in this case the comparison of @cite{i} and @cite{n}.
-We could build the comparison using @pxref{124,,gccjit;;context;;new_comparison()}:
+We could build the comparison using @pxref{128,,gccjit;;context;;new_comparison()}:
@example
gccjit::rvalue guard =
@noindent
and can then use this to add @cite{b_loop_cond}'s sole statement, via
-@pxref{125,,gccjit;;block;;end_with_conditional()}:
+@pxref{129,,gccjit;;block;;end_with_conditional()}:
@example
b_loop_cond.end_with_conditional (guard,
The C statement @cite{sum += i * i;} is an assignment operation, where an
lvalue is modified "in-place". We use
-@pxref{126,,gccjit;;block;;add_assignment_op()} to handle these operations:
+@pxref{12a,,gccjit;;block;;add_assignment_op()} to handle these operations:
@example
/* sum += i * i */
@cartouche
@quotation Note
For numeric constants other than 0 or 1, we could use
-@pxref{127,,gccjit;;context;;new_rvalue()}, which has overloads
+@pxref{12b,,gccjit;;context;;new_rvalue()}, which has overloads
for both @code{int} and @code{double}.
@end quotation
@end cartouche
@noindent
@node Visualizing the control flow graph<2>,Full example<4>,Control flow<2>,Tutorial part 3 Loops and variables<2>
-@anchor{cp/intro/tutorial03 visualizing-the-control-flow-graph}@anchor{128}
+@anchor{cp/intro/tutorial03 visualizing-the-control-flow-graph}@anchor{12c}
@subsubsection Visualizing the control flow graph
You can see the control flow graph of a function using
-@pxref{129,,gccjit;;function;;dump_to_dot()}:
+@pxref{12d,,gccjit;;function;;dump_to_dot()}:
@example
func.dump_to_dot ("/tmp/sum-of-squares.dot");
@end quotation
@node Full example<4>,,Visualizing the control flow graph<2>,Tutorial part 3 Loops and variables<2>
-@anchor{cp/intro/tutorial03 full-example}@anchor{12a}
+@anchor{cp/intro/tutorial03 full-example}@anchor{12e}
@subsubsection Full example
@c <http://www.gnu.org/licenses/>.
@node Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>,,Tutorial part 3 Loops and variables<2>,Tutorial<2>
-@anchor{cp/intro/tutorial04 tutorial-part-4-adding-jit-compilation-to-a-toy-interpreter}@anchor{12b}@anchor{cp/intro/tutorial04 doc}@anchor{12c}
+@anchor{cp/intro/tutorial04 tutorial-part-4-adding-jit-compilation-to-a-toy-interpreter}@anchor{12f}@anchor{cp/intro/tutorial04 doc}@anchor{130}
@subsection Tutorial part 4: Adding JIT-compilation to a toy interpreter
@end menu
@node Our toy interpreter<2>,Compiling to machine code<2>,,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>
-@anchor{cp/intro/tutorial04 our-toy-interpreter}@anchor{12d}
+@anchor{cp/intro/tutorial04 our-toy-interpreter}@anchor{131}
@subsubsection Our toy interpreter
@end quotation
@node Compiling to machine code<2>,Setting things up<2>,Our toy interpreter<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>
-@anchor{cp/intro/tutorial04 compiling-to-machine-code}@anchor{12e}
+@anchor{cp/intro/tutorial04 compiling-to-machine-code}@anchor{132}
@subsubsection Compiling to machine code
@end quotation
@node Setting things up<2>,Populating the function<2>,Compiling to machine code<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>
-@anchor{cp/intro/tutorial04 setting-things-up}@anchor{12f}
+@anchor{cp/intro/tutorial04 setting-things-up}@anchor{133}
@subsubsection Setting things up
@end quotation
@node Populating the function<2>,Verifying the control flow graph<2>,Setting things up<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>
-@anchor{cp/intro/tutorial04 populating-the-function}@anchor{130}
+@anchor{cp/intro/tutorial04 populating-the-function}@anchor{134}
@subsubsection Populating the function
uninitialized.
To track this kind of thing down, we can use
-@pxref{131,,gccjit;;block;;add_comment()} to add descriptive comments
+@pxref{135,,gccjit;;block;;add_comment()} to add descriptive comments
to the internal representation. This is invaluable when looking through
the generated IR for, say @code{factorial}:
This is analogous to simply incrementing the program counter.
@node Verifying the control flow graph<2>,Compiling the context<2>,Populating the function<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>
-@anchor{cp/intro/tutorial04 verifying-the-control-flow-graph}@anchor{132}
+@anchor{cp/intro/tutorial04 verifying-the-control-flow-graph}@anchor{136}
@subsubsection Verifying the control flow graph
Having finished looping over the blocks, the context is complete.
As before, we can verify that the control flow and statements are sane by
-using @pxref{129,,gccjit;;function;;dump_to_dot()}:
+using @pxref{12d,,gccjit;;function;;dump_to_dot()}:
@example
fn.dump_to_dot ("/tmp/factorial.dot");
@end quotation
@node Compiling the context<2>,Single-stepping through the generated code<2>,Verifying the control flow graph<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>
-@anchor{cp/intro/tutorial04 compiling-the-context}@anchor{133}
+@anchor{cp/intro/tutorial04 compiling-the-context}@anchor{137}
@subsubsection Compiling the context
@end quotation
@node Single-stepping through the generated code<2>,Examining the generated code<2>,Compiling the context<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>
-@anchor{cp/intro/tutorial04 single-stepping-through-the-generated-code}@anchor{134}
+@anchor{cp/intro/tutorial04 single-stepping-through-the-generated-code}@anchor{138}
@subsubsection Single-stepping through the generated code
@item
Set up source code locations for our statements, so that we can
meaningfully step through the code. We did this above by
-calling @pxref{135,,gccjit;;context;;new_location()} and using the
+calling @pxref{139,,gccjit;;context;;new_location()} and using the
results.
@item
Enable the generation of debugging information, by setting
@pxref{42,,GCC_JIT_BOOL_OPTION_DEBUGINFO} on the
@code{gccjit::context} via
-@pxref{11a,,gccjit;;context;;set_bool_option()}:
+@pxref{11e,,gccjit;;context;;set_bool_option()}:
@example
ctxt.set_bool_option (GCC_JIT_BOOL_OPTION_DEBUGINFO, 1);
@end cartouche
@node Examining the generated code<2>,Putting it all together<2>,Single-stepping through the generated code<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>
-@anchor{cp/intro/tutorial04 examining-the-generated-code}@anchor{136}
+@anchor{cp/intro/tutorial04 examining-the-generated-code}@anchor{13a}
@subsubsection Examining the generated code
How good is the optimized code?
We can turn up optimizations, by calling
-@pxref{11b,,gccjit;;context;;set_int_option()} with
+@pxref{11f,,gccjit;;context;;set_int_option()} with
@pxref{1f,,GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL}:
@example
recursive call (in favor of an iteration).
@node Putting it all together<2>,Behind the curtain How does our code get optimized?<2>,Examining the generated code<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>
-@anchor{cp/intro/tutorial04 putting-it-all-together}@anchor{137}
+@anchor{cp/intro/tutorial04 putting-it-all-together}@anchor{13b}
@subsubsection Putting it all together
@noindent
@node Behind the curtain How does our code get optimized?<2>,,Putting it all together<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>
-@anchor{cp/intro/tutorial04 behind-the-curtain-how-does-our-code-get-optimized}@anchor{138}
+@anchor{cp/intro/tutorial04 behind-the-curtain-how-does-our-code-get-optimized}@anchor{13c}
@subsubsection Behind the curtain: How does our code get optimized?
@end menu
@node Optimizing away stack manipulation<2>,Elimination of tail recursion<2>,,Behind the curtain How does our code get optimized?<2>
-@anchor{cp/intro/tutorial04 optimizing-away-stack-manipulation}@anchor{139}
+@anchor{cp/intro/tutorial04 optimizing-away-stack-manipulation}@anchor{13d}
@subsubsection Optimizing away stack manipulation
@noindent
@node Elimination of tail recursion<2>,,Optimizing away stack manipulation<2>,Behind the curtain How does our code get optimized?<2>
-@anchor{cp/intro/tutorial04 elimination-of-tail-recursion}@anchor{13a}
+@anchor{cp/intro/tutorial04 elimination-of-tail-recursion}@anchor{13e}
@subsubsection Elimination of tail recursion
@c <http://www.gnu.org/licenses/>.
@node Topic Reference<2>,,Tutorial<2>,C++ bindings for libgccjit
-@anchor{cp/topics/index doc}@anchor{13b}@anchor{cp/topics/index topic-reference}@anchor{13c}
+@anchor{cp/topics/index doc}@anchor{13f}@anchor{cp/topics/index topic-reference}@anchor{140}
@section Topic Reference
* Binary Operations: Binary Operations<2>.
* Comparisons: Comparisons<2>.
* Function calls: Function calls<2>.
+* Function pointers: Function pointers<2>.
* Type-coercion: Type-coercion<2>.
Lvalues
@node Compilation contexts<2>,Objects<2>,,Topic Reference<2>
-@anchor{cp/topics/contexts compilation-contexts}@anchor{13d}@anchor{cp/topics/contexts doc}@anchor{13e}
+@anchor{cp/topics/contexts compilation-contexts}@anchor{141}@anchor{cp/topics/contexts doc}@anchor{142}
@subsection Compilation contexts
@geindex gccjit;;context (C++ class)
-@anchor{cp/topics/contexts gccjit context}@anchor{13f}
+@anchor{cp/topics/contexts gccjit context}@anchor{143}
@deffn {C++ Class} gccjit::context
@end deffn
-The top-level of the C++ API is the @pxref{13f,,gccjit;;context} type.
+The top-level of the C++ API is the @pxref{143,,gccjit;;context} type.
-A @pxref{13f,,gccjit;;context} instance encapsulates the state of a
+A @pxref{143,,gccjit;;context} instance encapsulates the state of a
compilation.
You can set up options on it, and add types, functions and code.
-Invoking @pxref{118,,gccjit;;context;;compile()} on it gives you a
+Invoking @pxref{11c,,gccjit;;context;;compile()} on it gives you a
@pxref{16,,gcc_jit_result *}.
It is a thin wrapper around the C API's @pxref{8,,gcc_jit_context *}.
@end menu
@node Lifetime-management<2>,Thread-safety<2>,,Compilation contexts<2>
-@anchor{cp/topics/contexts lifetime-management}@anchor{140}
+@anchor{cp/topics/contexts lifetime-management}@anchor{144}
@subsubsection Lifetime-management
cleanup of such objects is done for you when the context is released.
@geindex gccjit;;context;;acquire (C++ function)
-@anchor{cp/topics/contexts gccjit context acquire}@anchor{112}
+@anchor{cp/topics/contexts gccjit context acquire}@anchor{116}
@deffn {C++ Function} gccjit::context gccjit::context::acquire ()
-This function acquires a new @pxref{13f,,gccjit;;context} instance,
+This function acquires a new @pxref{143,,gccjit;;context} instance,
which is independent of any others that may be present within this
process.
@end deffn
@geindex gccjit;;context;;release (C++ function)
-@anchor{cp/topics/contexts gccjit context release}@anchor{114}
+@anchor{cp/topics/contexts gccjit context release}@anchor{118}
@deffn {C++ Function} void gccjit::context::release ()
This function releases all resources associated with the given context.
@end deffn
@geindex gccjit;;context;;new_child_context (C++ function)
-@anchor{cp/topics/contexts gccjit context new_child_context}@anchor{141}
+@anchor{cp/topics/contexts gccjit context new_child_context}@anchor{145}
@deffn {C++ Function} gccjit::context gccjit::context::new_child_context ()
Given an existing JIT context, create a child context.
@end deffn
@node Thread-safety<2>,Error-handling<3>,Lifetime-management<2>,Compilation contexts<2>
-@anchor{cp/topics/contexts thread-safety}@anchor{142}
+@anchor{cp/topics/contexts thread-safety}@anchor{146}
@subsubsection Thread-safety
-Instances of @pxref{13f,,gccjit;;context} created via
-@pxref{112,,gccjit;;context;;acquire()} are independent from each other:
+Instances of @pxref{143,,gccjit;;context} created via
+@pxref{116,,gccjit;;context;;acquire()} are independent from each other:
only one thread may use a given context at once, but multiple threads
could each have their own contexts without needing locks.
-Contexts created via @pxref{141,,gccjit;;context;;new_child_context()} are
+Contexts created via @pxref{145,,gccjit;;context;;new_child_context()} are
related to their parent context. They can be partitioned by their
ultimate ancestor into independent "family trees". Only one thread
within a process may use a given "family tree" of such contexts at once,
around entire such context partitions.
@node Error-handling<3>,Debugging<2>,Thread-safety<2>,Compilation contexts<2>
-@anchor{cp/topics/contexts error-handling}@anchor{143}
+@anchor{cp/topics/contexts error-handling}@anchor{147}
@subsubsection Error-handling
API gracefully handles a NULL being passed in for any argument.
Errors are printed on stderr and can be queried using
-@pxref{144,,gccjit;;context;;get_first_error()}.
+@pxref{148,,gccjit;;context;;get_first_error()}.
@geindex gccjit;;context;;get_first_error (C++ function)
-@anchor{cp/topics/contexts gccjit context get_first_error__gccjit contextP}@anchor{144}
+@anchor{cp/topics/contexts gccjit context get_first_error__gccjit contextP}@anchor{148}
@deffn {C++ Function} const char* gccjit::context::get_first_error (gccjit::context* ctxt)
Returns the first error message that occurred on the context.
@end deffn
@node Debugging<2>,Options<4>,Error-handling<3>,Compilation contexts<2>
-@anchor{cp/topics/contexts debugging}@anchor{145}
+@anchor{cp/topics/contexts debugging}@anchor{149}
@subsubsection Debugging
@geindex gccjit;;context;;dump_to_file (C++ function)
-@anchor{cp/topics/contexts gccjit context dump_to_file__ssCR i}@anchor{146}
+@anchor{cp/topics/contexts gccjit context dump_to_file__ssCR i}@anchor{14a}
@deffn {C++ Function} void gccjit::context::dump_to_file (const std::string& path, int update_locations)
To help with debugging: dump a C-like representation to the given path,
describing what's been set up on the context.
-If "update_locations" is true, then also set up @pxref{147,,gccjit;;location}
+If "update_locations" is true, then also set up @pxref{14b,,gccjit;;location}
information throughout the context, pointing at the dump file as if it
were a source file. This may be of use in conjunction with
@code{GCCJIT::BOOL_OPTION_DEBUGINFO} to allow stepping through the
@end deffn
@geindex gccjit;;context;;dump_reproducer_to_file (C++ function)
-@anchor{cp/topics/contexts gccjit context dump_reproducer_to_file__gcc_jit_contextP cCP}@anchor{148}
+@anchor{cp/topics/contexts gccjit context dump_reproducer_to_file__gcc_jit_contextP cCP}@anchor{14c}
@deffn {C++ Function} void gccjit::context::dump_reproducer_to_file (gcc_jit_context* ctxt, const char* path)
This is a thin wrapper around the C API
@end deffn
@node Options<4>,,Debugging<2>,Compilation contexts<2>
-@anchor{cp/topics/contexts options}@anchor{149}
+@anchor{cp/topics/contexts options}@anchor{14d}
@subsubsection Options
@end menu
@node String Options<2>,Boolean options<2>,,Options<4>
-@anchor{cp/topics/contexts string-options}@anchor{14a}
+@anchor{cp/topics/contexts string-options}@anchor{14e}
@subsubsection String Options
@geindex gccjit;;context;;set_str_option (C++ function)
-@anchor{cp/topics/contexts gccjit context set_str_option__enum cCP}@anchor{14b}
+@anchor{cp/topics/contexts gccjit context set_str_option__enum cCP}@anchor{14f}
@deffn {C++ Function} void gccjit::context::set_str_option (enum gcc_jit_str_option, const char* value)
Set a string option of the context.
@end deffn
@node Boolean options<2>,Integer options<2>,String Options<2>,Options<4>
-@anchor{cp/topics/contexts boolean-options}@anchor{14c}
+@anchor{cp/topics/contexts boolean-options}@anchor{150}
@subsubsection Boolean options
@geindex gccjit;;context;;set_bool_option (C++ function)
-@anchor{cp/topics/contexts gccjit context set_bool_option__enum i}@anchor{11a}
+@anchor{cp/topics/contexts gccjit context set_bool_option__enum i}@anchor{11e}
@deffn {C++ Function} void gccjit::context::set_bool_option (enum gcc_jit_bool_option, int value)
Set a boolean option of the context.
@end deffn
@geindex gccjit;;context;;set_bool_allow_unreachable_blocks (C++ function)
-@anchor{cp/topics/contexts gccjit context set_bool_allow_unreachable_blocks__i}@anchor{14d}
+@anchor{cp/topics/contexts gccjit context set_bool_allow_unreachable_blocks__i}@anchor{151}
@deffn {C++ Function} void gccjit::context::set_bool_allow_unreachable_blocks (int bool_value)
By default, libgccjit will issue an error about unreachable blocks
@end deffn
@geindex gccjit;;context;;set_bool_use_external_driver (C++ function)
-@anchor{cp/topics/contexts gccjit context set_bool_use_external_driver__i}@anchor{14e}
+@anchor{cp/topics/contexts gccjit context set_bool_use_external_driver__i}@anchor{152}
@deffn {C++ Function} void gccjit::context::set_bool_use_external_driver (int bool_value)
libgccjit internally generates assembler, and uses "driver" code
@end deffn
@node Integer options<2>,Additional command-line options<2>,Boolean options<2>,Options<4>
-@anchor{cp/topics/contexts integer-options}@anchor{14f}
+@anchor{cp/topics/contexts integer-options}@anchor{153}
@subsubsection Integer options
@geindex gccjit;;context;;set_int_option (C++ function)
-@anchor{cp/topics/contexts gccjit context set_int_option__enum i}@anchor{11b}
+@anchor{cp/topics/contexts gccjit context set_int_option__enum i}@anchor{11f}
@deffn {C++ Function} void gccjit::context::set_int_option (enum gcc_jit_int_option, int value)
Set an integer option of the context.
@end deffn
@node Additional command-line options<2>,,Integer options<2>,Options<4>
-@anchor{cp/topics/contexts additional-command-line-options}@anchor{150}
+@anchor{cp/topics/contexts additional-command-line-options}@anchor{154}
@subsubsection Additional command-line options
@geindex gccjit;;context;;add_command_line_option (C++ function)
-@anchor{cp/topics/contexts gccjit context add_command_line_option__cCP}@anchor{151}
+@anchor{cp/topics/contexts gccjit context add_command_line_option__cCP}@anchor{155}
@deffn {C++ Function} void gccjit::context::add_command_line_option (const char* optname)
Add an arbitrary gcc command-line option to the context for use
@c <http://www.gnu.org/licenses/>.
@node Objects<2>,Types<2>,Compilation contexts<2>,Topic Reference<2>
-@anchor{cp/topics/objects objects}@anchor{152}@anchor{cp/topics/objects doc}@anchor{153}
+@anchor{cp/topics/objects objects}@anchor{156}@anchor{cp/topics/objects doc}@anchor{157}
@subsection Objects
@geindex gccjit;;object (C++ class)
-@anchor{cp/topics/objects gccjit object}@anchor{154}
+@anchor{cp/topics/objects gccjit object}@anchor{158}
@deffn {C++ Class} gccjit::object
@end deffn
Almost every entity in the API (with the exception of
-@pxref{13f,,gccjit;;context} and @pxref{16,,gcc_jit_result *}) is a
-"contextual" object, a @pxref{154,,gccjit;;object}.
+@pxref{143,,gccjit;;context} and @pxref{16,,gcc_jit_result *}) is a
+"contextual" object, a @pxref{158,,gccjit;;object}.
A JIT object:
@itemize *
@item
-is associated with a @pxref{13f,,gccjit;;context}.
+is associated with a @pxref{143,,gccjit;;context}.
@item
is automatically cleaned up for you when its context is released so
@noindent
-The @pxref{154,,gccjit;;object} base class has the following operations:
+The @pxref{158,,gccjit;;object} base class has the following operations:
@geindex gccjit;;object;;get_context (C++ function)
-@anchor{cp/topics/objects gccjit object get_contextC}@anchor{155}
+@anchor{cp/topics/objects gccjit object get_contextC}@anchor{159}
@deffn {C++ Function} gccjit::context gccjit::object::get_context () const
Which context is the obj within?
@end deffn
@geindex gccjit;;object;;get_debug_string (C++ function)
-@anchor{cp/topics/objects gccjit object get_debug_stringC}@anchor{115}
+@anchor{cp/topics/objects gccjit object get_debug_stringC}@anchor{119}
@deffn {C++ Function} std::string gccjit::object::get_debug_string () const
Generate a human-readable description for the given object.
@c <http://www.gnu.org/licenses/>.
@node Types<2>,Expressions<2>,Objects<2>,Topic Reference<2>
-@anchor{cp/topics/types doc}@anchor{156}@anchor{cp/topics/types types}@anchor{157}
+@anchor{cp/topics/types doc}@anchor{15a}@anchor{cp/topics/types types}@anchor{15b}
@subsection Types
@geindex gccjit;;type (C++ class)
-@anchor{cp/topics/types gccjit type}@anchor{158}
+@anchor{cp/topics/types gccjit type}@anchor{15c}
@deffn {C++ Class} gccjit::type
gccjit::type represents a type within the library. It is a subclass
-of @pxref{154,,gccjit;;object}.
+of @pxref{158,,gccjit;;object}.
@end deffn
Types can be created in several ways:
@item
fundamental types can be accessed using
-@pxref{113,,gccjit;;context;;get_type()}:
+@pxref{117,,gccjit;;context;;get_type()}:
@example
gccjit::type int_type = ctxt.get_type (GCC_JIT_TYPE_INT);
@item
derived types can be accessed by using functions such as
-@pxref{159,,gccjit;;type;;get_pointer()} and @pxref{15a,,gccjit;;type;;get_const()}:
+@pxref{15d,,gccjit;;type;;get_pointer()} and @pxref{15e,,gccjit;;type;;get_const()}:
@example
gccjit::type const_int_star = int_type.get_const ().get_pointer ();
@end menu
@node Standard types<2>,Pointers const and volatile<2>,,Types<2>
-@anchor{cp/topics/types standard-types}@anchor{15b}
+@anchor{cp/topics/types standard-types}@anchor{15f}
@subsubsection Standard types
@geindex gccjit;;context;;get_type (C++ function)
-@anchor{cp/topics/types gccjit context get_type__enum}@anchor{113}
+@anchor{cp/topics/types gccjit context get_type__enum}@anchor{117}
@deffn {C++ Function} gccjit::type gccjit::context::get_type (enum gcc_jit_types)
Access a specific type. This is a thin wrapper around
@end deffn
@geindex gccjit;;context;;get_int_type (C++ function)
-@anchor{cp/topics/types gccjit context get_int_type__s i}@anchor{15c}
+@anchor{cp/topics/types gccjit context get_int_type__s i}@anchor{160}
@deffn {C++ Function} gccjit::type gccjit::context::get_int_type (size_t num_bytes, int is_signed)
Access the integer type of the given size.
@end deffn
@geindex gccjit;;context;;get_int_type<T> (C++ function)
-@anchor{cp/topics/types gccjit context get_int_type T}@anchor{15d}
+@anchor{cp/topics/types gccjit context get_int_type T}@anchor{161}
@deffn {C++ Function} gccjit::type gccjit::context::get_int_type<T> ()
Access the given integer type. For example, you could map the
@end deffn
@node Pointers const and volatile<2>,Vector types<2>,Standard types<2>,Types<2>
-@anchor{cp/topics/types pointers-const-and-volatile}@anchor{15e}
+@anchor{cp/topics/types pointers-const-and-volatile}@anchor{162}
@subsubsection Pointers, @cite{const}, and @cite{volatile}
@geindex gccjit;;type;;get_pointer (C++ function)
-@anchor{cp/topics/types gccjit type get_pointer}@anchor{159}
+@anchor{cp/topics/types gccjit type get_pointer}@anchor{15d}
@deffn {C++ Function} gccjit::type gccjit::type::get_pointer ()
Given type "T", get type "T*".
@end deffn
@geindex gccjit;;type;;get_const (C++ function)
-@anchor{cp/topics/types gccjit type get_const}@anchor{15a}
+@anchor{cp/topics/types gccjit type get_const}@anchor{15e}
@deffn {C++ Function} gccjit::type gccjit::type::get_const ()
Given type "T", get type "const T".
@end deffn
@geindex gccjit;;type;;get_volatile (C++ function)
-@anchor{cp/topics/types gccjit type get_volatile}@anchor{15f}
+@anchor{cp/topics/types gccjit type get_volatile}@anchor{163}
@deffn {C++ Function} gccjit::type gccjit::type::get_volatile ()
Given type "T", get type "volatile T".
@end deffn
@geindex gccjit;;type;;get_aligned (C++ function)
-@anchor{cp/topics/types gccjit type get_aligned__s}@anchor{160}
+@anchor{cp/topics/types gccjit type get_aligned__s}@anchor{164}
@deffn {C++ Function} gccjit::type gccjit::type::get_aligned (size_t alignment_in_bytes)
Given type "T", get type:
@end deffn
@geindex gccjit;;context;;new_array_type (C++ function)
-@anchor{cp/topics/types gccjit context new_array_type__gccjit type i gccjit location}@anchor{161}
+@anchor{cp/topics/types gccjit context new_array_type__gccjit type i gccjit location}@anchor{165}
@deffn {C++ Function} gccjit::type gccjit::context::new_array_type (gccjit::type element_type, int num_elements, gccjit::location loc)
Given type "T", get type "T[N]" (for a constant N).
@end deffn
@node Vector types<2>,Structures and unions<2>,Pointers const and volatile<2>,Types<2>
-@anchor{cp/topics/types vector-types}@anchor{162}
+@anchor{cp/topics/types vector-types}@anchor{166}
@subsubsection Vector types
@geindex gccjit;;type;;get_vector (C++ function)
-@anchor{cp/topics/types gccjit type get_vector__s}@anchor{163}
+@anchor{cp/topics/types gccjit type get_vector__s}@anchor{167}
@deffn {C++ Function} gccjit::type gccjit::type::get_vector (size_t num_units)
Given type "T", get type:
@end deffn
@node Structures and unions<2>,,Vector types<2>,Types<2>
-@anchor{cp/topics/types structures-and-unions}@anchor{164}
+@anchor{cp/topics/types structures-and-unions}@anchor{168}
@subsubsection Structures and unions
@geindex gccjit;;struct_ (C++ class)
-@anchor{cp/topics/types gccjit struct_}@anchor{165}
+@anchor{cp/topics/types gccjit struct_}@anchor{169}
@deffn {C++ Class} gccjit::struct_
@end deffn
A compound type analagous to a C @cite{struct}.
-@pxref{165,,gccjit;;struct_} is a subclass of @pxref{158,,gccjit;;type} (and thus
-of @pxref{154,,gccjit;;object} in turn).
+@pxref{169,,gccjit;;struct_} is a subclass of @pxref{15c,,gccjit;;type} (and thus
+of @pxref{158,,gccjit;;object} in turn).
@geindex gccjit;;field (C++ class)
-@anchor{cp/topics/types gccjit field}@anchor{166}
+@anchor{cp/topics/types gccjit field}@anchor{16a}
@deffn {C++ Class} gccjit::field
@end deffn
-A field within a @pxref{165,,gccjit;;struct_}.
+A field within a @pxref{169,,gccjit;;struct_}.
-@pxref{166,,gccjit;;field} is a subclass of @pxref{154,,gccjit;;object}.
+@pxref{16a,,gccjit;;field} is a subclass of @pxref{158,,gccjit;;object}.
-You can model C @cite{struct} types by creating @pxref{165,,gccjit;;struct_} and
-@pxref{166,,gccjit;;field} instances, in either order:
+You can model C @cite{struct} types by creating @pxref{169,,gccjit;;struct_} and
+@pxref{16a,,gccjit;;field} instances, in either order:
@itemize *
@c FIXME: the above API doesn't seem to exist yet
@geindex gccjit;;context;;new_field (C++ function)
-@anchor{cp/topics/types gccjit context new_field__gccjit type cCP gccjit location}@anchor{167}
+@anchor{cp/topics/types gccjit context new_field__gccjit type cCP gccjit location}@anchor{16b}
@deffn {C++ Function} gccjit::field gccjit::context::new_field (gccjit::type type, const char* name, gccjit::location loc)
Construct a new field, with the given type and name.
@end deffn
@geindex gccjit;;context;;new_struct_type (C++ function)
-@anchor{cp/topics/types gccjit context new_struct_type__ssCR std vector field R gccjit location}@anchor{168}
+@anchor{cp/topics/types gccjit context new_struct_type__ssCR std vector field R gccjit location}@anchor{16c}
@deffn {C++ Function} gccjit::struct_ gccjit::context::new_struct_type (const std::string& name, std::vector<field>& fields, gccjit::location loc)
@quotation
@end deffn
@geindex gccjit;;context;;new_opaque_struct (C++ function)
-@anchor{cp/topics/types gccjit context new_opaque_struct__ssCR gccjit location}@anchor{169}
+@anchor{cp/topics/types gccjit context new_opaque_struct__ssCR gccjit location}@anchor{16d}
@deffn {C++ Function} gccjit::struct_ gccjit::context::new_opaque_struct (const std::string& name, gccjit::location loc)
Construct a new struct type, with the given name, but without
@c <http://www.gnu.org/licenses/>.
@node Expressions<2>,Creating and using functions<2>,Types<2>,Topic Reference<2>
-@anchor{cp/topics/expressions expressions}@anchor{16a}@anchor{cp/topics/expressions doc}@anchor{16b}
+@anchor{cp/topics/expressions expressions}@anchor{16e}@anchor{cp/topics/expressions doc}@anchor{16f}
@subsection Expressions
* Binary Operations: Binary Operations<2>.
* Comparisons: Comparisons<2>.
* Function calls: Function calls<2>.
+* Function pointers: Function pointers<2>.
* Type-coercion: Type-coercion<2>.
Lvalues
@node Rvalues<2>,Lvalues<2>,,Expressions<2>
-@anchor{cp/topics/expressions rvalues}@anchor{16c}
+@anchor{cp/topics/expressions rvalues}@anchor{170}
@subsubsection Rvalues
@geindex gccjit;;rvalue (C++ class)
-@anchor{cp/topics/expressions gccjit rvalue}@anchor{16d}
+@anchor{cp/topics/expressions gccjit rvalue}@anchor{171}
@deffn {C++ Class} gccjit::rvalue
@end deffn
-A @pxref{16d,,gccjit;;rvalue} is an expression that can be computed. It is a
-subclass of @pxref{154,,gccjit;;object}, and is a thin wrapper around
+A @pxref{171,,gccjit;;rvalue} is an expression that can be computed. It is a
+subclass of @pxref{158,,gccjit;;object}, and is a thin wrapper around
@pxref{13,,gcc_jit_rvalue *} from the C API.
It can be simple, e.g.:
that types match up correctly (otherwise the context will emit an error).
@geindex gccjit;;rvalue;;get_type (C++ function)
-@anchor{cp/topics/expressions gccjit rvalue get_type}@anchor{16e}
+@anchor{cp/topics/expressions gccjit rvalue get_type}@anchor{172}
@deffn {C++ Function} gccjit::type gccjit::rvalue::get_type ()
Get the type of this rvalue.
* Binary Operations: Binary Operations<2>.
* Comparisons: Comparisons<2>.
* Function calls: Function calls<2>.
+* Function pointers: Function pointers<2>.
* Type-coercion: Type-coercion<2>.
@end menu
@node Simple expressions<2>,Unary Operations<2>,,Rvalues<2>
-@anchor{cp/topics/expressions simple-expressions}@anchor{16f}
+@anchor{cp/topics/expressions simple-expressions}@anchor{173}
@subsubsection Simple expressions
@geindex gccjit;;context;;new_rvalue (C++ function)
-@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type iC}@anchor{127}
+@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type iC}@anchor{12b}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_rvalue (gccjit::type numeric_type, int value) const
Given a numeric type (integer or floating point), build an rvalue for
@end deffn
@geindex gccjit;;context;;new_rvalue (C++ function)
-@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type lC}@anchor{170}
+@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type lC}@anchor{174}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_rvalue (gccjit::type numeric_type, long value) const
Given a numeric type (integer or floating point), build an rvalue for
@end deffn
@geindex gccjit;;context;;zero (C++ function)
-@anchor{cp/topics/expressions gccjit context zero__gccjit typeC}@anchor{123}
+@anchor{cp/topics/expressions gccjit context zero__gccjit typeC}@anchor{127}
@deffn {C++ Function} gccjit::rvalue gccjit::context::zero (gccjit::type numeric_type) const
Given a numeric type (integer or floating point), get the rvalue for
@end deffn
@geindex gccjit;;context;;one (C++ function)
-@anchor{cp/topics/expressions gccjit context one__gccjit typeC}@anchor{171}
+@anchor{cp/topics/expressions gccjit context one__gccjit typeC}@anchor{175}
@deffn {C++ Function} gccjit::rvalue gccjit::context::one (gccjit::type numeric_type) const
Given a numeric type (integer or floating point), get the rvalue for
@end deffn
@geindex gccjit;;context;;new_rvalue (C++ function)
-@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type doubleC}@anchor{172}
+@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type doubleC}@anchor{176}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_rvalue (gccjit::type numeric_type, double value) const
Given a numeric type (integer or floating point), build an rvalue for
@end deffn
@geindex gccjit;;context;;new_rvalue (C++ function)
-@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type voidPC}@anchor{173}
+@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type voidPC}@anchor{177}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_rvalue (gccjit::type pointer_type, void* value) const
Given a pointer type, build an rvalue for the given address.
@end deffn
@geindex gccjit;;context;;new_rvalue (C++ function)
-@anchor{cp/topics/expressions gccjit context new_rvalue__ssCRC}@anchor{174}
+@anchor{cp/topics/expressions gccjit context new_rvalue__ssCRC}@anchor{178}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_rvalue (const std::string& value) const
Generate an rvalue of type @code{GCC_JIT_TYPE_CONST_CHAR_PTR} for
@end deffn
@node Unary Operations<2>,Binary Operations<2>,Simple expressions<2>,Rvalues<2>
-@anchor{cp/topics/expressions unary-operations}@anchor{175}
+@anchor{cp/topics/expressions unary-operations}@anchor{179}
@subsubsection Unary Operations
@geindex gccjit;;context;;new_unary_op (C++ function)
-@anchor{cp/topics/expressions gccjit context new_unary_op__enum gccjit type gccjit rvalue gccjit location}@anchor{176}
+@anchor{cp/topics/expressions gccjit context new_unary_op__enum gccjit type gccjit rvalue gccjit location}@anchor{17a}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_unary_op (enum gcc_jit_unary_op, gccjit::type result_type, gccjit::rvalue rvalue, gccjit::location loc)
Build a unary operation out of an input rvalue.
operation:
@geindex gccjit;;context;;new_minus (C++ function)
-@anchor{cp/topics/expressions gccjit context new_minus__gccjit type gccjit rvalue gccjit location}@anchor{177}
+@anchor{cp/topics/expressions gccjit context new_minus__gccjit type gccjit rvalue gccjit location}@anchor{17b}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_minus (gccjit::type result_type, gccjit::rvalue a, gccjit::location loc)
Negate an arithmetic value; for example:
@end deffn
@geindex new_bitwise_negate (C++ function)
-@anchor{cp/topics/expressions new_bitwise_negate__gccjit type gccjit rvalue gccjit location}@anchor{178}
+@anchor{cp/topics/expressions new_bitwise_negate__gccjit type gccjit rvalue gccjit location}@anchor{17c}
@deffn {C++ Function} gccjit::rvalue new_bitwise_negate (gccjit::type result_type, gccjit::rvalue a, gccjit::location loc)
Bitwise negation of an integer value (one's complement); for example:
@end deffn
@geindex new_logical_negate (C++ function)
-@anchor{cp/topics/expressions new_logical_negate__gccjit type gccjit rvalue gccjit location}@anchor{179}
+@anchor{cp/topics/expressions new_logical_negate__gccjit type gccjit rvalue gccjit location}@anchor{17d}
@deffn {C++ Function} gccjit::rvalue new_logical_negate (gccjit::type result_type, gccjit::rvalue a, gccjit::location loc)
Logical negation of an arithmetic or pointer value; for example:
The most concise way to spell them is with overloaded operators:
@geindex operator- (C++ function)
-@anchor{cp/topics/expressions sub-operator__gccjit rvalue}@anchor{17a}
+@anchor{cp/topics/expressions sub-operator__gccjit rvalue}@anchor{17e}
@deffn {C++ Function} gccjit::rvalue operator- (gccjit::rvalue a)
@example
@end deffn
@geindex operator~ (C++ function)
-@anchor{cp/topics/expressions inv-operator__gccjit rvalue}@anchor{17b}
+@anchor{cp/topics/expressions inv-operator__gccjit rvalue}@anchor{17f}
@deffn {C++ Function} gccjit::rvalue operator~ (gccjit::rvalue a)
@example
@end deffn
@geindex operator! (C++ function)
-@anchor{cp/topics/expressions not-operator__gccjit rvalue}@anchor{17c}
+@anchor{cp/topics/expressions not-operator__gccjit rvalue}@anchor{180}
@deffn {C++ Function} gccjit::rvalue operator! (gccjit::rvalue a)
@example
@end deffn
@node Binary Operations<2>,Comparisons<2>,Unary Operations<2>,Rvalues<2>
-@anchor{cp/topics/expressions binary-operations}@anchor{17d}
+@anchor{cp/topics/expressions binary-operations}@anchor{181}
@subsubsection Binary Operations
@geindex gccjit;;context;;new_binary_op (C++ function)
-@anchor{cp/topics/expressions gccjit context new_binary_op__enum gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{117}
+@anchor{cp/topics/expressions gccjit context new_binary_op__enum gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{11b}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_binary_op (enum gcc_jit_binary_op, gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
Build a binary operation out of two constituent rvalues.
operation:
@geindex gccjit;;context;;new_plus (C++ function)
-@anchor{cp/topics/expressions gccjit context new_plus__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{17e}
+@anchor{cp/topics/expressions gccjit context new_plus__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{182}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_plus (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_minus (C++ function)
-@anchor{cp/topics/expressions gccjit context new_minus__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{17f}
+@anchor{cp/topics/expressions gccjit context new_minus__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{183}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_minus (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_mult (C++ function)
-@anchor{cp/topics/expressions gccjit context new_mult__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{180}
+@anchor{cp/topics/expressions gccjit context new_mult__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{184}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_mult (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_divide (C++ function)
-@anchor{cp/topics/expressions gccjit context new_divide__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{181}
+@anchor{cp/topics/expressions gccjit context new_divide__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{185}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_divide (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_modulo (C++ function)
-@anchor{cp/topics/expressions gccjit context new_modulo__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{182}
+@anchor{cp/topics/expressions gccjit context new_modulo__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{186}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_modulo (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_bitwise_and (C++ function)
-@anchor{cp/topics/expressions gccjit context new_bitwise_and__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{183}
+@anchor{cp/topics/expressions gccjit context new_bitwise_and__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{187}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_bitwise_and (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_bitwise_xor (C++ function)
-@anchor{cp/topics/expressions gccjit context new_bitwise_xor__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{184}
+@anchor{cp/topics/expressions gccjit context new_bitwise_xor__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{188}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_bitwise_xor (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_bitwise_or (C++ function)
-@anchor{cp/topics/expressions gccjit context new_bitwise_or__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{185}
+@anchor{cp/topics/expressions gccjit context new_bitwise_or__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{189}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_bitwise_or (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_logical_and (C++ function)
-@anchor{cp/topics/expressions gccjit context new_logical_and__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{186}
+@anchor{cp/topics/expressions gccjit context new_logical_and__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{18a}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_logical_and (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_logical_or (C++ function)
-@anchor{cp/topics/expressions gccjit context new_logical_or__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{187}
+@anchor{cp/topics/expressions gccjit context new_logical_or__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{18b}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_logical_or (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
The most concise way to spell them is with overloaded operators:
@geindex operator+ (C++ function)
-@anchor{cp/topics/expressions add-operator__gccjit rvalue gccjit rvalue}@anchor{188}
+@anchor{cp/topics/expressions add-operator__gccjit rvalue gccjit rvalue}@anchor{18c}
@deffn {C++ Function} gccjit::rvalue operator+ (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator- (C++ function)
-@anchor{cp/topics/expressions sub-operator__gccjit rvalue gccjit rvalue}@anchor{189}
+@anchor{cp/topics/expressions sub-operator__gccjit rvalue gccjit rvalue}@anchor{18d}
@deffn {C++ Function} gccjit::rvalue operator- (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator* (C++ function)
-@anchor{cp/topics/expressions mul-operator__gccjit rvalue gccjit rvalue}@anchor{18a}
+@anchor{cp/topics/expressions mul-operator__gccjit rvalue gccjit rvalue}@anchor{18e}
@deffn {C++ Function} gccjit::rvalue operator* (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator/ (C++ function)
-@anchor{cp/topics/expressions div-operator__gccjit rvalue gccjit rvalue}@anchor{18b}
+@anchor{cp/topics/expressions div-operator__gccjit rvalue gccjit rvalue}@anchor{18f}
@deffn {C++ Function} gccjit::rvalue operator/ (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator% (C++ function)
-@anchor{cp/topics/expressions mod-operator__gccjit rvalue gccjit rvalue}@anchor{18c}
+@anchor{cp/topics/expressions mod-operator__gccjit rvalue gccjit rvalue}@anchor{190}
@deffn {C++ Function} gccjit::rvalue operator% (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator& (C++ function)
-@anchor{cp/topics/expressions and-operator__gccjit rvalue gccjit rvalue}@anchor{18d}
+@anchor{cp/topics/expressions and-operator__gccjit rvalue gccjit rvalue}@anchor{191}
@deffn {C++ Function} gccjit::rvalue operator& (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator^ (C++ function)
-@anchor{cp/topics/expressions xor-operator__gccjit rvalue gccjit rvalue}@anchor{18e}
+@anchor{cp/topics/expressions xor-operator__gccjit rvalue gccjit rvalue}@anchor{192}
@deffn {C++ Function} gccjit::rvalue operator^ (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator| (C++ function)
-@anchor{cp/topics/expressions or-operator__gccjit rvalue gccjit rvalue}@anchor{18f}
+@anchor{cp/topics/expressions or-operator__gccjit rvalue gccjit rvalue}@anchor{193}
@deffn {C++ Function} gccjit::rvalue operator| (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator&& (C++ function)
-@anchor{cp/topics/expressions sand-operator__gccjit rvalue gccjit rvalue}@anchor{190}
+@anchor{cp/topics/expressions sand-operator__gccjit rvalue gccjit rvalue}@anchor{194}
@deffn {C++ Function} gccjit::rvalue operator&& (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator|| (C++ function)
-@anchor{cp/topics/expressions sor-operator__gccjit rvalue gccjit rvalue}@anchor{191}
+@anchor{cp/topics/expressions sor-operator__gccjit rvalue gccjit rvalue}@anchor{195}
@deffn {C++ Function} gccjit::rvalue operator|| (gccjit::rvalue a, gccjit::rvalue b)
@example
@end quotation
@node Comparisons<2>,Function calls<2>,Binary Operations<2>,Rvalues<2>
-@anchor{cp/topics/expressions comparisons}@anchor{192}
+@anchor{cp/topics/expressions comparisons}@anchor{196}
@subsubsection Comparisons
@geindex gccjit;;context;;new_comparison (C++ function)
-@anchor{cp/topics/expressions gccjit context new_comparison__enum gccjit rvalue gccjit rvalue gccjit location}@anchor{124}
+@anchor{cp/topics/expressions gccjit context new_comparison__enum gccjit rvalue gccjit rvalue gccjit location}@anchor{128}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_comparison (enum gcc_jit_comparison, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
Build a boolean rvalue out of the comparison of two other rvalues.
operation:
@geindex gccjit;;context;;new_eq (C++ function)
-@anchor{cp/topics/expressions gccjit context new_eq__gccjit rvalue gccjit rvalue gccjit location}@anchor{193}
+@anchor{cp/topics/expressions gccjit context new_eq__gccjit rvalue gccjit rvalue gccjit location}@anchor{197}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_eq (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_ne (C++ function)
-@anchor{cp/topics/expressions gccjit context new_ne__gccjit rvalue gccjit rvalue gccjit location}@anchor{194}
+@anchor{cp/topics/expressions gccjit context new_ne__gccjit rvalue gccjit rvalue gccjit location}@anchor{198}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_ne (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_lt (C++ function)
-@anchor{cp/topics/expressions gccjit context new_lt__gccjit rvalue gccjit rvalue gccjit location}@anchor{195}
+@anchor{cp/topics/expressions gccjit context new_lt__gccjit rvalue gccjit rvalue gccjit location}@anchor{199}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_lt (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_le (C++ function)
-@anchor{cp/topics/expressions gccjit context new_le__gccjit rvalue gccjit rvalue gccjit location}@anchor{196}
+@anchor{cp/topics/expressions gccjit context new_le__gccjit rvalue gccjit rvalue gccjit location}@anchor{19a}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_le (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_gt (C++ function)
-@anchor{cp/topics/expressions gccjit context new_gt__gccjit rvalue gccjit rvalue gccjit location}@anchor{197}
+@anchor{cp/topics/expressions gccjit context new_gt__gccjit rvalue gccjit rvalue gccjit location}@anchor{19b}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_gt (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
@geindex gccjit;;context;;new_ge (C++ function)
-@anchor{cp/topics/expressions gccjit context new_ge__gccjit rvalue gccjit rvalue gccjit location}@anchor{198}
+@anchor{cp/topics/expressions gccjit context new_ge__gccjit rvalue gccjit rvalue gccjit location}@anchor{19c}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_ge (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc)
@end deffn
The most concise way to spell them is with overloaded operators:
@geindex operator== (C++ function)
-@anchor{cp/topics/expressions eq-operator__gccjit rvalue gccjit rvalue}@anchor{199}
+@anchor{cp/topics/expressions eq-operator__gccjit rvalue gccjit rvalue}@anchor{19d}
@deffn {C++ Function} gccjit::rvalue operator== (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator!= (C++ function)
-@anchor{cp/topics/expressions neq-operator__gccjit rvalue gccjit rvalue}@anchor{19a}
+@anchor{cp/topics/expressions neq-operator__gccjit rvalue gccjit rvalue}@anchor{19e}
@deffn {C++ Function} gccjit::rvalue operator!= (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator< (C++ function)
-@anchor{cp/topics/expressions lt-operator__gccjit rvalue gccjit rvalue}@anchor{19b}
+@anchor{cp/topics/expressions lt-operator__gccjit rvalue gccjit rvalue}@anchor{19f}
@deffn {C++ Function} gccjit::rvalue operator< (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator<= (C++ function)
-@anchor{cp/topics/expressions lte-operator__gccjit rvalue gccjit rvalue}@anchor{19c}
+@anchor{cp/topics/expressions lte-operator__gccjit rvalue gccjit rvalue}@anchor{1a0}
@deffn {C++ Function} gccjit::rvalue operator<= (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator> (C++ function)
-@anchor{cp/topics/expressions gt-operator__gccjit rvalue gccjit rvalue}@anchor{19d}
+@anchor{cp/topics/expressions gt-operator__gccjit rvalue gccjit rvalue}@anchor{1a1}
@deffn {C++ Function} gccjit::rvalue operator> (gccjit::rvalue a, gccjit::rvalue b)
@example
@end deffn
@geindex operator>= (C++ function)
-@anchor{cp/topics/expressions gte-operator__gccjit rvalue gccjit rvalue}@anchor{19e}
+@anchor{cp/topics/expressions gte-operator__gccjit rvalue gccjit rvalue}@anchor{1a2}
@deffn {C++ Function} gccjit::rvalue operator>= (gccjit::rvalue a, gccjit::rvalue b)
@example
@c TODO: beyond this point
-@node Function calls<2>,Type-coercion<2>,Comparisons<2>,Rvalues<2>
-@anchor{cp/topics/expressions function-calls}@anchor{19f}
+@node Function calls<2>,Function pointers<2>,Comparisons<2>,Rvalues<2>
+@anchor{cp/topics/expressions function-calls}@anchor{1a3}
@subsubsection Function calls
@geindex gcc_jit_context_new_call (C++ function)
-@anchor{cp/topics/expressions gcc_jit_context_new_call__gcc_jit_contextP gcc_jit_locationP gcc_jit_functionP i gcc_jit_rvaluePP}@anchor{1a0}
+@anchor{cp/topics/expressions gcc_jit_context_new_call__gcc_jit_contextP gcc_jit_locationP gcc_jit_functionP i gcc_jit_rvaluePP}@anchor{1a4}
@deffn {C++ Function} gcc_jit_rvalue* gcc_jit_context_new_call (gcc_jit_context* ctxt, gcc_jit_location* loc, gcc_jit_function* func, int numargs, gcc_jit_rvalue** args)
Given a function and the given table of argument rvalues, construct a
@cartouche
@quotation Note
@code{gccjit::context::new_call()} merely builds a
-@pxref{16d,,gccjit;;rvalue} i.e. an expression that can be evaluated,
+@pxref{171,,gccjit;;rvalue} i.e. an expression that can be evaluated,
perhaps as part of a more complicated expression.
The call @emph{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 @code{void} return type), use
-@pxref{1a1,,gccjit;;block;;add_eval()}:
+@pxref{1a5,,gccjit;;block;;add_eval()}:
@example
/* Add "(void)printf (arg0, arg1);". */
@end cartouche
@end deffn
-@node Type-coercion<2>,,Function calls<2>,Rvalues<2>
-@anchor{cp/topics/expressions type-coercion}@anchor{1a2}
+@node Function pointers<2>,Type-coercion<2>,Function calls<2>,Rvalues<2>
+@anchor{cp/topics/expressions function-pointers}@anchor{1a6}
+@subsubsection Function pointers
+
+
+@geindex gccjit;;function;;get_address (C++ function)
+@anchor{cp/topics/expressions gccjit function get_address__gccjit location}@anchor{1a7}
+@deffn {C++ Function} gccjit::rvalue gccjit::function::get_address (gccjit::location loc)
+
+Get the address of a function as an rvalue, of function pointer
+type.
+@end deffn
+
+@node Type-coercion<2>,,Function pointers<2>,Rvalues<2>
+@anchor{cp/topics/expressions type-coercion}@anchor{1a8}
@subsubsection Type-coercion
@geindex gccjit;;context;;new_cast (C++ function)
-@anchor{cp/topics/expressions gccjit context new_cast__gccjit rvalue gccjit type gccjit location}@anchor{1a3}
+@anchor{cp/topics/expressions gccjit context new_cast__gccjit rvalue gccjit type gccjit location}@anchor{1a9}
@deffn {C++ Function} gccjit::rvalue gccjit::context::new_cast (gccjit::rvalue rvalue, gccjit::type type, gccjit::location loc)
Given an rvalue of T, construct another rvalue of another type.
@end deffn
@node Lvalues<2>,Working with pointers structs and unions<2>,Rvalues<2>,Expressions<2>
-@anchor{cp/topics/expressions lvalues}@anchor{1a4}
+@anchor{cp/topics/expressions lvalues}@anchor{1aa}
@subsubsection Lvalues
@geindex gccjit;;lvalue (C++ class)
-@anchor{cp/topics/expressions gccjit lvalue}@anchor{1a5}
+@anchor{cp/topics/expressions gccjit lvalue}@anchor{1ab}
@deffn {C++ Class} gccjit::lvalue
@end deffn
An lvalue is something that can of the @emph{left}-hand side of an assignment:
a storage area (such as a variable). It is a subclass of
-@pxref{16d,,gccjit;;rvalue}, where the rvalue is computed by reading from the
+@pxref{171,,gccjit;;rvalue}, where the rvalue is computed by reading from the
storage area.
It iss a thin wrapper around @pxref{24,,gcc_jit_lvalue *} from the C API.
@geindex gccjit;;lvalue;;get_address (C++ function)
-@anchor{cp/topics/expressions gccjit lvalue get_address__gccjit location}@anchor{1a6}
+@anchor{cp/topics/expressions gccjit lvalue get_address__gccjit location}@anchor{1ac}
@deffn {C++ Function} gccjit::rvalue gccjit::lvalue::get_address (gccjit::location loc)
Take the address of an lvalue; analogous to:
@end menu
@node Global variables<2>,,,Lvalues<2>
-@anchor{cp/topics/expressions global-variables}@anchor{1a7}
+@anchor{cp/topics/expressions global-variables}@anchor{1ad}
@subsubsection Global variables
@geindex gccjit;;context;;new_global (C++ function)
-@anchor{cp/topics/expressions gccjit context new_global__enum gccjit type cCP gccjit location}@anchor{1a8}
+@anchor{cp/topics/expressions gccjit context new_global__enum gccjit type cCP gccjit location}@anchor{1ae}
@deffn {C++ Function} gccjit::lvalue gccjit::context::new_global (enum gcc_jit_global_kind, gccjit::type type, const char* name, gccjit::location loc)
Add a new global variable of the given type and name to the context.
-This is a thin wrapper around @pxref{bd,,gcc_jit_context_new_global()} from
+This is a thin wrapper around @pxref{c0,,gcc_jit_context_new_global()} from
the C API; the "kind" parameter has the same meaning as there.
@end deffn
@node Working with pointers structs and unions<2>,,Lvalues<2>,Expressions<2>
-@anchor{cp/topics/expressions working-with-pointers-structs-and-unions}@anchor{1a9}
+@anchor{cp/topics/expressions working-with-pointers-structs-and-unions}@anchor{1af}
@subsubsection Working with pointers, structs and unions
@geindex gccjit;;rvalue;;dereference (C++ function)
-@anchor{cp/topics/expressions gccjit rvalue dereference__gccjit location}@anchor{1aa}
+@anchor{cp/topics/expressions gccjit rvalue dereference__gccjit location}@anchor{1b0}
@deffn {C++ Function} gccjit::lvalue gccjit::rvalue::dereference (gccjit::location loc)
Given an rvalue of pointer type @code{T *}, dereferencing the pointer,
an overloaded operator:
@geindex gccjit;;rvalue;;operator* (C++ function)
-@anchor{cp/topics/expressions gccjit rvalue mul-operator}@anchor{1ab}
+@anchor{cp/topics/expressions gccjit rvalue mul-operator}@anchor{1b1}
@deffn {C++ Function} gccjit::lvalue gccjit::rvalue::operator* ()
@example
Field access is provided separately for both lvalues and rvalues:
@geindex gccjit;;lvalue;;access_field (C++ function)
-@anchor{cp/topics/expressions gccjit lvalue access_field__gccjit field gccjit location}@anchor{1ac}
+@anchor{cp/topics/expressions gccjit lvalue access_field__gccjit field gccjit location}@anchor{1b2}
@deffn {C++ Function} gccjit::lvalue gccjit::lvalue::access_field (gccjit::field field, gccjit::location loc)
Given an lvalue of struct or union type, access the given field,
@end deffn
@geindex gccjit;;rvalue;;access_field (C++ function)
-@anchor{cp/topics/expressions gccjit rvalue access_field__gccjit field gccjit location}@anchor{1ad}
+@anchor{cp/topics/expressions gccjit rvalue access_field__gccjit field gccjit location}@anchor{1b3}
@deffn {C++ Function} gccjit::rvalue gccjit::rvalue::access_field (gccjit::field field, gccjit::location loc)
Given an rvalue of struct or union type, access the given field
@end deffn
@geindex gccjit;;rvalue;;dereference_field (C++ function)
-@anchor{cp/topics/expressions gccjit rvalue dereference_field__gccjit field gccjit location}@anchor{1ae}
+@anchor{cp/topics/expressions gccjit rvalue dereference_field__gccjit field gccjit location}@anchor{1b4}
@deffn {C++ Function} gccjit::lvalue gccjit::rvalue::dereference_field (gccjit::field field, gccjit::location loc)
Given an rvalue of pointer type @code{T *} where T is of struct or union
@end deffn
@geindex gccjit;;context;;new_array_access (C++ function)
-@anchor{cp/topics/expressions gccjit context new_array_access__gccjit rvalue gccjit rvalue gccjit location}@anchor{1af}
+@anchor{cp/topics/expressions gccjit context new_array_access__gccjit rvalue gccjit rvalue gccjit location}@anchor{1b5}
@deffn {C++ Function} gccjit::lvalue gccjit::context::new_array_access (gccjit::rvalue ptr, gccjit::rvalue index, gccjit::location loc)
Given an rvalue of pointer type @code{T *}, get at the element @cite{T} at
Parameter "loc" is optional.
@end deffn
-For array accesses where you don't need to specify a @pxref{147,,gccjit;;location},
+For array accesses where you don't need to specify a @pxref{14b,,gccjit;;location},
two overloaded operators are available:
@quotation
@c <http://www.gnu.org/licenses/>.
@node Creating and using functions<2>,Source Locations<2>,Expressions<2>,Topic Reference<2>
-@anchor{cp/topics/functions doc}@anchor{1b0}@anchor{cp/topics/functions creating-and-using-functions}@anchor{1b1}
+@anchor{cp/topics/functions doc}@anchor{1b6}@anchor{cp/topics/functions creating-and-using-functions}@anchor{1b7}
@subsection Creating and using functions
@end menu
@node Params<2>,Functions<2>,,Creating and using functions<2>
-@anchor{cp/topics/functions params}@anchor{1b2}
+@anchor{cp/topics/functions params}@anchor{1b8}
@subsubsection Params
@geindex gccjit;;param (C++ class)
-@anchor{cp/topics/functions gccjit param}@anchor{1b3}
+@anchor{cp/topics/functions gccjit param}@anchor{1b9}
@deffn {C++ Class} gccjit::param
A @cite{gccjit::param} represents a parameter to a function.
@end deffn
@geindex gccjit;;context;;new_param (C++ function)
-@anchor{cp/topics/functions gccjit context new_param__gccjit type cCP gccjit location}@anchor{116}
+@anchor{cp/topics/functions gccjit context new_param__gccjit type cCP gccjit location}@anchor{11a}
@deffn {C++ Function} gccjit::param gccjit::context::new_param (gccjit::type type, const char* name, gccjit::location loc)
In preparation for creating a function, create a new parameter of the
given type and name.
@end deffn
-@pxref{1b3,,gccjit;;param} is a subclass of @pxref{1a5,,gccjit;;lvalue} (and thus
-of @pxref{16d,,gccjit;;rvalue} and @pxref{154,,gccjit;;object}). It is a thin
+@pxref{1b9,,gccjit;;param} is a subclass of @pxref{1ab,,gccjit;;lvalue} (and thus
+of @pxref{171,,gccjit;;rvalue} and @pxref{158,,gccjit;;object}). It is a thin
wrapper around the C API's @pxref{25,,gcc_jit_param *}.
@node Functions<2>,Blocks<2>,Params<2>,Creating and using functions<2>
-@anchor{cp/topics/functions functions}@anchor{1b4}
+@anchor{cp/topics/functions functions}@anchor{1ba}
@subsubsection Functions
@geindex gccjit;;function (C++ class)
-@anchor{cp/topics/functions gccjit function}@anchor{1b5}
+@anchor{cp/topics/functions gccjit function}@anchor{1bb}
@deffn {C++ Class} gccjit::function
A @cite{gccjit::function} represents a function - either one that we're
@end deffn
@geindex gccjit;;context;;new_function (C++ function)
-@anchor{cp/topics/functions gccjit context new_function__enum gccjit type cCP std vector param R i gccjit location}@anchor{1b6}
+@anchor{cp/topics/functions gccjit context new_function__enum gccjit type cCP std vector param R i gccjit location}@anchor{1bc}
@deffn {C++ Function} gccjit::function gccjit::context::new_function (enum gcc_jit_function_kind, gccjit::type return_type, const char* name, std::vector<param>& params, int is_variadic, gccjit::location loc)
Create a gcc_jit_function with the given name and parameters.
@end deffn
@geindex gccjit;;context;;get_builtin_function (C++ function)
-@anchor{cp/topics/functions gccjit context get_builtin_function__cCP}@anchor{1b7}
+@anchor{cp/topics/functions gccjit context get_builtin_function__cCP}@anchor{1bd}
@deffn {C++ Function} gccjit::function gccjit::context::get_builtin_function (const char* name)
This is a wrapper around the C API's
-@pxref{d4,,gcc_jit_context_get_builtin_function()}.
+@pxref{d7,,gcc_jit_context_get_builtin_function()}.
@end deffn
@geindex gccjit;;function;;get_param (C++ function)
-@anchor{cp/topics/functions gccjit function get_param__iC}@anchor{1b8}
+@anchor{cp/topics/functions gccjit function get_param__iC}@anchor{1be}
@deffn {C++ Function} gccjit::param gccjit::function::get_param (int index) const
Get the param of the given index (0-based).
@end deffn
@geindex gccjit;;function;;dump_to_dot (C++ function)
-@anchor{cp/topics/functions gccjit function dump_to_dot__cCP}@anchor{129}
+@anchor{cp/topics/functions gccjit function dump_to_dot__cCP}@anchor{12d}
@deffn {C++ Function} void gccjit::function::dump_to_dot (const char* path)
Emit the function in graphviz format to the given path.
@end deffn
@geindex gccjit;;function;;new_local (C++ function)
-@anchor{cp/topics/functions gccjit function new_local__gccjit type cCP gccjit location}@anchor{120}
+@anchor{cp/topics/functions gccjit function new_local__gccjit type cCP gccjit location}@anchor{124}
@deffn {C++ Function} gccjit::lvalue gccjit::function::new_local (gccjit::type type, const char* name, gccjit::location loc)
Create a new local variable within the function, of the given type and
@end deffn
@node Blocks<2>,Statements<2>,Functions<2>,Creating and using functions<2>
-@anchor{cp/topics/functions blocks}@anchor{1b9}
+@anchor{cp/topics/functions blocks}@anchor{1bf}
@subsubsection Blocks
@geindex gccjit;;block (C++ class)
-@anchor{cp/topics/functions gccjit block}@anchor{1ba}
+@anchor{cp/topics/functions gccjit block}@anchor{1c0}
@deffn {C++ Class} gccjit::block
A @cite{gccjit::block} represents a basic block within a function i.e. a
sequence of statements with a single entry point and a single exit
point.
-@pxref{1ba,,gccjit;;block} is a subclass of @pxref{154,,gccjit;;object}.
+@pxref{1c0,,gccjit;;block} is a subclass of @pxref{158,,gccjit;;object}.
The first basic block that you create within a function will
be the entrypoint.
@end deffn
@geindex gccjit;;function;;new_block (C++ function)
-@anchor{cp/topics/functions gccjit function new_block__cCP}@anchor{1bb}
+@anchor{cp/topics/functions gccjit function new_block__cCP}@anchor{1c1}
@deffn {C++ Function} gccjit::block gccjit::function::new_block (const char* name)
Create a basic block of the given name. The name may be NULL, but
@end deffn
@node Statements<2>,,Blocks<2>,Creating and using functions<2>
-@anchor{cp/topics/functions statements}@anchor{1bc}
+@anchor{cp/topics/functions statements}@anchor{1c2}
@subsubsection Statements
@geindex gccjit;;block;;add_eval (C++ function)
-@anchor{cp/topics/functions gccjit block add_eval__gccjit rvalue gccjit location}@anchor{1a1}
+@anchor{cp/topics/functions gccjit block add_eval__gccjit rvalue gccjit location}@anchor{1a5}
@deffn {C++ Function} void gccjit::block::add_eval (gccjit::rvalue rvalue, gccjit::location loc)
Add evaluation of an rvalue, discarding the result
@end deffn
@geindex gccjit;;block;;add_assignment (C++ function)
-@anchor{cp/topics/functions gccjit block add_assignment__gccjit lvalue gccjit rvalue gccjit location}@anchor{122}
+@anchor{cp/topics/functions gccjit block add_assignment__gccjit lvalue gccjit rvalue gccjit location}@anchor{126}
@deffn {C++ Function} void gccjit::block::add_assignment (gccjit::lvalue lvalue, gccjit::rvalue rvalue, gccjit::location loc)
Add evaluation of an rvalue, assigning the result to the given
@end deffn
@geindex gccjit;;block;;add_assignment_op (C++ function)
-@anchor{cp/topics/functions gccjit block add_assignment_op__gccjit lvalue enum gccjit rvalue gccjit location}@anchor{126}
+@anchor{cp/topics/functions gccjit block add_assignment_op__gccjit lvalue enum gccjit rvalue gccjit location}@anchor{12a}
@deffn {C++ Function} void gccjit::block::add_assignment_op (gccjit::lvalue lvalue, enum gcc_jit_binary_op, gccjit::rvalue rvalue, gccjit::location loc)
Add evaluation of an rvalue, using the result to modify an
@end deffn
@geindex gccjit;;block;;add_comment (C++ function)
-@anchor{cp/topics/functions gccjit block add_comment__cCP gccjit location}@anchor{131}
+@anchor{cp/topics/functions gccjit block add_comment__cCP gccjit location}@anchor{135}
@deffn {C++ Function} void gccjit::block::add_comment (const char* text, gccjit::location loc)
Add a no-op textual comment to the internal representation of the
@end deffn
@geindex gccjit;;block;;end_with_conditional (C++ function)
-@anchor{cp/topics/functions gccjit block end_with_conditional__gccjit rvalue gccjit block gccjit block gccjit location}@anchor{125}
+@anchor{cp/topics/functions gccjit block end_with_conditional__gccjit rvalue gccjit block gccjit block gccjit location}@anchor{129}
@deffn {C++ Function} void gccjit::block::end_with_conditional (gccjit::rvalue boolval, gccjit::block on_true, gccjit::block on_false, gccjit::location loc)
Terminate a block by adding evaluation of an rvalue, branching on the
@end deffn
@geindex gccjit;;block;;end_with_jump (C++ function)
-@anchor{cp/topics/functions gccjit block end_with_jump__gccjit block gccjit location}@anchor{1bd}
+@anchor{cp/topics/functions gccjit block end_with_jump__gccjit block gccjit location}@anchor{1c3}
@deffn {C++ Function} void gccjit::block::end_with_jump (gccjit::block target, gccjit::location loc)
Terminate a block by adding a jump to the given target block.
@end deffn
@geindex gccjit;;block;;end_with_return (C++ function)
-@anchor{cp/topics/functions gccjit block end_with_return__gccjit rvalue gccjit location}@anchor{1be}
+@anchor{cp/topics/functions gccjit block end_with_return__gccjit rvalue gccjit location}@anchor{1c4}
@deffn {C++ Function} void gccjit::block::end_with_return (gccjit::rvalue rvalue, gccjit::location loc)
Terminate a block.
@end deffn
@geindex gccjit;;block;;end_with_switch (C++ function)
-@anchor{cp/topics/functions gccjit block end_with_switch__gccjit rvalue gccjit block std vector gccjit case_ gccjit location}@anchor{1bf}
+@anchor{cp/topics/functions gccjit block end_with_switch__gccjit rvalue gccjit block std vector gccjit case_ gccjit location}@anchor{1c5}
@deffn {C++ Function} void gccjit::block::end_with_switch (gccjit::rvalue expr, gccjit::block default_block, std::vector<gccjit::case_> cases, gccjit::location loc)
Terminate a block by adding evalation of an rvalue, then performing
@itemize *
@item
-@pxref{1bf,,gccjit;;block;;end_with_switch()}
+@pxref{1c5,,gccjit;;block;;end_with_switch()}
@item
-@pxref{1c0,,gccjit;;context;;new_case()}
+@pxref{1c6,,gccjit;;context;;new_case()}
@end itemize
@end quotation
-were added in @pxref{e2,,LIBGCCJIT_ABI_3}; you can test for their presence
+were added in @pxref{e5,,LIBGCCJIT_ABI_3}; you can test for their presence
using
@example
@noindent
@geindex gccjit;;block;;end_with_switch;;gccjit;;case_ (C++ class)
-@anchor{cp/topics/functions gccjit block end_with_switch gccjit case_}@anchor{1c1}
+@anchor{cp/topics/functions gccjit block end_with_switch gccjit case_}@anchor{1c7}
@deffn {C++ Class} gccjit::case_
@end deffn
A @cite{gccjit::case_} represents a case within a switch statement, and
-is created within a particular @pxref{13f,,gccjit;;context} using
-@pxref{1c0,,gccjit;;context;;new_case()}. It is a subclass of
-@pxref{154,,gccjit;;object}.
+is created within a particular @pxref{143,,gccjit;;context} using
+@pxref{1c6,,gccjit;;context;;new_case()}. It is a subclass of
+@pxref{158,,gccjit;;object}.
Each case expresses a multivalued range of integer values. You
can express single-valued cases by passing in the same value for
both @cite{min_value} and @cite{max_value}.
@geindex gccjit;;block;;end_with_switch;;gccjit;;context;;new_case (C++ function)
-@anchor{cp/topics/functions gccjit block end_with_switch gccjit context new_case__gccjit rvalue gccjit rvalue gccjit block}@anchor{1c0}
+@anchor{cp/topics/functions gccjit block end_with_switch gccjit context new_case__gccjit rvalue gccjit rvalue gccjit block}@anchor{1c6}
@deffn {C++ Function} gccjit::case_* gccjit::context::new_case (gccjit::rvalue min_value, gccjit::rvalue max_value, gccjit::block dest_block)
Create a new gccjit::case for use in a switch statement.
@c <http://www.gnu.org/licenses/>.
@node Source Locations<2>,Compiling a context<2>,Creating and using functions<2>,Topic Reference<2>
-@anchor{cp/topics/locations source-locations}@anchor{1c2}@anchor{cp/topics/locations doc}@anchor{1c3}
+@anchor{cp/topics/locations source-locations}@anchor{1c8}@anchor{cp/topics/locations doc}@anchor{1c9}
@subsection Source Locations
@geindex gccjit;;location (C++ class)
-@anchor{cp/topics/locations gccjit location}@anchor{147}
+@anchor{cp/topics/locations gccjit location}@anchor{14b}
@deffn {C++ Class} gccjit::location
A @cite{gccjit::location} encapsulates a source code location, so that
@cite{gccjit::location} instances are optional: you can always omit them
from any C++ API entrypoint accepting one.
-You can construct them using @pxref{135,,gccjit;;context;;new_location()}.
+You can construct them using @pxref{139,,gccjit;;context;;new_location()}.
You need to enable @pxref{42,,GCC_JIT_BOOL_OPTION_DEBUGINFO} on the
-@pxref{13f,,gccjit;;context} for these locations to actually be usable by
+@pxref{143,,gccjit;;context} for these locations to actually be usable by
the debugger:
@example
@end deffn
@geindex gccjit;;context;;new_location (C++ function)
-@anchor{cp/topics/locations gccjit context new_location__cCP i i}@anchor{135}
+@anchor{cp/topics/locations gccjit context new_location__cCP i i}@anchor{139}
@deffn {C++ Function} gccjit::location gccjit::context::new_location (const char* filename, int line, int column)
Create a @cite{gccjit::location} instance representing the given source
@end menu
@node Faking it<2>,,,Source Locations<2>
-@anchor{cp/topics/locations faking-it}@anchor{1c4}
+@anchor{cp/topics/locations faking-it}@anchor{1ca}
@subsubsection Faking it
If you don't have source code for your internal representation, but need
to debug, you can generate a C-like representation of the functions in
-your context using @pxref{146,,gccjit;;context;;dump_to_file()}:
+your context using @pxref{14a,,gccjit;;context;;dump_to_file()}:
@example
ctxt.dump_to_file ("/tmp/something.c",
@c <http://www.gnu.org/licenses/>.
@node Compiling a context<2>,,Source Locations<2>,Topic Reference<2>
-@anchor{cp/topics/compilation compiling-a-context}@anchor{1c5}@anchor{cp/topics/compilation doc}@anchor{1c6}
+@anchor{cp/topics/compilation compiling-a-context}@anchor{1cb}@anchor{cp/topics/compilation doc}@anchor{1cc}
@subsection Compiling a context
-Once populated, a @pxref{13f,,gccjit;;context} can be compiled to
-machine code, either in-memory via @pxref{118,,gccjit;;context;;compile()} or
-to disk via @pxref{1c7,,gccjit;;context;;compile_to_file()}.
+Once populated, a @pxref{143,,gccjit;;context} can be compiled to
+machine code, either in-memory via @pxref{11c,,gccjit;;context;;compile()} or
+to disk via @pxref{1cd,,gccjit;;context;;compile_to_file()}.
You can compile a context multiple times (using either form of
compilation), although any errors that occur on the context will
@end menu
@node In-memory compilation<2>,Ahead-of-time compilation<2>,,Compiling a context<2>
-@anchor{cp/topics/compilation in-memory-compilation}@anchor{1c8}
+@anchor{cp/topics/compilation in-memory-compilation}@anchor{1ce}
@subsubsection In-memory compilation
@geindex gccjit;;context;;compile (C++ function)
-@anchor{cp/topics/compilation gccjit context compile}@anchor{118}
+@anchor{cp/topics/compilation gccjit context compile}@anchor{11c}
@deffn {C++ Function} gcc_jit_result* gccjit::context::compile ()
This calls into GCC and builds the code, returning a
@end deffn
@node Ahead-of-time compilation<2>,,In-memory compilation<2>,Compiling a context<2>
-@anchor{cp/topics/compilation ahead-of-time-compilation}@anchor{1c9}
+@anchor{cp/topics/compilation ahead-of-time-compilation}@anchor{1cf}
@subsubsection Ahead-of-time compilation
Although libgccjit is primarily aimed at just-in-time compilation, it
can also be used for implementing more traditional ahead-of-time
-compilers, via the @pxref{1c7,,gccjit;;context;;compile_to_file()} method.
+compilers, via the @pxref{1cd,,gccjit;;context;;compile_to_file()} method.
@geindex gccjit;;context;;compile_to_file (C++ function)
-@anchor{cp/topics/compilation gccjit context compile_to_file__enum cCP}@anchor{1c7}
+@anchor{cp/topics/compilation gccjit context compile_to_file__enum cCP}@anchor{1cd}
@deffn {C++ Function} void gccjit::context::compile_to_file (enum gcc_jit_output_kind, const char* output_path)
-Compile the @pxref{13f,,gccjit;;context} to a file of the given
+Compile the @pxref{143,,gccjit;;context} to a file of the given
kind.
This is a thin wrapper around the
@c <http://www.gnu.org/licenses/>.
@node Internals,Indices and tables,C++ bindings for libgccjit,Top
-@anchor{internals/index internals}@anchor{1ca}@anchor{internals/index doc}@anchor{1cb}
+@anchor{internals/index internals}@anchor{1d0}@anchor{internals/index doc}@anchor{1d1}
@chapter Internals
@end menu
@node Working on the JIT library,Running the test suite,,Internals
-@anchor{internals/index working-on-the-jit-library}@anchor{1cc}
+@anchor{internals/index working-on-the-jit-library}@anchor{1d2}
@section Working on the JIT library
Here's what those configuration options mean:
@geindex command line option; --enable-host-shared
-@anchor{internals/index cmdoption--enable-host-shared}@anchor{1cd}
+@anchor{internals/index cmdoption--enable-host-shared}@anchor{1d3}
@deffn {Option} --enable-host-shared
Configuring with this option means that the compiler is built as
@end deffn
@geindex command line option; --enable-languages=jit@comma{}c++
-@anchor{internals/index cmdoption--enable-languages}@anchor{1ce}
+@anchor{internals/index cmdoption--enable-languages}@anchor{1d4}
@deffn {Option} --enable-languages=jit,c++
This specifies which frontends to build. The JIT library looks like
@end deffn
@geindex command line option; --disable-bootstrap
-@anchor{internals/index cmdoption--disable-bootstrap}@anchor{1cf}
+@anchor{internals/index cmdoption--disable-bootstrap}@anchor{1d5}
@deffn {Option} --disable-bootstrap
For hacking on the "jit" subdirectory, performing a full
@end deffn
@geindex command line option; --enable-checking=release
-@anchor{internals/index cmdoption--enable-checking}@anchor{1d0}
+@anchor{internals/index cmdoption--enable-checking}@anchor{1d6}
@deffn {Option} --enable-checking=release
The compile can perform extensive self-checking as it runs, useful when
@end deffn
@node Running the test suite,Environment variables,Working on the JIT library,Internals
-@anchor{internals/index running-the-test-suite}@anchor{1d1}
+@anchor{internals/index running-the-test-suite}@anchor{1d7}
@section Running the test suite
@end menu
@node Running under valgrind,,,Running the test suite
-@anchor{internals/index running-under-valgrind}@anchor{1d2}
+@anchor{internals/index running-under-valgrind}@anchor{1d8}
@subsection Running under valgrind
various known false positives.
@node Environment variables,Packaging notes,Running the test suite,Internals
-@anchor{internals/index environment-variables}@anchor{1d3}
+@anchor{internals/index environment-variables}@anchor{1d9}
@section Environment variables
environment variables need to be set up:
@geindex environment variable; LD_LIBRARY_PATH
-@anchor{internals/index envvar-LD_LIBRARY_PATH}@anchor{1d4}
+@anchor{internals/index envvar-LD_LIBRARY_PATH}@anchor{1da}
@deffn {Environment Variable} LD_LIBRARY_PATH
@quotation
@end deffn
@geindex environment variable; PATH
-@anchor{internals/index envvar-PATH}@anchor{1d5}
+@anchor{internals/index envvar-PATH}@anchor{1db}
@deffn {Environment Variable} PATH
The library uses a driver executable for converting from .s assembler
@end deffn
@geindex environment variable; LIBRARY_PATH
-@anchor{internals/index envvar-LIBRARY_PATH}@anchor{1d6}
+@anchor{internals/index envvar-LIBRARY_PATH}@anchor{1dc}
@deffn {Environment Variable} LIBRARY_PATH
The driver executable invokes the linker, and the latter needs to locate
@noindent
@node Packaging notes,Overview of code structure,Environment variables,Internals
-@anchor{internals/index packaging-notes}@anchor{1d7}
+@anchor{internals/index packaging-notes}@anchor{1dd}
@section Packaging notes
-The configure-time option @pxref{1cd,,--enable-host-shared} is needed when
+The configure-time option @pxref{1d3,,--enable-host-shared} is needed when
building the jit in order to get position-independent code. This will
slow down the regular compiler by a few percent. Hence when packaging gcc
with libgccjit, please configure and build twice:
@itemize *
@item
-once without @pxref{1cd,,--enable-host-shared} for most languages, and
+once without @pxref{1d3,,--enable-host-shared} for most languages, and
@item
-once with @pxref{1cd,,--enable-host-shared} for the jit
+once with @pxref{1d3,,--enable-host-shared} for the jit
@end itemize
@end quotation
@noindent
@node Overview of code structure,Design notes,Packaging notes,Internals
-@anchor{internals/index overview-of-code-structure}@anchor{1d8}
+@anchor{internals/index overview-of-code-structure}@anchor{1de}
@section Overview of code structure
class global;
class param;
class base_call;
+ class function_pointer;
class statement;
class case_;
@noindent
@node Design notes,Submitting patches,Overview of code structure,Internals
-@anchor{internals/index design-notes}@anchor{1d9}
+@anchor{internals/index design-notes}@anchor{1df}
@section Design notes
@code{recording::context::validate ()} in jit-recording.c.
@node Submitting patches,,Design notes,Internals
-@anchor{internals/index submitting-patches}@anchor{1da}
+@anchor{internals/index submitting-patches}@anchor{1e0}
@section Submitting patches
committing to svn.
@node Indices and tables,Index,Internals,Top
-@anchor{index indices-and-tables}@anchor{1db}
+@anchor{index indices-and-tables}@anchor{1e1}
@unnumbered Indices and tables