Given an rvalue of pointer type T *
, dereferencing the pointer,
getting an lvalue of type T
. Analogous to:
*(EXPR)
in C.
Parameter “loc” is optional.
If you don’t need to specify the location, this can also be expressed using an overloaded operator:
Field access is provided separately for both lvalues and rvalues:
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.
Given an rvalue of struct or union type, access the given field as an rvalue. Analogous to:
(EXPR).field
in C.
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
.
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
).
Parameter “loc” is optional.
For array accesses where you don’t need to specify a gccjit;;location, two overloaded operators are available:
gccjit::lvalue gccjit::rvalue::operator[] (gccjit::rvalue index)
gccjit::lvalue element = array[idx];gccjit::lvalue gccjit::rvalue::operator[] (int index)
gccjit::lvalue element = array[0];