2.4.2 Lvalues

C Type: gcc_jit_lvalue

An lvalue is something that can of the `left'-hand side of an assignment: a storage area (such as a variable). It is also usable as an rvalue, where the rvalue is computed by reading from the storage area.

C Function: gcc_jit_object * gcc_jit_lvalue_as_object (gcc_jit_lvalue *lvalue)

Upcast an lvalue to be an object.

C Function: gcc_jit_rvalue * gcc_jit_lvalue_as_rvalue (gcc_jit_lvalue *lvalue)

Upcast an lvalue to be an rvalue.

C Function: gcc_jit_rvalue * gcc_jit_lvalue_get_address (gcc_jit_lvalue *lvalue, gcc_jit_location *loc)

Take the address of an lvalue; analogous to:

&(EXPR)

in C.

C Function: void gcc_jit_lvalue_set_tls_model (gcc_jit_lvalue *lvalue, enum gcc_jit_tls_model model)

Make a variable a thread-local variable.

The “model” parameter determines the thread-local storage model of the “lvalue”:

C Type: enum gcc_jit_tls_model
C Macro: GCC_JIT_TLS_MODEL_NONE

Don’t set the TLS model.

C Macro: GCC_JIT_TLS_MODEL_GLOBAL_DYNAMIC
C Macro: GCC_JIT_TLS_MODEL_LOCAL_DYNAMIC
C Macro: GCC_JIT_TLS_MODEL_INITIAL_EXEC
C Macro: GCC_JIT_TLS_MODEL_LOCAL_EXEC

This is analogous to:

_Thread_local int foo __attribute__ ((tls_model("MODEL")));

in C.

This entrypoint was added in LIBGCCJIT_ABI_17; you can test for its presence using

#ifdef LIBGCCJIT_HAVE_gcc_jit_lvalue_set_tls_model
C Function: void gcc_jit_lvalue_set_link_section (gcc_jit_lvalue *lvalue, const char *section_name)

Set the link section of a variable. The parameter section_name must be non-NULL and must contain the leading dot. Analogous to:

int variable __attribute__((section(".section")));

in C.

This entrypoint was added in LIBGCCJIT_ABI_18; you can test for its presence using

#ifdef LIBGCCJIT_HAVE_gcc_jit_lvalue_set_link_section
C Function: void gcc_jit_lvalue_set_register_name (gcc_jit_lvalue *lvalue, const char *reg_name);

Set the register name of a variable. The parameter reg_name must be non-NULL. Analogous to:

register int variable asm ("r12");

in C.

This entrypoint was added in LIBGCCJIT_ABI_22; you can test for its presence using

#ifdef LIBGCCJIT_HAVE_gcc_jit_lvalue_set_register_name
C Function: void gcc_jit_lvalue_set_alignment (gcc_jit_lvalue *lvalue, unsigned bytes)

Set the alignment of a variable, in bytes. Analogous to:

int variable __attribute__((aligned (16)));

in C.

This entrypoint was added in LIBGCCJIT_ABI_24; you can test for its presence using

#ifdef LIBGCCJIT_HAVE_ALIGNMENT
C Function: unsigned gcc_jit_lvalue_get_alignment (gcc_jit_lvalue *lvalue)

Return the alignment of a variable set by gcc_jit_lvalue_set_alignment. Return 0 if the alignment was not set. Analogous to:

_Alignof (variable)

in C.

This entrypoint was added in LIBGCCJIT_ABI_24; you can test for its presence using

#ifdef LIBGCCJIT_HAVE_ALIGNMENT