@@ -29,12 +29,6 @@ API
gcc_jit_function_as_rvalue ()
-* clarify gcc_jit_function_add_eval()::
-
- (void)expression;
-
- and, indeed, clarify all of the other operations.
-
* expressing branch probabilies (like __builtin_expect)::
extern gcc_jit_rvalue *
@@ -99,7 +93,8 @@ Future milestones
* Detect and issue warnings/errors about uses of uninitialized variables
-* Warn about unused objects in a context (e.g. rvalues/lvalues)?
+* Warn about unused objects in a context (e.g. rvalues/lvalues)? (e.g.
+ for gcc_jit_context_new_call vs gcc_jit_block_add_eval)
Nice to have
============
@@ -364,6 +364,29 @@ Function calls
Given a function and the given table of argument rvalues, construct a
call to the function, with the result as an rvalue.
+ .. note::
+
+ :c:func:`gcc_jit_context_new_call` merely builds a
+ :c:type:`gcc_jit_rvalue` i.e. an expression that can be evaluated,
+ perhaps as part of a more complicated expression.
+ The call *won't* happen unless you add a statement to a function
+ that evaluates the expression.
+
+ For example, if you want to call a function and discard the result
+ (or to call a function with ``void`` return type), use
+ :c:func:`gcc_jit_block_add_eval`:
+
+ .. code-block:: c
+
+ /* Add "(void)printf (arg0, arg1);". */
+ gcc_jit_block_add_eval (
+ block, NULL,
+ gcc_jit_context_new_call (
+ ctxt,
+ NULL,
+ printf_func,
+ 2, args));
+
Type-coercion
*************
@@ -18,7 +18,7 @@
.. default-domain:: c
Creating and using functions
-================================
+============================
Params
------
@@ -224,7 +224,16 @@ Statements
lvalue *= rvalue;
lvalue /= rvalue;
- etc.
+ etc. For example:
+
+ .. code-block:: c
+
+ /* "i++" */
+ gcc_jit_block_add_assignment_op (
+ loop_body, NULL,
+ i,
+ GCC_JIT_BINARY_OP_PLUS,
+ gcc_jit_context_one (ctxt, int_type));
.. function:: void\
gcc_jit_block_add_comment (gcc_jit_block *block,\