Expressions

class gccjit.RValue
dereference_field(Field field, Location loc=None)
dereference(loc=None)
get_type()
class gccjit.LValue
get_address(loc=None)

Get the address of this lvalue, as a gccjit.RValue of type T*.

Unary Operations

Unary operations are gccjit.RValue instances built using gccjit.Context.new_unary_op() with an operation from one of the following:

Unary Operation C equivalent
gccjit.UnaryOp.MINUS -(EXPR)
gccjit.UnaryOp.BITWISE_NEGATE ~(EXPR)
gccjit.UnaryOp.LOGICAL_NEGATE !(EXPR)
class gccjit.UnaryOp
MINUS

Negate an arithmetic value; analogous to:

-(EXPR)

in C.

BITWISE_NEGATE

Bitwise negation of an integer value (one’s complement); analogous to:

~(EXPR)

in C.

LOGICAL_NEGATE

Logical negation of an arithmetic or pointer value; analogous to:

!(EXPR)

in C.

Binary Operations

Unary operations are gccjit.RValue instances built using gccjit.Context.new_binary_op() with an operation from one of the following:

Binary Operation C equivalent
gccjit.BinaryOp.PLUS x + y
gccjit.BinaryOp.MINUS x - y
gccjit.BinaryOp.MULT x * y
gccjit.BinaryOp.DIVIDE x / y
gccjit.BinaryOp.MODULO x % y
gccjit.BinaryOp.BITWISE_AND x & y
gccjit.BinaryOp.BITWISE_XOR x ^ y
gccjit.BinaryOp.BITWISE_OR x | y
gccjit.BinaryOp.LOGICAL_AND x && y
gccjit.BinaryOp.LOGICAL_OR x || y
class gccjit.BinaryOp
PLUS

Addition of arithmetic values; analogous to:

(EXPR_A) + (EXPR_B)

in C.

For pointer addition, use gccjit.Context.new_array_access().

MINUS

Subtraction of arithmetic values; analogous to:

(EXPR_A) - (EXPR_B)

in C.

MULT

Multiplication of a pair of arithmetic values; analogous to:

(EXPR_A) * (EXPR_B)

in C.

DIVIDE

Quotient of division of arithmetic values; analogous to:

(EXPR_A) / (EXPR_B)

in C.

The result type affects the kind of division: if the result type is integer-based, then the result is truncated towards zero, whereas a floating-point result type indicates floating-point division.

MODULO

Remainder of division of arithmetic values; analogous to:

(EXPR_A) % (EXPR_B)

in C.

BITWISE_AND

Bitwise AND; analogous to:

(EXPR_A) & (EXPR_B)

in C.

BITWISE_XOR

Bitwise exclusive OR; analogous to:

(EXPR_A) ^ (EXPR_B)

in C.

BITWISE_OR

Bitwise inclusive OR; analogous to:

(EXPR_A) | (EXPR_B)

in C.

LOGICAL_AND

Logical AND; analogous to:

(EXPR_A) && (EXPR_B)

in C.

LOGICAL_OR

Logical OR; analogous to:

(EXPR_A) || (EXPR_B)

in C.

Comparisons

Comparisons are gccjit.RValue instances of boolean type built using gccjit.Context.new_comparison() with an operation from one of the following:

Comparison C equivalent
gccjit.Comparison.EQ x == y
gccjit.Comparison.NE x != y
gccjit.Comparison.LT x < y
gccjit.Comparison.LE x <= y
gccjit.Comparison.GT x > y
gccjit.Comparison.GE x >= y
class gccjit.Comparison
EQ
NE
LT
LE
GT
GE