ordering of the following codes is optimized for the classification in handled_component_p. Keep them in a consecutive group. */ /* Value is structure or union component. Operand 0 is the structure or union (an expression). Operand 1 is the field (a node of type FIELD_DECL). Operand 2, if present, is the value of DECL_FIELD_OFFSET, measured in units of DECL_OFFSET_ALIGN / BITS_PER_UNIT. */ DEFTREECODE (COMPONENT_REF, "component_ref", tcc_reference, 3) /* Reference to a group of bits within an object. Similar to COMPONENT_REF except the position is given explicitly rather than via a FIELD_DECL. Operand 0 is the structure or union expression; operand 1 is a tree giving the constant number of bits being referenced; operand 2 is a tree giving the constant position of the first referenced bit. The result type width has to match the number of bits referenced. If the result type is integral, its signedness specifies how it is extended to its mode width. */ DEFTREECODE (BIT_FIELD_REF, "bit_field_ref", tcc_reference, 3) /* Array indexing. Operand 0 is the array; operand 1 is a (single) array index. Operand 2, if present, is a copy of TYPE_MIN_VALUE of the index. Operand 3, if present, is the element size, measured in units of the alignment of the element type. */ DEFTREECODE (ARRAY_REF, "array_ref", tcc_reference, 4) /* Likewise, except that the result is a range ("slice") of the array. The starting index of the resulting array is taken from operand 1 and the size of the range is taken from the type of the expression. */ DEFTREECODE (ARRAY_RANGE_REF, "array_range_ref", tcc_reference, 4) /* Used only on an operand of complex type, these return a value of the corresponding component type. */ DEFTREECODE (REALPART_EXPR, "realpart_expr", tcc_reference, 1) DEFTREECODE (IMAGPART_EXPR, "imagpart_expr", tcc_reference, 1) /* Represents viewing something of one type as being of a second type. This corresponds to an "Unchecked Conversion" in Ada and roughly to the idiom *(type2 *)&X in C. The only operand is the value to be viewed as being of another type. It is undefined if the type of the input and of the expression have different sizes. This code may also be used within the LHS of a MODIFY_EXPR, in which case no actual data motion may occur. TREE_ADDRESSABLE will be set in this case and GCC must abort if it could not do the operation without generating insns. */ DEFTREECODE (VIEW_CONVERT_EXPR, "view_convert_expr", tcc_reference, 1) /* C unary `*'. One operand, an expression for a pointer. */ DEFTREECODE (INDIRECT_REF, "indirect_ref", tcc_reference, 1) /* Used to represent lookup in a virtual method table which is dependent on the runtime type of an object. Operands are: OBJ_TYPE_REF_EXPR: An expression that evaluates the value to use. OBJ_TYPE_REF_OBJECT: Is the object on whose behalf the lookup is being performed. Through this the optimizers may be able to statically determine the dynamic type of the object. OBJ_TYPE_REF_TOKEN: An integer index to the virtual method table. The integer index should have as type the original type of OBJ_TYPE_REF_OBJECT; as pointer type conversions are useless in GIMPLE, the type of OBJ_TYPE_REF_OBJECT can change to an unrelated pointer type during optimizations. */ DEFTREECODE (OBJ_TYPE_REF, "obj_type_ref", tcc_expression, 3) /* Used to represent the brace-enclosed initializers for a structure or an array. It contains a sequence of component values made out of a VEC of constructor_elt. For RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE: The field INDEX of each constructor_elt is a FIELD_DECL. For ARRAY_TYPE: The field INDEX of each constructor_elt is the corresponding index. If the index is a RANGE_EXPR, it is a short-hand for many nodes, one for each index in the range. (If the corresponding field VALUE has side-effects, they are evaluated once for each element. Wrap the value in a SAVE_EXPR if you want to evaluate side effects only once.) Components that aren't present are cleared as per the C semantics, unless the CONSTRUCTOR_NO_CLEARING flag is set, in which case their value becomes undefined. */ DEFTREECODE (CONSTRUCTOR, "constructor", tcc_exceptional, 0) /* The expression types are mostly straightforward, with the fourth argument of DEFTREECODE saying how many operands there are. Unless otherwise specified, the operands are expressions and the types of all the operands and the expression must all be the same. */ /* Contains two expressions to compute, one followed by the other. the first value is ignored. The second one's value is used. The type of the first expression need not agree with the other types. */ DEFTREECODE (COMPOUND_EXPR, "compound_expr", tcc_expression, 2) /* Assignment expression. Operand 0 is the what to set; 1, the new value. */ DEFTREECODE (MODIFY_EXPR, "modify_expr", tcc_expression, 2) /* Initialization expression. Operand 0 is the variable to initialize; Operand 1 is the initializer. This differs from MODIFY_EXPR in that any reference to the referent of operand 0 within operand 1 is undefined. */ DEFTREECODE (INIT_EXPR, "init_expr", tcc_expression, 2) /* For TARGET_EXPR, operand 0 is the target of an initialization, operand 1 is the initializer for the target, which may be void if simply expanding it initializes the target. operand 2 is the cleanup for this node, if any. operand 3 is the saved initializer after this node has been expanded once; this is so we can re-expand the tree later. */ DEFTREECODE (TARGET_EXPR, "target_expr", tcc_expression, 4) /* Conditional expression ( ... ? ... : ... in C). Operand 0 is the condition. Operand 1 is the then-value. Operand 2 is the else-value. Operand 0 may be of any type. Operand 1 must have the same type as the entire expression, unless it unconditionally throws an exception, in which case it should have VOID_TYPE. The same constraints apply to operand 2. The condition in operand 0 must be of integral type. In cfg gimple, if you do not have a selection expression, operands 1 and 2 are NULL. The operands are then taken from the cfg edges. */ DEFTREECODE (COND_EXPR, "cond_expr", tcc_expression, 3) /* Represents a vector in which every element is equal to operand 0. */ DEFTREECODE (VEC_DUPLICATE_EXPR, "vec_duplicate_expr", tcc_unary, 1) /* Vector series created from a start (base) value and a step. A = VEC_SERIES_EXPR (B, C) means for (i = 0; i < N; i++) A[i] = B + C * i; */ DEFTREECODE (VEC_SERIES_EXPR, "vec_series_expr", tcc_binary, 2) /* Vector conditional expression. It is like COND_EXPR, but with vector operands. A = VEC_COND_EXPR ( X < Y, B, C) means for (i=0; i means N = length(mask) foreach i in N: M = mask[i] % (2*N) A = M < N ? v0[M] : v1[M-N] V0 and V1 are vectors of the same type. MASK is an integer-typed vector. The number of MASK elements must be the same with the number of elements in V0 and V1. The size of the inner type of the MASK and of the V0 and V1 must be the same. */ DEFTREECODE (VEC_PERM_EXPR, "vec_perm_expr", tcc_expression, 3) /* Declare local variables, including making RTL and allocating space. BIND_EXPR_VARS is a chain of VAR_DECL nodes for the variables. BIND_EXPR_BODY is the body, the expression to be computed using the variables. The value of operand 1 becomes that of the BIND_EXPR. BIND_EXPR_BLOCK is the BLOCK that corresponds to these bindings for debugging purposes. If this BIND_EXPR is actually expanded, that sets the TREE_USED flag in the BLOCK. The BIND_EXPR is not responsible for informing parsers about these variables. If the body is coming from the input file, then the code that creates the BIND_EXPR is also responsible for informing the parser of the variables. If the BIND_EXPR is ever expanded, its TREE_USED flag is set. This tells the code for debugging symbol tables not to ignore the BIND_EXPR. If the BIND_EXPR should be output for debugging but will not be expanded, set the TREE_USED flag by hand. In order for the BIND_EXPR to be known at all, the code that creates it must also install it as a subblock in the tree of BLOCK nodes for the function. */ DEFTREECODE (BIND_EXPR, "bind_expr", tcc_expression, 3) /* Function call. CALL_EXPRs are represented by variably-sized expression nodes. There are at least three fixed operands. Operand 0 is an INTEGER_CST node containing the total operand count, the number of arguments plus 3. Operand 1 is the function or NULL, while operand 2 is is static chain argument, or NULL. The remaining operands are the arguments to the call. */ DEFTREECODE (CALL_EXPR, "call_expr", tcc_vl_exp, 3) /* Specify a value to compute along with its corresponding cleanup. Operand 0 is the cleanup expression. The cleanup is executed by the first enclosing CLEANUP_POINT_EXPR, which must exist. This differs from TRY_CATCH_EXPR in that operand 1 is always evaluated when cleanups are run. */ DEFTREECODE (WITH_CLEANUP_EXPR, "with_cleanup_expr", tcc_expression, 1) /* Specify a cleanup point. Operand 0 is an expression that may have cleanups. If it does, those cleanups are executed after the expression is expanded. Note that if the expression is a reference to storage, it is forced out of memory before the cleanups are run. This is necessary to handle cases where the cleanups modify the storage referenced; in the expression 't.i', if 't' is a struct with an integer member 'i' and a cleanup which modifies 'i', the value of the expression depends on whether the cleanup is run before or after 't.i' is evaluated. When expand_expr is run on 't.i', it returns a MEM. This is not good enough; the value of 't.i' must be forced out of memory. As a consequence, the operand of a CLEANUP_POINT_EXPR must not have BLKmode, because it will not be forced out of memory. */ DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", tcc_expression, 1) /* The following code is used in languages that have types where some field in an object of the type contains a value that is used in the computation of another field's offset or size and/or the size of the type. The positions and/or sizes of fields can vary from object to object of the same type or even for one and the same object within its scope. Record types with discriminants in Ada are examples of such types. This mechanism is also used to create "fat pointers" for unconstrained array types in Ada; the fat pointer is a structure one of whose fields is a pointer to the actual array type and the other field is a pointer to a template, which is a structure containing the bounds of the array. The bounds in the type pointed to by the first field in the fat pointer refer to the values in the template. When you wish to construct such a type you need "self-references" that allow you to reference the object having this type from the TYPE node, i.e. without having a variable instantiating this type. Such a "self-references" is done using a PLACEHOLDER_EXPR. This is a node that will later be replaced with the object being referenced. Its type is that of the object and selects which object to use from a chain of references (see below). No other slots are used in the PLACEHOLDER_EXPR. For example, if your type FOO is a RECORD_TYPE with a field BAR, and you need the value of .BAR to calculate TYPE_SIZE (FOO), just substitute above with a PLACEHOLDER_EXPR whose TREE_TYPE is FOO. Then construct your COMPONENT_REF with the PLACEHOLDER_EXPR as the first operand (which has the correct type). Later, when the size is needed in the program, the back-end will find this PLACEHOLDER_EXPR and generate code to calculate the actual size at run-time. In the following, we describe how this calculation is done. When we wish to evaluate a size or offset, we check whether it contains a PLACEHOLDER_EXPR. If it does, we call substitute_placeholder_in_expr passing both that tree and an expression within which the object may be found. The latter expression is the object itself in the simple case of an Ada record with discriminant, but it can be the array in the case of an unconstrained array. In the latter case, we need the fat pointer, because the bounds of the array can only be accessed from it. However, we rely here on the fact that the expression for the array contains the dereference of the fat pointer that obtained the array pointer. */ /* Denotes a record to later be substituted before evaluating this expression. The type of this expression is used to find the record to replace it. */ DEFTREECODE (PLACEHOLDER_EXPR, "placeholder_expr", tcc_exceptional, 0) /* Simple arithmetic. */ DEFTREECODE (PLUS_EXPR, "plus_expr", tcc_binary, 2) DEFTREECODE (MINUS_EXPR, "minus_expr", tcc_binary, 2) DEFTREECODE (MULT_EXPR, "mult_expr", tcc_binary, 2) /* Pointer addition. The first operand is always a pointer and the second operand is an integer of type sizetype. */ DEFTREECODE (POINTER_PLUS_EXPR, "pointer_plus_expr", tcc_binary, 2) /* Pointer subtraction. The two arguments are pointers, and the result is a signed integer of the same precision. Pointers are interpreted as unsigned, the difference is computed as if in infinite signed precision. Behavior is undefined if the difference does not fit in the result type. The result does not depend on the pointer type, it is not divided by the size of the pointed-to type. */ DEFTREECODE (POINTER_DIFF_EXPR, "pointer_diff_expr", tcc_binary, 2) /* Highpart multiplication. For an integral type with precision B, returns bits [2B-1, B] of the full 2*B product. Both operands and the result should have integer types of the same precision and signedness. */ DEFTREECODE (MULT_HIGHPART_EXPR, "mult_highpart_expr", tcc_binary, 2) /* Division for integer result that rounds the quotient toward zero. */ DEFTREECODE (TRUNC_DIV_EXPR, "trunc_div_expr", tcc_binary, 2) /* Division for integer result that rounds it toward plus infinity. */ DEFTREECODE (CEIL_DIV_EXPR, "ceil_div_expr", tcc_binary, 2) /* Division for integer result that rounds it toward minus infinity. */ DEFTREECODE (FLOOR_DIV_EXPR, "floor_div_expr", tcc_binary, 2) /* Division for integer result that rounds it toward nearest integer. */ DEFTREECODE (ROUND_DIV_EXPR, "round_div_expr", tcc_binary, 2) /* Four kinds of remainder that go with the four kinds of division: */ /* The sign of the remainder is that of the dividend. */ DEFTREECODE (TRUNC_MOD_EXPR, "trunc_mod_expr", tcc_binary, 2) /* The sign of the remainder is the opposite of that of the divisor. */ DEFTREECODE (CEIL_MOD_EXPR, "ceil_mod_expr", tcc_binary, 2) /* The sign of the remainder is that of the divisor. */ DEFTREECODE (FLOOR_MOD_EXPR, "floor_mod_expr", tcc_binary, 2) /* The sign of the remainder is not predictable. */ DEFTREECODE (ROUND_MOD_EXPR, "round_mod_expr", tcc_binary, 2) /* Division for real result. */ DEFTREECODE (RDIV_EXPR, "rdiv_expr", tcc_binary, 2) /* Division which is not supposed to need rounding. Used for pointer subtraction in C. */ DEFTREECODE (EXACT_DIV_EXPR, "exact_div_expr", tcc_binary, 2) /* Conversion of real to fixed point by truncation. */ DEFTREECODE (FIX_TRUNC_EXPR, "fix_trunc_expr", tcc_unary, 1) /* Conversion of an integer to a real. */ DEFTREECODE (FLOAT_EXPR, "float_expr", tcc_unary, 1) /* Unary negation. */ DEFTREECODE (NEGATE_EXPR, "negate_expr", tcc_unary, 1) /* Minimum and maximum values. When used with floating point, if both operands are zeros, or if either operand is NaN, then it is unspecified which of the two operands is returned as the result. */ DEFTREECODE (MIN_EXPR, "min_expr", tcc_binary, 2) DEFTREECODE (MAX_EXPR, "max_expr", tcc_binary, 2) /* Represents the absolute value of the operand. An ABS_EXPR must have either an INTEGER_TYPE or a REAL_TYPE. The operand of the ABS_EXPR must have the same type. */ DEFTREECODE (ABS_EXPR, "abs_expr", tcc_unary, 1) /* Represents the unsigned absolute value of the operand. An ABSU_EXPR must have unsigned INTEGER_TYPE. The operand of the ABSU_EXPR must have the corresponding signed type. */ DEFTREECODE (ABSU_EXPR, "absu_expr", tcc_unary, 1) /* Shift operations for shift and rotate. Shift means logical shift if done on an unsigned type, arithmetic shift if done on a signed type. The second operand is the number of bits to shift by; it need not be the same type as the first operand and result. Note that the result is undefined if the second operand is larger than or equal to the first operand's type size. The first operand of a shift can have either an integer or a (non-integer) fixed-point type. We follow the ISO/IEC TR 18037:2004 semantics for the latter. Rotates are defined for integer types only. */ DEFTREECODE (LSHIFT_EXPR, "lshift_expr", tcc_binary, 2) DEFTREECODE (RSHIFT_EXPR, "rshift_expr", tcc_binary, 2) DEFTREECODE (LROTATE_EXPR, "lrotate_expr", tcc_binary, 2) DEFTREECODE (RROTATE_EXPR, "rrotate_expr", tcc_binary, 2) /* Bitwise operations. Operands have same mode as result. */ DEFTREECODE (BIT_IOR_EXPR, "bit_ior_expr", tcc_binary, 2) DEFTREECODE (BIT_XOR_EXPR, "bit_xor_expr", tcc_binary, 2) DEFTREECODE (BIT_AND_EXPR, "bit_and_expr", tcc_binary, 2) DEFTREECODE (BIT_NOT_EXPR, "bit_not_expr", tcc_unary, 1) /* ANDIF and ORIF allow the second operand not to be computed if the value of the expression is determined from the first operand. AND, OR, and XOR always compute the second operand whether its value is needed or not (for side effects). The operand may have BOOLEAN_TYPE or INTEGER_TYPE. In either case, the argument will be either zero or one. For example, a TRUTH_NOT_EXPR will never have an INTEGER_TYPE VAR_DECL as its argument; instead, a NE_EXPR will be used to compare the VAR_DECL to zero, thereby obtaining a node with value zero or one. */ DEFTREECODE (TRUTH_ANDIF_EXPR, "truth_andif_expr", tcc_expression, 2) DEFTREECODE (TRUTH_ORIF_EXPR, "truth_orif_expr", tcc_expression, 2) DEFTREECODE (TRUTH_AND_EXPR, "truth_and_expr", tcc_expression, 2) DEFTREECODE (TRUTH_OR_EXPR, "truth_or_expr", tcc_expression, 2) DEFTREECODE (TRUTH_XOR_EXPR, "truth_xor_expr", tcc_expression, 2) DEFTREECODE (TRUTH_NOT_EXPR, "truth_not_expr", tcc_expression, 1) /* Relational operators. EQ_EXPR and NE_EXPR are allowed for any types. The others, except for LTGT_EXPR, are allowed only for integral, floating-point and vector types. LTGT_EXPR is allowed only for floating-point types. For floating-point operators, if either operand is a NaN, then NE_EXPR returns true and the remaining operators return false. The operators other than EQ_EXPR and NE_EXPR may generate an exception on quiet NaNs. In all cases the operands will have the same type, and the value is either the type used by the language for booleans or an integer vector type of the same size and with the same number of elements as the comparison operands. True for a vector of comparison results has all bits set while false is equal to zero. */ DEFTREECODE (LT_EXPR, "lt_expr", tcc_comparison, 2) DEFTREECODE (LE_EXPR, "le_expr", tcc_comparison, 2) DEFTREECODE (GT_EXPR, "gt_expr", tcc_comparison, 2) DEFTREECODE (GE_EXPR, "ge_expr", tcc_comparison, 2) DEFTREECODE (LTGT_EXPR, "ltgt_expr", tcc_comparison, 2) DEFTREECODE (EQ_EXPR, "eq_expr", tcc_comparison, 2) DEFTREECODE (NE_EXPR, "ne_expr", tcc_comparison, 2) /* Additional relational operators for floating-point unordered. */ DEFTREECODE (UNORDERED_EXPR, "unordered_expr", tcc_comparison, 2) DEFTREECODE (ORDERED_EXPR, "ordered_expr", tcc_comparison, 2) /* These are equivalent to unordered or ... */ DEFTREECODE (UNLT_EXPR, "unlt_expr", tcc_comparison, 2) DEFTREECODE (UNLE_EXPR, "unle_expr", tcc_comparison, 2) DEFTREECODE (UNGT_EXPR, "ungt_expr", tcc_comparison, 2) DEFTREECODE (UNGE_EXPR, "unge_expr", tcc_comparison, 2) DEFTREECODE (UNEQ_EXPR, "uneq_expr", tcc_comparison, 2) DEFTREECODE (RANGE_EXPR, "range_expr", tcc_binary, 2) /* Represents a re-association barrier for floating point expressions like explicit parenthesis in fortran. */ DEFTREECODE (PAREN_EXPR, "paren_expr", tcc_unary, 1) /* Represents a conversion of type of a value. All conversions, including implicit ones, must be represented by CONVERT_EXPR or NOP_EXPR nodes. */ DEFTREECODE (CONVERT_EXPR, "convert_expr", tcc_unary, 1) /* Conversion of a pointer value to a pointer to a different address space. */ DEFTREECODE (ADDR_SPACE_CONVERT_EXPR, "addr_space_convert_expr", tcc_unary, 1) /* Conversion of a fixed-point value to an integer, a real, or a fixed-point value. Or conversion of a fixed-point value from an integer, a real, or a fixed-point value. */ DEFTREECODE (FIXED_CONVERT_EXPR, "fixed_convert_expr", tcc_unary, 1) /* Represents a conversion expected to require no code to be generated. */ DEFTREECODE (NOP_EXPR, "nop_expr", tcc_unary, 1) /* Value is same as argument, but guaranteed not an lvalue. */ DEFTREECODE (NON_LVALUE_EXPR, "non_lvalue_expr", tcc_unary, 1) /* A COMPOUND_LITERAL_EXPR represents a literal that is placed in a DECL. The COMPOUND_LITERAL_EXPR_DECL_EXPR is the a DECL_EXPR containing the decl for the anonymous object represented by the COMPOUND_LITERAL; the DECL_INITIAL of that decl is the CONSTRUCTOR that initializes the compound literal. */ DEFTREECODE (COMPOUND_LITERAL_EXPR, "compound_literal_expr", tcc_expression, 1) /* Represents something we computed once and will use multiple times. First operand is that expression. After it is evaluated once, it will be replaced by the temporary variable that holds the value. */ DEFTREECODE (SAVE_EXPR, "save_expr", tcc_expression, 1) /* & in C. Value is the address at which the operand's value resides. Operand may have any mode. Result mode is Pmode. */ DEFTREECODE (ADDR_EXPR, "addr_expr", tcc_expression, 1) /* Operand0 is a function constant; result is part N of a function descriptor of type ptr_mode. */ DEFTREECODE (FDESC_EXPR, "fdesc_expr", tcc_expression, 2) /* Given a container value, a replacement value and a bit position within the container, produce the value that results from replacing the part of the container starting at the bit position with the replacement value. Operand 0 is a tree for the container value of integral or vector type; Operand 1 is a tree for the replacement value of another integral or the vector element type; Operand 2 is a tree giving the constant bit position; The number of bits replaced is given by the precision of the type of the replacement value if it is integral or by its size if it is non-integral. ??? The reason to make the size of the replacement implicit is to avoid introducing a quaternary operation. The replaced bits shall be fully inside the container. If the container is of vector type, then these bits shall be aligned with its elements. */ DEFTREECODE (BIT_INSERT_EXPR, "bit_insert_expr", tcc_expression, 3) /* Given two real or integer operands of the same type, returns a complex value of the corresponding complex type. */ DEFTREECODE (COMPLEX_EXPR, "complex_expr", tcc_binary, 2) /* Complex conjugate of operand. Used only on complex types. */ DEFTREECODE (CONJ_EXPR, "conj_expr", tcc_unary, 1) /* Nodes for ++ and -- in C. The second arg is how much to increment or decrement by. For a pointer, it would be the size of the object pointed to. */ DEFTREECODE (PREDECREMENT_EXPR, "predecrement_expr", tcc_expression, 2) DEFTREECODE (PREINCREMENT_EXPR, "preincrement_expr", tcc_expression, 2) DEFTREECODE (POSTDECREMENT_EXPR, "postdecrement_expr", tcc_expression, 2) DEFTREECODE (POSTINCREMENT_EXPR, "postincrement_expr", tcc_expression, 2) /* Used to implement `va_arg'. */ DEFTREECODE (VA_ARG_EXPR, "va_arg_expr", tcc_expression, 1) /* Evaluate operand 0. If and only if an exception is thrown during the evaluation of operand 0, evaluate operand 1. This differs from TRY_FINALLY_EXPR in that operand 1 is not evaluated on a normal or jump exit, only on an exception. */ DEFTREECODE (TRY_CATCH_EXPR, "try_catch_expr", tcc_statement, 2) /* Evaluate the first operand. The second operand is a cleanup expression which is evaluated on any exit (normal, exception, or jump out) from this expression. */ DEFTREECODE (TRY_FINALLY_EXPR, "try_finally_expr", tcc_statement, 2) /* Evaluate either the normal or the exceptional cleanup. This must only be present as the cleanup expression in a TRY_FINALLY_EXPR. If the TRY_FINALLY_EXPR completes normally, the first operand of EH_ELSE_EXPR is used as a cleanup, otherwise the second operand is used. */ DEFTREECODE (EH_ELSE_EXPR, "eh_else_expr", tcc_statement, 2)