3.2.4.7 Function calls

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 call to the function, with the result as an rvalue.

Note: gccjit::context::new_call() merely builds a gccjit;;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 gccjit;;block;;add_eval():

/* Add "(void)printf (arg0, arg1);".  */
block.add_eval (ctxt.new_call (printf_func, arg0, arg1));