2.4.3 Working with pointers, structs and unions

C Function: gcc_jit_lvalue * gcc_jit_rvalue_dereference (gcc_jit_rvalue *rvalue, gcc_jit_location *loc)

Given an rvalue of pointer type T *, dereferencing the pointer, getting an lvalue of type T. Analogous to:

*(EXPR)

in C.

Field access is provided separately for both lvalues and rvalues.

C Function: gcc_jit_lvalue * gcc_jit_lvalue_access_field (gcc_jit_lvalue *struct_, gcc_jit_location *loc, gcc_jit_field *field)

Given an lvalue of struct or union type, access the given field, getting an lvalue of the field’s type. Analogous to:

(EXPR).field = ...;

in C.

C Function: gcc_jit_rvalue * gcc_jit_rvalue_access_field (gcc_jit_rvalue *struct_, gcc_jit_location *loc, gcc_jit_field *field)

Given an rvalue of struct or union type, access the given field as an rvalue. Analogous to:

(EXPR).field

in C.

C Function: gcc_jit_lvalue * gcc_jit_rvalue_dereference_field (gcc_jit_rvalue *ptr, gcc_jit_location *loc, gcc_jit_field *field)

Given an rvalue of pointer type T * where T is of struct or union type, access the given field as an lvalue. Analogous to:

(EXPR)->field

in C, itself equivalent to (*EXPR).FIELD.

C Function: gcc_jit_lvalue * gcc_jit_context_new_array_access (gcc_jit_context *ctxt, gcc_jit_location *loc, gcc_jit_rvalue *ptr, gcc_jit_rvalue *index)

Given an rvalue of pointer type T *, get at the element T at the given index, using standard C array indexing rules i.e. each increment of index corresponds to sizeof(T) bytes. Analogous to:

PTR[INDEX]

in C (or, indeed, to PTR + INDEX).