1*c87b03e5Sespie/* This file contains the definitions and documentation for the 2*c87b03e5Sespie tree codes used in the GNU C compiler. 3*c87b03e5Sespie Copyright (C) 1987, 1988, 1993, 1995, 1997, 1998, 2000, 2001 4*c87b03e5Sespie Free Software Foundation, Inc. 5*c87b03e5Sespie 6*c87b03e5SespieThis file is part of GCC. 7*c87b03e5Sespie 8*c87b03e5SespieGCC is free software; you can redistribute it and/or modify it under 9*c87b03e5Sespiethe terms of the GNU General Public License as published by the Free 10*c87b03e5SespieSoftware Foundation; either version 2, or (at your option) any later 11*c87b03e5Sespieversion. 12*c87b03e5Sespie 13*c87b03e5SespieGCC is distributed in the hope that it will be useful, but WITHOUT ANY 14*c87b03e5SespieWARRANTY; without even the implied warranty of MERCHANTABILITY or 15*c87b03e5SespieFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 16*c87b03e5Sespiefor more details. 17*c87b03e5Sespie 18*c87b03e5SespieYou should have received a copy of the GNU General Public License 19*c87b03e5Sespiealong with GCC; see the file COPYING. If not, write to the Free 20*c87b03e5SespieSoftware Foundation, 59 Temple Place - Suite 330, Boston, MA 21*c87b03e5Sespie02111-1307, USA. */ 22*c87b03e5Sespie 23*c87b03e5Sespie 24*c87b03e5Sespie/* The third argument can be: 25*c87b03e5Sespie 'x' for an exceptional code (fits no category). 26*c87b03e5Sespie 't' for a type object code. 27*c87b03e5Sespie 'b' for a lexical block. 28*c87b03e5Sespie 'c' for codes for constants. 29*c87b03e5Sespie 'd' for codes for declarations (also serving as variable refs). 30*c87b03e5Sespie 'r' for codes for references to storage. 31*c87b03e5Sespie '<' for codes for comparison expressions. 32*c87b03e5Sespie '1' for codes for unary arithmetic expressions. 33*c87b03e5Sespie '2' for codes for binary arithmetic expressions. 34*c87b03e5Sespie 's' for codes for expressions with inherent side effects. 35*c87b03e5Sespie 'e' for codes for other kinds of expressions. */ 36*c87b03e5Sespie 37*c87b03e5Sespie/* For `r', `e', `<', `1', `2', `s' and `x' nodes, 38*c87b03e5Sespie the 4th element is the number of argument slots to allocate. 39*c87b03e5Sespie This determines the size of the tree node object. */ 40*c87b03e5Sespie 41*c87b03e5Sespie/* Any erroneous construct is parsed into a node of this type. 42*c87b03e5Sespie This type of node is accepted without complaint in all contexts 43*c87b03e5Sespie by later parsing activities, to avoid multiple error messages 44*c87b03e5Sespie for one error. 45*c87b03e5Sespie No fields in these nodes are used except the TREE_CODE. */ 46*c87b03e5SespieDEFTREECODE (ERROR_MARK, "error_mark", 'x', 0) 47*c87b03e5Sespie 48*c87b03e5Sespie/* Used to represent a name (such as, in the DECL_NAME of a decl node). 49*c87b03e5Sespie Internally it looks like a STRING_CST node. 50*c87b03e5Sespie There is only one IDENTIFIER_NODE ever made for any particular name. 51*c87b03e5Sespie Use `get_identifier' to get it (or create it, the first time). */ 52*c87b03e5SespieDEFTREECODE (IDENTIFIER_NODE, "identifier_node", 'x', ((LANG_HOOKS_IDENTIFIER_SIZE - sizeof (struct tree_common) + sizeof (tree) - 1) / sizeof (tree))) 53*c87b03e5Sespie 54*c87b03e5Sespie/* Has the TREE_VALUE and TREE_PURPOSE fields. */ 55*c87b03e5Sespie/* These nodes are made into lists by chaining through the 56*c87b03e5Sespie TREE_CHAIN field. The elements of the list live in the 57*c87b03e5Sespie TREE_VALUE fields, while TREE_PURPOSE fields are occasionally 58*c87b03e5Sespie used as well to get the effect of Lisp association lists. */ 59*c87b03e5SespieDEFTREECODE (TREE_LIST, "tree_list", 'x', 2) 60*c87b03e5Sespie 61*c87b03e5Sespie/* These nodes contain an array of tree nodes. */ 62*c87b03e5SespieDEFTREECODE (TREE_VEC, "tree_vec", 'x', 2) 63*c87b03e5Sespie 64*c87b03e5Sespie/* A symbol binding block. These are arranged in a tree, 65*c87b03e5Sespie where the BLOCK_SUBBLOCKS field contains a chain of subblocks 66*c87b03e5Sespie chained through the BLOCK_CHAIN field. 67*c87b03e5Sespie BLOCK_SUPERCONTEXT points to the parent block. 68*c87b03e5Sespie For a block which represents the outermost scope of a function, it 69*c87b03e5Sespie points to the FUNCTION_DECL node. 70*c87b03e5Sespie BLOCK_VARS points to a chain of decl nodes. 71*c87b03e5Sespie BLOCK_TYPE_TAGS points to a chain of types which have their own names. 72*c87b03e5Sespie BLOCK_CHAIN points to the next BLOCK at the same level. 73*c87b03e5Sespie BLOCK_ABSTRACT_ORIGIN points to the original (abstract) tree node which 74*c87b03e5Sespie this block is an instance of, or else is NULL to indicate that this 75*c87b03e5Sespie block is not an instance of anything else. When non-NULL, the value 76*c87b03e5Sespie could either point to another BLOCK node or it could point to a 77*c87b03e5Sespie FUNCTION_DECL node (e.g. in the case of a block representing the 78*c87b03e5Sespie outermost scope of a particular inlining of a function). 79*c87b03e5Sespie BLOCK_ABSTRACT is nonzero if the block represents an abstract 80*c87b03e5Sespie instance of a block (i.e. one which is nested within an abstract 81*c87b03e5Sespie instance of an inline function). 82*c87b03e5Sespie TREE_ASM_WRITTEN is nonzero if the block was actually referenced 83*c87b03e5Sespie in the generated assembly. */ 84*c87b03e5SespieDEFTREECODE (BLOCK, "block", 'b', 0) 85*c87b03e5Sespie 86*c87b03e5Sespie/* Each data type is represented by a tree node whose code is one of 87*c87b03e5Sespie the following: */ 88*c87b03e5Sespie/* Each node that represents a data type has a component TYPE_SIZE 89*c87b03e5Sespie containing a tree that is an expression for the size in bits. 90*c87b03e5Sespie The TYPE_MODE contains the machine mode for values of this type. 91*c87b03e5Sespie The TYPE_POINTER_TO field contains a type for a pointer to this type, 92*c87b03e5Sespie or zero if no such has been created yet. 93*c87b03e5Sespie The TYPE_NEXT_VARIANT field is used to chain together types 94*c87b03e5Sespie that are variants made by type modifiers such as "const" and "volatile". 95*c87b03e5Sespie The TYPE_MAIN_VARIANT field, in any member of such a chain, 96*c87b03e5Sespie points to the start of the chain. 97*c87b03e5Sespie The TYPE_NONCOPIED_PARTS field is a list specifying which parts 98*c87b03e5Sespie of an object of this type should *not* be copied by assignment. 99*c87b03e5Sespie The TREE_VALUE of each is a FIELD_DECL that should not be 100*c87b03e5Sespie copied. The TREE_PURPOSE is an initial value for that field when 101*c87b03e5Sespie an object of this type is initialized via an INIT_EXPR. It may 102*c87b03e5Sespie be NULL if no special value is required. Even the things in this 103*c87b03e5Sespie list are copied if the right-hand side of an assignment is known 104*c87b03e5Sespie to be a complete object (rather than being, perhaps, a subobject 105*c87b03e5Sespie of some other object.) The determination of what constitutes a 106*c87b03e5Sespie complete object is done by fixed_type_p. 107*c87b03e5Sespie The TYPE_NAME field contains info on the name used in the program 108*c87b03e5Sespie for this type (for GDB symbol table output). It is either a 109*c87b03e5Sespie TYPE_DECL node, for types that are typedefs, or an IDENTIFIER_NODE 110*c87b03e5Sespie in the case of structs, unions or enums that are known with a tag, 111*c87b03e5Sespie or zero for types that have no special name. 112*c87b03e5Sespie The TYPE_CONTEXT for any sort of type which could have a name or 113*c87b03e5Sespie which could have named members (e.g. tagged types in C/C++) will 114*c87b03e5Sespie point to the node which represents the scope of the given type, or 115*c87b03e5Sespie will be NULL_TREE if the type has "file scope". For most types, this 116*c87b03e5Sespie will point to a BLOCK node or a FUNCTION_DECL node, but it could also 117*c87b03e5Sespie point to a FUNCTION_TYPE node (for types whose scope is limited to the 118*c87b03e5Sespie formal parameter list of some function type specification) or it 119*c87b03e5Sespie could point to a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE node 120*c87b03e5Sespie (for C++ "member" types). 121*c87b03e5Sespie For non-tagged-types, TYPE_CONTEXT need not be set to anything in 122*c87b03e5Sespie particular, since any type which is of some type category (e.g. 123*c87b03e5Sespie an array type or a function type) which cannot either have a name 124*c87b03e5Sespie itself or have named members doesn't really have a "scope" per se. 125*c87b03e5Sespie The TREE_CHAIN field is used as a forward-references to names for 126*c87b03e5Sespie ENUMERAL_TYPE, RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE nodes; 127*c87b03e5Sespie see below. */ 128*c87b03e5Sespie 129*c87b03e5SespieDEFTREECODE (VOID_TYPE, "void_type", 't', 0) /* The void type in C */ 130*c87b03e5Sespie 131*c87b03e5Sespie/* Integer types in all languages, including char in C. 132*c87b03e5Sespie Also used for sub-ranges of other discrete types. 133*c87b03e5Sespie Has components TYPE_MIN_VALUE, TYPE_MAX_VALUE (expressions, inclusive) 134*c87b03e5Sespie and TYPE_PRECISION (number of bits used by this type). 135*c87b03e5Sespie In the case of a subrange type in Pascal, the TREE_TYPE 136*c87b03e5Sespie of this will point at the supertype (another INTEGER_TYPE, 137*c87b03e5Sespie or an ENUMERAL_TYPE, CHAR_TYPE, or BOOLEAN_TYPE). 138*c87b03e5Sespie Otherwise, the TREE_TYPE is zero. */ 139*c87b03e5SespieDEFTREECODE (INTEGER_TYPE, "integer_type", 't', 0) 140*c87b03e5Sespie 141*c87b03e5Sespie/* C's float and double. Different floating types are distinguished 142*c87b03e5Sespie by machine mode and by the TYPE_SIZE and the TYPE_PRECISION. */ 143*c87b03e5SespieDEFTREECODE (REAL_TYPE, "real_type", 't', 0) 144*c87b03e5Sespie 145*c87b03e5Sespie/* Complex number types. The TREE_TYPE field is the data type 146*c87b03e5Sespie of the real and imaginary parts. */ 147*c87b03e5SespieDEFTREECODE (COMPLEX_TYPE, "complex_type", 't', 0) 148*c87b03e5Sespie 149*c87b03e5Sespie/* Vector types. The TREE_TYPE field is the data type of the vector 150*c87b03e5Sespie elements. */ 151*c87b03e5SespieDEFTREECODE (VECTOR_TYPE, "vector_type", 't', 0) 152*c87b03e5Sespie 153*c87b03e5Sespie/* C enums. The type node looks just like an INTEGER_TYPE node. 154*c87b03e5Sespie The symbols for the values of the enum type are defined by 155*c87b03e5Sespie CONST_DECL nodes, but the type does not point to them; 156*c87b03e5Sespie however, the TYPE_VALUES is a list in which each element's TREE_PURPOSE 157*c87b03e5Sespie is a name and the TREE_VALUE is the value (an INTEGER_CST node). */ 158*c87b03e5Sespie/* A forward reference `enum foo' when no enum named foo is defined yet 159*c87b03e5Sespie has zero (a null pointer) in its TYPE_SIZE. The tag name is in 160*c87b03e5Sespie the TYPE_NAME field. If the type is later defined, the normal 161*c87b03e5Sespie fields are filled in. 162*c87b03e5Sespie RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE forward refs are 163*c87b03e5Sespie treated similarly. */ 164*c87b03e5SespieDEFTREECODE (ENUMERAL_TYPE, "enumeral_type", 't', 0) 165*c87b03e5Sespie 166*c87b03e5Sespie/* Pascal's boolean type (true or false are the only values); 167*c87b03e5Sespie no special fields needed. */ 168*c87b03e5SespieDEFTREECODE (BOOLEAN_TYPE, "boolean_type", 't', 0) 169*c87b03e5Sespie 170*c87b03e5Sespie/* CHAR in Pascal; not used in C. 171*c87b03e5Sespie No special fields needed. */ 172*c87b03e5SespieDEFTREECODE (CHAR_TYPE, "char_type", 't', 0) 173*c87b03e5Sespie 174*c87b03e5Sespie/* All pointer-to-x types have code POINTER_TYPE. 175*c87b03e5Sespie The TREE_TYPE points to the node for the type pointed to. */ 176*c87b03e5SespieDEFTREECODE (POINTER_TYPE, "pointer_type", 't', 0) 177*c87b03e5Sespie 178*c87b03e5Sespie/* An offset is a pointer relative to an object. 179*c87b03e5Sespie The TREE_TYPE field is the type of the object at the offset. 180*c87b03e5Sespie The TYPE_OFFSET_BASETYPE points to the node for the type of object 181*c87b03e5Sespie that the offset is relative to. */ 182*c87b03e5SespieDEFTREECODE (OFFSET_TYPE, "offset_type", 't', 0) 183*c87b03e5Sespie 184*c87b03e5Sespie/* A reference is like a pointer except that it is coerced 185*c87b03e5Sespie automatically to the value it points to. Used in C++. */ 186*c87b03e5SespieDEFTREECODE (REFERENCE_TYPE, "reference_type", 't', 0) 187*c87b03e5Sespie 188*c87b03e5Sespie/* METHOD_TYPE is the type of a function which takes an extra first 189*c87b03e5Sespie argument for "self", which is not present in the declared argument list. 190*c87b03e5Sespie The TREE_TYPE is the return type of the method. The TYPE_METHOD_BASETYPE 191*c87b03e5Sespie is the type of "self". TYPE_ARG_TYPES is the real argument list, which 192*c87b03e5Sespie includes the hidden argument for "self". */ 193*c87b03e5SespieDEFTREECODE (METHOD_TYPE, "method_type", 't', 0) 194*c87b03e5Sespie 195*c87b03e5Sespie/* Used for Pascal; details not determined right now. */ 196*c87b03e5SespieDEFTREECODE (FILE_TYPE, "file_type", 't', 0) 197*c87b03e5Sespie 198*c87b03e5Sespie/* Types of arrays. Special fields: 199*c87b03e5Sespie TREE_TYPE Type of an array element. 200*c87b03e5Sespie TYPE_DOMAIN Type to index by. 201*c87b03e5Sespie Its range of values specifies the array length. 202*c87b03e5Sespie The field TYPE_POINTER_TO (TREE_TYPE (array_type)) is always nonzero 203*c87b03e5Sespie and holds the type to coerce a value of that array type to in C. 204*c87b03e5Sespie TYPE_STRING_FLAG indicates a string (in contrast to an array of chars) 205*c87b03e5Sespie in languages (such as Chill) that make a distinction. */ 206*c87b03e5Sespie/* Array types in C or Pascal */ 207*c87b03e5SespieDEFTREECODE (ARRAY_TYPE, "array_type", 't', 0) 208*c87b03e5Sespie 209*c87b03e5Sespie/* Types of sets for Pascal. Special fields are the same as 210*c87b03e5Sespie in an array type. The target type is always a boolean type. 211*c87b03e5Sespie Used for both bitstrings and powersets in Chill; 212*c87b03e5Sespie TYPE_STRING_FLAG indicates a bitstring. */ 213*c87b03e5SespieDEFTREECODE (SET_TYPE, "set_type", 't', 0) 214*c87b03e5Sespie 215*c87b03e5Sespie/* Struct in C, or record in Pascal. */ 216*c87b03e5Sespie/* Special fields: 217*c87b03e5Sespie TYPE_FIELDS chain of FIELD_DECLs for the fields of the struct, 218*c87b03e5Sespie and VAR_DECLs, TYPE_DECLs and CONST_DECLs for record-scope variables, 219*c87b03e5Sespie types and enumerators. 220*c87b03e5Sespie A few may need to be added for Pascal. */ 221*c87b03e5Sespie/* See the comment above, before ENUMERAL_TYPE, for how 222*c87b03e5Sespie forward references to struct tags are handled in C. */ 223*c87b03e5SespieDEFTREECODE (RECORD_TYPE, "record_type", 't', 0) 224*c87b03e5Sespie 225*c87b03e5Sespie/* Union in C. Like a struct, except that the offsets of the fields 226*c87b03e5Sespie will all be zero. */ 227*c87b03e5Sespie/* See the comment above, before ENUMERAL_TYPE, for how 228*c87b03e5Sespie forward references to union tags are handled in C. */ 229*c87b03e5SespieDEFTREECODE (UNION_TYPE, "union_type", 't', 0) /* C union type */ 230*c87b03e5Sespie 231*c87b03e5Sespie/* Similar to UNION_TYPE, except that the expressions in DECL_QUALIFIER 232*c87b03e5Sespie in each FIELD_DECL determine what the union contains. The first 233*c87b03e5Sespie field whose DECL_QUALIFIER expression is true is deemed to occupy 234*c87b03e5Sespie the union. */ 235*c87b03e5SespieDEFTREECODE (QUAL_UNION_TYPE, "qual_union_type", 't', 0) 236*c87b03e5Sespie 237*c87b03e5Sespie/* Type of functions. Special fields: 238*c87b03e5Sespie TREE_TYPE type of value returned. 239*c87b03e5Sespie TYPE_ARG_TYPES list of types of arguments expected. 240*c87b03e5Sespie this list is made of TREE_LIST nodes. 241*c87b03e5Sespie Types of "Procedures" in languages where they are different from functions 242*c87b03e5Sespie have code FUNCTION_TYPE also, but then TREE_TYPE is zero or void type. */ 243*c87b03e5SespieDEFTREECODE (FUNCTION_TYPE, "function_type", 't', 0) 244*c87b03e5Sespie 245*c87b03e5Sespie/* This is a language-specific kind of type. 246*c87b03e5Sespie Its meaning is defined by the language front end. 247*c87b03e5Sespie layout_type does not know how to lay this out, 248*c87b03e5Sespie so the front-end must do so manually. */ 249*c87b03e5SespieDEFTREECODE (LANG_TYPE, "lang_type", 't', 0) 250*c87b03e5Sespie 251*c87b03e5Sespie/* Expressions */ 252*c87b03e5Sespie 253*c87b03e5Sespie/* First, the constants. */ 254*c87b03e5Sespie 255*c87b03e5Sespie/* Contents are in TREE_INT_CST_LOW and TREE_INT_CST_HIGH fields, 256*c87b03e5Sespie 32 bits each, giving us a 64 bit constant capability. 257*c87b03e5Sespie Note: constants of type char in Pascal are INTEGER_CST, 258*c87b03e5Sespie and so are pointer constants such as nil in Pascal or NULL in C. 259*c87b03e5Sespie `(int *) 1' in C also results in an INTEGER_CST. */ 260*c87b03e5SespieDEFTREECODE (INTEGER_CST, "integer_cst", 'c', 2) 261*c87b03e5Sespie 262*c87b03e5Sespie/* Contents are in TREE_REAL_CST field. Also there is TREE_CST_RTL. */ 263*c87b03e5SespieDEFTREECODE (REAL_CST, "real_cst", 'c', 3) 264*c87b03e5Sespie 265*c87b03e5Sespie/* Contents are in TREE_REALPART and TREE_IMAGPART fields, 266*c87b03e5Sespie whose contents are other constant nodes. 267*c87b03e5Sespie Also there is TREE_CST_RTL. */ 268*c87b03e5SespieDEFTREECODE (COMPLEX_CST, "complex_cst", 'c', 3) 269*c87b03e5Sespie 270*c87b03e5Sespie/* Contents are in TREE_VECTOR_CST_ELTS field. */ 271*c87b03e5SespieDEFTREECODE (VECTOR_CST, "vector_cst", 'c', 3) 272*c87b03e5Sespie 273*c87b03e5Sespie/* Contents are TREE_STRING_LENGTH and TREE_STRING_POINTER fields. 274*c87b03e5Sespie Also there is TREE_CST_RTL. */ 275*c87b03e5SespieDEFTREECODE (STRING_CST, "string_cst", 'c', 3) 276*c87b03e5Sespie 277*c87b03e5Sespie/* Declarations. All references to names are represented as ..._DECL nodes. 278*c87b03e5Sespie The decls in one binding context are chained through the TREE_CHAIN field. 279*c87b03e5Sespie Each DECL has a DECL_NAME field which contains an IDENTIFIER_NODE. 280*c87b03e5Sespie (Some decls, most often labels, may have zero as the DECL_NAME). 281*c87b03e5Sespie DECL_CONTEXT points to the node representing the context in which 282*c87b03e5Sespie this declaration has its scope. For FIELD_DECLs, this is the 283*c87b03e5Sespie RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field 284*c87b03e5Sespie is a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL, 285*c87b03e5Sespie and CONST_DECL nodes, this points to either the FUNCTION_DECL for the 286*c87b03e5Sespie containing function, the RECORD_TYPE or UNION_TYPE for the containing 287*c87b03e5Sespie type, or NULL_TREE if the given decl has "file scope". 288*c87b03e5Sespie DECL_ABSTRACT_ORIGIN, if non-NULL, points to the original (abstract) 289*c87b03e5Sespie ..._DECL node of which this decl is an (inlined or template expanded) 290*c87b03e5Sespie instance. 291*c87b03e5Sespie The TREE_TYPE field holds the data type of the object, when relevant. 292*c87b03e5Sespie LABEL_DECLs have no data type. For TYPE_DECL, the TREE_TYPE field 293*c87b03e5Sespie contents are the type whose name is being declared. 294*c87b03e5Sespie The DECL_ALIGN, DECL_SIZE, 295*c87b03e5Sespie and DECL_MODE fields exist in decl nodes just as in type nodes. 296*c87b03e5Sespie They are unused in LABEL_DECL, TYPE_DECL and CONST_DECL nodes. 297*c87b03e5Sespie 298*c87b03e5Sespie DECL_OFFSET holds an integer number of bits offset for the location. 299*c87b03e5Sespie DECL_VOFFSET holds an expression for a variable offset; it is 300*c87b03e5Sespie to be multiplied by DECL_VOFFSET_UNIT (an integer). 301*c87b03e5Sespie These fields are relevant only in FIELD_DECLs and PARM_DECLs. 302*c87b03e5Sespie 303*c87b03e5Sespie DECL_INITIAL holds the value to initialize a variable to, 304*c87b03e5Sespie or the value of a constant. For a function, it holds the body 305*c87b03e5Sespie (a node of type BLOCK representing the function's binding contour 306*c87b03e5Sespie and whose body contains the function's statements.) For a LABEL_DECL 307*c87b03e5Sespie in C, it is a flag, nonzero if the label's definition has been seen. 308*c87b03e5Sespie 309*c87b03e5Sespie PARM_DECLs use a special field: 310*c87b03e5Sespie DECL_ARG_TYPE is the type in which the argument is actually 311*c87b03e5Sespie passed, which may be different from its type within the function. 312*c87b03e5Sespie 313*c87b03e5Sespie FUNCTION_DECLs use four special fields: 314*c87b03e5Sespie DECL_ARGUMENTS holds a chain of PARM_DECL nodes for the arguments. 315*c87b03e5Sespie DECL_RESULT holds a RESULT_DECL node for the value of a function, 316*c87b03e5Sespie or it is 0 for a function that returns no value. 317*c87b03e5Sespie (C functions returning void have zero here.) 318*c87b03e5Sespie The TREE_TYPE field is the type in which the result is actually 319*c87b03e5Sespie returned. This is usually the same as the return type of the 320*c87b03e5Sespie FUNCTION_DECL, but it may be a wider integer type because of 321*c87b03e5Sespie promotion. 322*c87b03e5Sespie DECL_FUNCTION_CODE is a code number that is nonzero for 323*c87b03e5Sespie built-in functions. Its value is an enum built_in_function 324*c87b03e5Sespie that says which built-in function it is. 325*c87b03e5Sespie 326*c87b03e5Sespie DECL_SOURCE_FILE holds a filename string and DECL_SOURCE_LINE 327*c87b03e5Sespie holds a line number. In some cases these can be the location of 328*c87b03e5Sespie a reference, if no definition has been seen. 329*c87b03e5Sespie 330*c87b03e5Sespie DECL_ABSTRACT is nonzero if the decl represents an abstract instance 331*c87b03e5Sespie of a decl (i.e. one which is nested within an abstract instance of a 332*c87b03e5Sespie inline function. */ 333*c87b03e5Sespie 334*c87b03e5SespieDEFTREECODE (FUNCTION_DECL, "function_decl", 'd', 0) 335*c87b03e5SespieDEFTREECODE (LABEL_DECL, "label_decl", 'd', 0) 336*c87b03e5SespieDEFTREECODE (CONST_DECL, "const_decl", 'd', 0) 337*c87b03e5SespieDEFTREECODE (TYPE_DECL, "type_decl", 'd', 0) 338*c87b03e5SespieDEFTREECODE (VAR_DECL, "var_decl", 'd', 0) 339*c87b03e5SespieDEFTREECODE (PARM_DECL, "parm_decl", 'd', 0) 340*c87b03e5SespieDEFTREECODE (RESULT_DECL, "result_decl", 'd', 0) 341*c87b03e5SespieDEFTREECODE (FIELD_DECL, "field_decl", 'd', 0) 342*c87b03e5Sespie 343*c87b03e5Sespie/* A namespace declaration. Namespaces appear in DECL_CONTEXT of other 344*c87b03e5Sespie _DECLs, providing a hierarchy of names. */ 345*c87b03e5SespieDEFTREECODE (NAMESPACE_DECL, "namespace_decl", 'd', 0) 346*c87b03e5Sespie 347*c87b03e5Sespie/* References to storage. */ 348*c87b03e5Sespie 349*c87b03e5Sespie/* Value is structure or union component. 350*c87b03e5Sespie Operand 0 is the structure or union (an expression); 351*c87b03e5Sespie operand 1 is the field (a node of type FIELD_DECL). */ 352*c87b03e5SespieDEFTREECODE (COMPONENT_REF, "component_ref", 'r', 2) 353*c87b03e5Sespie 354*c87b03e5Sespie/* Reference to a group of bits within an object. Similar to COMPONENT_REF 355*c87b03e5Sespie except the position is given explicitly rather than via a FIELD_DECL. 356*c87b03e5Sespie Operand 0 is the structure or union expression; 357*c87b03e5Sespie operand 1 is a tree giving the number of bits being referenced; 358*c87b03e5Sespie operand 2 is a tree giving the position of the first referenced bit. 359*c87b03e5Sespie The field can be either a signed or unsigned field; 360*c87b03e5Sespie TREE_UNSIGNED says which. */ 361*c87b03e5SespieDEFTREECODE (BIT_FIELD_REF, "bit_field_ref", 'r', 3) 362*c87b03e5Sespie 363*c87b03e5Sespie/* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */ 364*c87b03e5SespieDEFTREECODE (INDIRECT_REF, "indirect_ref", 'r', 1) 365*c87b03e5Sespie 366*c87b03e5Sespie/* Pascal `^` on a file. One operand, an expression for the file. */ 367*c87b03e5SespieDEFTREECODE (BUFFER_REF, "buffer_ref", 'r', 1) 368*c87b03e5Sespie 369*c87b03e5Sespie/* Array indexing. 370*c87b03e5Sespie Operand 0 is the array; operand 1 is a (single) array index. */ 371*c87b03e5SespieDEFTREECODE (ARRAY_REF, "array_ref", 'r', 2) 372*c87b03e5Sespie 373*c87b03e5Sespie/* Likewise, except that the result is a range ("slice") of the array. The 374*c87b03e5Sespie starting index of the resulting array is taken from operand 1 and the size 375*c87b03e5Sespie of the range is taken from the type of the expression. */ 376*c87b03e5SespieDEFTREECODE (ARRAY_RANGE_REF, "array_range_ref", 'r', 2) 377*c87b03e5Sespie 378*c87b03e5Sespie/* Vtable indexing. Carries data useful for emitting information 379*c87b03e5Sespie for vtable garbage collection. 380*c87b03e5Sespie Operand 0: an array_ref (or equivalent expression) 381*c87b03e5Sespie Operand 1: the vtable base (must be a var_decl) 382*c87b03e5Sespie Operand 2: index into vtable (must be an integer_cst). */ 383*c87b03e5SespieDEFTREECODE (VTABLE_REF, "vtable_ref", 'r', 3) 384*c87b03e5Sespie 385*c87b03e5Sespie/* Constructor: return an aggregate value made from specified components. 386*c87b03e5Sespie In C, this is used only for structure and array initializers. 387*c87b03e5Sespie Also used for SET_TYPE in Chill (and potentially Pascal). 388*c87b03e5Sespie The first "operand" is really a pointer to the RTL, 389*c87b03e5Sespie for constant constructors only. 390*c87b03e5Sespie The second operand is a list of component values 391*c87b03e5Sespie made out of a chain of TREE_LIST nodes. 392*c87b03e5Sespie 393*c87b03e5Sespie For ARRAY_TYPE: 394*c87b03e5Sespie The TREE_PURPOSE of each node is the corresponding index. 395*c87b03e5Sespie If the TREE_PURPOSE is a RANGE_EXPR, it is a short-hand for many nodes, 396*c87b03e5Sespie one for each index in the range. (If the corresponding TREE_VALUE 397*c87b03e5Sespie has side-effects, they are evaluated once for each element. Wrap the 398*c87b03e5Sespie value in a SAVE_EXPR if you want to evaluate side effects only once.) 399*c87b03e5Sespie 400*c87b03e5Sespie For RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE: 401*c87b03e5Sespie The TREE_PURPOSE of each node is a FIELD_DECL. 402*c87b03e5Sespie 403*c87b03e5Sespie For SET_TYPE: 404*c87b03e5Sespie The TREE_VALUE specifies a value (index) in the set that is true. 405*c87b03e5Sespie If TREE_PURPOSE is non-NULL, it specifies the lower limit of a 406*c87b03e5Sespie range of true values. Elements not listed are false (not in the set). */ 407*c87b03e5SespieDEFTREECODE (CONSTRUCTOR, "constructor", 'e', 2) 408*c87b03e5Sespie 409*c87b03e5Sespie/* The expression types are mostly straightforward, with the fourth argument 410*c87b03e5Sespie of DEFTREECODE saying how many operands there are. 411*c87b03e5Sespie Unless otherwise specified, the operands are expressions and the 412*c87b03e5Sespie types of all the operands and the expression must all be the same. */ 413*c87b03e5Sespie 414*c87b03e5Sespie/* Contains two expressions to compute, one followed by the other. 415*c87b03e5Sespie the first value is ignored. The second one's value is used. The 416*c87b03e5Sespie type of the first expression need not agree with the other types. */ 417*c87b03e5SespieDEFTREECODE (COMPOUND_EXPR, "compound_expr", 'e', 2) 418*c87b03e5Sespie 419*c87b03e5Sespie/* Assignment expression. Operand 0 is the what to set; 1, the new value. */ 420*c87b03e5SespieDEFTREECODE (MODIFY_EXPR, "modify_expr", 'e', 2) 421*c87b03e5Sespie 422*c87b03e5Sespie/* Initialization expression. Operand 0 is the variable to initialize; 423*c87b03e5Sespie Operand 1 is the initializer. */ 424*c87b03e5SespieDEFTREECODE (INIT_EXPR, "init_expr", 'e', 2) 425*c87b03e5Sespie 426*c87b03e5Sespie/* For TARGET_EXPR, operand 0 is the target of an initialization, 427*c87b03e5Sespie operand 1 is the initializer for the target, 428*c87b03e5Sespie and operand 2 is the cleanup for this node, if any. 429*c87b03e5Sespie and operand 3 is the saved initializer after this node has been 430*c87b03e5Sespie expanded once, this is so we can re-expand the tree later. */ 431*c87b03e5SespieDEFTREECODE (TARGET_EXPR, "target_expr", 'e', 4) 432*c87b03e5Sespie 433*c87b03e5Sespie/* Conditional expression ( ... ? ... : ... in C). 434*c87b03e5Sespie Operand 0 is the condition. 435*c87b03e5Sespie Operand 1 is the then-value. 436*c87b03e5Sespie Operand 2 is the else-value. 437*c87b03e5Sespie Operand 0 may be of any type. 438*c87b03e5Sespie Operand 1 must have the same type as the entire expression, unless 439*c87b03e5Sespie it unconditionally throws an exception, in which case it should 440*c87b03e5Sespie have VOID_TYPE. The same constraints apply to operand 2. */ 441*c87b03e5SespieDEFTREECODE (COND_EXPR, "cond_expr", 'e', 3) 442*c87b03e5Sespie 443*c87b03e5Sespie/* Declare local variables, including making RTL and allocating space. 444*c87b03e5Sespie Operand 0 is a chain of VAR_DECL nodes for the variables. 445*c87b03e5Sespie Operand 1 is the body, the expression to be computed using 446*c87b03e5Sespie the variables. The value of operand 1 becomes that of the BIND_EXPR. 447*c87b03e5Sespie Operand 2 is the BLOCK that corresponds to these bindings 448*c87b03e5Sespie for debugging purposes. If this BIND_EXPR is actually expanded, 449*c87b03e5Sespie that sets the TREE_USED flag in the BLOCK. 450*c87b03e5Sespie 451*c87b03e5Sespie The BIND_EXPR is not responsible for informing parsers 452*c87b03e5Sespie about these variables. If the body is coming from the input file, 453*c87b03e5Sespie then the code that creates the BIND_EXPR is also responsible for 454*c87b03e5Sespie informing the parser of the variables. 455*c87b03e5Sespie 456*c87b03e5Sespie If the BIND_EXPR is ever expanded, its TREE_USED flag is set. 457*c87b03e5Sespie This tells the code for debugging symbol tables not to ignore the BIND_EXPR. 458*c87b03e5Sespie If the BIND_EXPR should be output for debugging but will not be expanded, 459*c87b03e5Sespie set the TREE_USED flag by hand. 460*c87b03e5Sespie 461*c87b03e5Sespie In order for the BIND_EXPR to be known at all, the code that creates it 462*c87b03e5Sespie must also install it as a subblock in the tree of BLOCK 463*c87b03e5Sespie nodes for the function. */ 464*c87b03e5SespieDEFTREECODE (BIND_EXPR, "bind_expr", 'e', 3) 465*c87b03e5Sespie 466*c87b03e5Sespie/* Function call. Operand 0 is the function. 467*c87b03e5Sespie Operand 1 is the argument list, a list of expressions 468*c87b03e5Sespie made out of a chain of TREE_LIST nodes. */ 469*c87b03e5SespieDEFTREECODE (CALL_EXPR, "call_expr", 'e', 2) 470*c87b03e5Sespie 471*c87b03e5Sespie/* Call a method. Operand 0 is the method, whose type is a METHOD_TYPE. 472*c87b03e5Sespie Operand 1 is the expression for "self". 473*c87b03e5Sespie Operand 2 is the list of explicit arguments. */ 474*c87b03e5SespieDEFTREECODE (METHOD_CALL_EXPR, "method_call_expr", 'e', 4) 475*c87b03e5Sespie 476*c87b03e5Sespie/* Specify a value to compute along with its corresponding cleanup. 477*c87b03e5Sespie Operand 0 argument is an expression whose value needs a cleanup. 478*c87b03e5Sespie Operand 1 is the cleanup expression for the object. 479*c87b03e5Sespie Operand 2 is an RTL_EXPR which will eventually represent that value. 480*c87b03e5Sespie The RTL_EXPR is used in this expression, which is how the expression 481*c87b03e5Sespie manages to act on the proper value. 482*c87b03e5Sespie The cleanup is executed by the first enclosing CLEANUP_POINT_EXPR, if 483*c87b03e5Sespie it exists, otherwise it is the responsibility of the caller to manually 484*c87b03e5Sespie call expand_start_target_temps/expand_end_target_temps, as needed. 485*c87b03e5Sespie 486*c87b03e5Sespie This differs from TRY_CATCH_EXPR in that operand 2 is always 487*c87b03e5Sespie evaluated when an exception isn't thrown when cleanups are run. */ 488*c87b03e5SespieDEFTREECODE (WITH_CLEANUP_EXPR, "with_cleanup_expr", 'e', 3) 489*c87b03e5Sespie 490*c87b03e5Sespie/* Specify a cleanup point. 491*c87b03e5Sespie Operand 0 is an expression that may have cleanups. If it does, those 492*c87b03e5Sespie cleanups are executed after the expression is expanded. 493*c87b03e5Sespie 494*c87b03e5Sespie Note that if the expression is a reference to storage, it is forced out 495*c87b03e5Sespie of memory before the cleanups are run. This is necessary to handle 496*c87b03e5Sespie cases where the cleanups modify the storage referenced; in the 497*c87b03e5Sespie expression 't.i', if 't' is a struct with an integer member 'i' and a 498*c87b03e5Sespie cleanup which modifies 'i', the value of the expression depends on 499*c87b03e5Sespie whether the cleanup is run before or after 't.i' is evaluated. When 500*c87b03e5Sespie expand_expr is run on 't.i', it returns a MEM. This is not good enough; 501*c87b03e5Sespie the value of 't.i' must be forced out of memory. 502*c87b03e5Sespie 503*c87b03e5Sespie As a consequence, the operand of a CLEANUP_POINT_EXPR must not have 504*c87b03e5Sespie BLKmode, because it will not be forced out of memory. */ 505*c87b03e5SespieDEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1) 506*c87b03e5Sespie 507*c87b03e5Sespie/* The following two codes are used in languages that have types where 508*c87b03e5Sespie some field in an object of the type contains a value that is used in 509*c87b03e5Sespie the computation of another field's offset or size and/or the size of 510*c87b03e5Sespie the type. The positions and/or sizes of fields can vary from object 511*c87b03e5Sespie to object of the same type. 512*c87b03e5Sespie 513*c87b03e5Sespie Record types with discriminants in Ada or schema types in Pascal are 514*c87b03e5Sespie examples of such types. This mechanism is also used to create "fat 515*c87b03e5Sespie pointers" for unconstrained array types in Ada; the fat pointer is a 516*c87b03e5Sespie structure one of whose fields is a pointer to the actual array type 517*c87b03e5Sespie and the other field is a pointer to a template, which is a structure 518*c87b03e5Sespie containing the bounds of the array. The bounds in the type pointed 519*c87b03e5Sespie to by the first field in the fat pointer refer to the values in the 520*c87b03e5Sespie template. 521*c87b03e5Sespie 522*c87b03e5Sespie When you wish to construct such a type you need "self-references" 523*c87b03e5Sespie that allow you to reference the object having this type from the 524*c87b03e5Sespie TYPE node, i.e. without having a variable instantiating this type. 525*c87b03e5Sespie 526*c87b03e5Sespie Such a "self-references" is done using a PLACEHOLDER_EXPR. This is 527*c87b03e5Sespie a node that will later be replaced with the object being referenced. 528*c87b03e5Sespie Its type is that of the object and selects which object to use from 529*c87b03e5Sespie a chain of references (see below). No other slots are used in the 530*c87b03e5Sespie PLACEHOLDER_EXPR. 531*c87b03e5Sespie 532*c87b03e5Sespie For example, if your type FOO is a RECORD_TYPE with a field BAR, 533*c87b03e5Sespie and you need the value of <variable>.BAR to calculate TYPE_SIZE 534*c87b03e5Sespie (FOO), just substitute <variable> above with a PLACEHOLDER_EXPR 535*c87b03e5Sespie what contains both the expression we wish to 536*c87b03e5Sespie evaluate and an expression within which the object may be found. 537*c87b03e5Sespie The latter expression is the object itself in the simple case of an 538*c87b03e5Sespie Ada record with discriminant, but it can be the array in the case of 539*c87b03e5Sespie an unconstrained array. 540*c87b03e5Sespie 541*c87b03e5Sespie In the latter case, we need the fat pointer, because the bounds of 542*c87b03e5Sespie the array can only be accessed from it. However, we rely here on the 543*c87b03e5Sespie fact that the expression for the array contains the dereference of 544*c87b03e5Sespie the fat pointer that obtained the array pointer. 545*c87b03e5Sespie 546*c87b03e5Sespie Accordingly, when looking for the object to substitute in place of 547*c87b03e5Sespie a PLACEHOLDER_EXPR, we look down the first operand of the expression 548*c87b03e5Sespie passed as the second operand to WITH_RECORD_EXPR until we find 549*c87b03e5Sespie something of the desired type or reach a constant. */ 550*c87b03e5Sespie 551*c87b03e5Sespie/* Denotes a record to later be supplied with a WITH_RECORD_EXPR when 552*c87b03e5Sespie evaluating this expression. The type of this expression is used to 553*c87b03e5Sespie find the record to replace it. */ 554*c87b03e5SespieDEFTREECODE (PLACEHOLDER_EXPR, "placeholder_expr", 'x', 0) 555*c87b03e5Sespie 556*c87b03e5Sespie/* Provide an expression that references a record to be used in place 557*c87b03e5Sespie of a PLACEHOLDER_EXPR. The record to be used is the record within 558*c87b03e5Sespie operand 1 that has the same type as the PLACEHOLDER_EXPR in 559*c87b03e5Sespie operand 0. */ 560*c87b03e5SespieDEFTREECODE (WITH_RECORD_EXPR, "with_record_expr", 'e', 2) 561*c87b03e5Sespie 562*c87b03e5Sespie/* Simple arithmetic. */ 563*c87b03e5SespieDEFTREECODE (PLUS_EXPR, "plus_expr", '2', 2) 564*c87b03e5SespieDEFTREECODE (MINUS_EXPR, "minus_expr", '2', 2) 565*c87b03e5SespieDEFTREECODE (MULT_EXPR, "mult_expr", '2', 2) 566*c87b03e5Sespie 567*c87b03e5Sespie/* Division for integer result that rounds the quotient toward zero. */ 568*c87b03e5SespieDEFTREECODE (TRUNC_DIV_EXPR, "trunc_div_expr", '2', 2) 569*c87b03e5Sespie 570*c87b03e5Sespie/* Division for integer result that rounds the quotient toward infinity. */ 571*c87b03e5SespieDEFTREECODE (CEIL_DIV_EXPR, "ceil_div_expr", '2', 2) 572*c87b03e5Sespie 573*c87b03e5Sespie/* Division for integer result that rounds toward minus infinity. */ 574*c87b03e5SespieDEFTREECODE (FLOOR_DIV_EXPR, "floor_div_expr", '2', 2) 575*c87b03e5Sespie 576*c87b03e5Sespie/* Division for integer result that rounds toward nearest integer. */ 577*c87b03e5SespieDEFTREECODE (ROUND_DIV_EXPR, "round_div_expr", '2', 2) 578*c87b03e5Sespie 579*c87b03e5Sespie/* Four kinds of remainder that go with the four kinds of division. */ 580*c87b03e5SespieDEFTREECODE (TRUNC_MOD_EXPR, "trunc_mod_expr", '2', 2) 581*c87b03e5SespieDEFTREECODE (CEIL_MOD_EXPR, "ceil_mod_expr", '2', 2) 582*c87b03e5SespieDEFTREECODE (FLOOR_MOD_EXPR, "floor_mod_expr", '2', 2) 583*c87b03e5SespieDEFTREECODE (ROUND_MOD_EXPR, "round_mod_expr", '2', 2) 584*c87b03e5Sespie 585*c87b03e5Sespie/* Division for real result. */ 586*c87b03e5SespieDEFTREECODE (RDIV_EXPR, "rdiv_expr", '2', 2) 587*c87b03e5Sespie 588*c87b03e5Sespie/* Division which is not supposed to need rounding. 589*c87b03e5Sespie Used for pointer subtraction in C. */ 590*c87b03e5SespieDEFTREECODE (EXACT_DIV_EXPR, "exact_div_expr", '2', 2) 591*c87b03e5Sespie 592*c87b03e5Sespie/* Conversion of real to fixed point: four ways to round, 593*c87b03e5Sespie like the four ways to divide. 594*c87b03e5Sespie CONVERT_EXPR can also be used to convert a real to an integer, 595*c87b03e5Sespie and that is what is used in languages that do not have ways of 596*c87b03e5Sespie specifying which of these is wanted. Maybe these are not needed. */ 597*c87b03e5SespieDEFTREECODE (FIX_TRUNC_EXPR, "fix_trunc_expr", '1', 1) 598*c87b03e5SespieDEFTREECODE (FIX_CEIL_EXPR, "fix_ceil_expr", '1', 1) 599*c87b03e5SespieDEFTREECODE (FIX_FLOOR_EXPR, "fix_floor_expr", '1', 1) 600*c87b03e5SespieDEFTREECODE (FIX_ROUND_EXPR, "fix_round_expr", '1', 1) 601*c87b03e5Sespie 602*c87b03e5Sespie/* Conversion of an integer to a real. */ 603*c87b03e5SespieDEFTREECODE (FLOAT_EXPR, "float_expr", '1', 1) 604*c87b03e5Sespie 605*c87b03e5Sespie/* Unary negation. */ 606*c87b03e5SespieDEFTREECODE (NEGATE_EXPR, "negate_expr", '1', 1) 607*c87b03e5Sespie 608*c87b03e5SespieDEFTREECODE (MIN_EXPR, "min_expr", '2', 2) 609*c87b03e5SespieDEFTREECODE (MAX_EXPR, "max_expr", '2', 2) 610*c87b03e5Sespie 611*c87b03e5Sespie/* Represents the absolute value of the operand. 612*c87b03e5Sespie 613*c87b03e5Sespie An ABS_EXPR must have either an INTEGER_TYPE or a REAL_TYPE. The 614*c87b03e5Sespie operand of the ABS_EXPR must have the same type. */ 615*c87b03e5SespieDEFTREECODE (ABS_EXPR, "abs_expr", '1', 1) 616*c87b03e5Sespie 617*c87b03e5SespieDEFTREECODE (FFS_EXPR, "ffs_expr", '1', 1) 618*c87b03e5Sespie 619*c87b03e5Sespie/* Shift operations for shift and rotate. 620*c87b03e5Sespie Shift means logical shift if done on an 621*c87b03e5Sespie unsigned type, arithmetic shift if done on a signed type. 622*c87b03e5Sespie The second operand is the number of bits to 623*c87b03e5Sespie shift by; it need not be the same type as the first operand and result. 624*c87b03e5Sespie Note that the result is undefined if the second operand is larger 625*c87b03e5Sespie than the first operand's type size. */ 626*c87b03e5SespieDEFTREECODE (LSHIFT_EXPR, "lshift_expr", '2', 2) 627*c87b03e5SespieDEFTREECODE (RSHIFT_EXPR, "rshift_expr", '2', 2) 628*c87b03e5SespieDEFTREECODE (LROTATE_EXPR, "lrotate_expr", '2', 2) 629*c87b03e5SespieDEFTREECODE (RROTATE_EXPR, "rrotate_expr", '2', 2) 630*c87b03e5Sespie 631*c87b03e5Sespie/* Bitwise operations. Operands have same mode as result. */ 632*c87b03e5SespieDEFTREECODE (BIT_IOR_EXPR, "bit_ior_expr", '2', 2) 633*c87b03e5SespieDEFTREECODE (BIT_XOR_EXPR, "bit_xor_expr", '2', 2) 634*c87b03e5SespieDEFTREECODE (BIT_AND_EXPR, "bit_and_expr", '2', 2) 635*c87b03e5SespieDEFTREECODE (BIT_ANDTC_EXPR, "bit_andtc_expr", '2', 2) 636*c87b03e5SespieDEFTREECODE (BIT_NOT_EXPR, "bit_not_expr", '1', 1) 637*c87b03e5Sespie 638*c87b03e5Sespie/* ANDIF and ORIF allow the second operand not to be computed if the 639*c87b03e5Sespie value of the expression is determined from the first operand. AND, 640*c87b03e5Sespie OR, and XOR always compute the second operand whether its value is 641*c87b03e5Sespie needed or not (for side effects). The operand may have 642*c87b03e5Sespie BOOLEAN_TYPE or INTEGER_TYPE. In either case, the argument will be 643*c87b03e5Sespie either zero or one. For example, a TRUTH_NOT_EXPR will never have 644*c87b03e5Sespie an INTEGER_TYPE VAR_DECL as its argument; instead, a NE_EXPR will be 645*c87b03e5Sespie used to compare the VAR_DECL to zero, thereby obtaining a node with 646*c87b03e5Sespie value zero or one. */ 647*c87b03e5SespieDEFTREECODE (TRUTH_ANDIF_EXPR, "truth_andif_expr", 'e', 2) 648*c87b03e5SespieDEFTREECODE (TRUTH_ORIF_EXPR, "truth_orif_expr", 'e', 2) 649*c87b03e5SespieDEFTREECODE (TRUTH_AND_EXPR, "truth_and_expr", 'e', 2) 650*c87b03e5SespieDEFTREECODE (TRUTH_OR_EXPR, "truth_or_expr", 'e', 2) 651*c87b03e5SespieDEFTREECODE (TRUTH_XOR_EXPR, "truth_xor_expr", 'e', 2) 652*c87b03e5SespieDEFTREECODE (TRUTH_NOT_EXPR, "truth_not_expr", 'e', 1) 653*c87b03e5Sespie 654*c87b03e5Sespie/* Relational operators. 655*c87b03e5Sespie `EQ_EXPR' and `NE_EXPR' are allowed for any types. 656*c87b03e5Sespie The others are allowed only for integer (or pointer or enumeral) 657*c87b03e5Sespie or real types. 658*c87b03e5Sespie In all cases the operands will have the same type, 659*c87b03e5Sespie and the value is always the type used by the language for booleans. */ 660*c87b03e5SespieDEFTREECODE (LT_EXPR, "lt_expr", '<', 2) 661*c87b03e5SespieDEFTREECODE (LE_EXPR, "le_expr", '<', 2) 662*c87b03e5SespieDEFTREECODE (GT_EXPR, "gt_expr", '<', 2) 663*c87b03e5SespieDEFTREECODE (GE_EXPR, "ge_expr", '<', 2) 664*c87b03e5SespieDEFTREECODE (EQ_EXPR, "eq_expr", '<', 2) 665*c87b03e5SespieDEFTREECODE (NE_EXPR, "ne_expr", '<', 2) 666*c87b03e5Sespie 667*c87b03e5Sespie/* Additional relational operators for floating point unordered. */ 668*c87b03e5SespieDEFTREECODE (UNORDERED_EXPR, "unordered_expr", '<', 2) 669*c87b03e5SespieDEFTREECODE (ORDERED_EXPR, "ordered_expr", '<', 2) 670*c87b03e5Sespie 671*c87b03e5Sespie/* These are equivalent to unordered or ... */ 672*c87b03e5SespieDEFTREECODE (UNLT_EXPR, "unlt_expr", '<', 2) 673*c87b03e5SespieDEFTREECODE (UNLE_EXPR, "unle_expr", '<', 2) 674*c87b03e5SespieDEFTREECODE (UNGT_EXPR, "ungt_expr", '<', 2) 675*c87b03e5SespieDEFTREECODE (UNGE_EXPR, "unge_expr", '<', 2) 676*c87b03e5SespieDEFTREECODE (UNEQ_EXPR, "uneq_expr", '<', 2) 677*c87b03e5Sespie 678*c87b03e5Sespie/* Operations for Pascal sets. Not used now. */ 679*c87b03e5SespieDEFTREECODE (IN_EXPR, "in_expr", '2', 2) 680*c87b03e5SespieDEFTREECODE (SET_LE_EXPR, "set_le_expr", '<', 2) 681*c87b03e5SespieDEFTREECODE (CARD_EXPR, "card_expr", '1', 1) 682*c87b03e5SespieDEFTREECODE (RANGE_EXPR, "range_expr", '2', 2) 683*c87b03e5Sespie 684*c87b03e5Sespie/* Represents a conversion of type of a value. 685*c87b03e5Sespie All conversions, including implicit ones, must be 686*c87b03e5Sespie represented by CONVERT_EXPR or NOP_EXPR nodes. */ 687*c87b03e5SespieDEFTREECODE (CONVERT_EXPR, "convert_expr", '1', 1) 688*c87b03e5Sespie 689*c87b03e5Sespie/* Represents a conversion expected to require no code to be generated. */ 690*c87b03e5SespieDEFTREECODE (NOP_EXPR, "nop_expr", '1', 1) 691*c87b03e5Sespie 692*c87b03e5Sespie/* Value is same as argument, but guaranteed not an lvalue. */ 693*c87b03e5SespieDEFTREECODE (NON_LVALUE_EXPR, "non_lvalue_expr", '1', 1) 694*c87b03e5Sespie 695*c87b03e5Sespie/* Represents viewing something of one type as being of a second type. 696*c87b03e5Sespie This corresponds to an "Unchecked Conversion" in Ada and roughly to 697*c87b03e5Sespie the idiom *(type2 *)&X in C. The only operand is the value to be 698*c87b03e5Sespie viewed as being of another type. It is undefined if the type of the 699*c87b03e5Sespie input and of the expression have different sizes. 700*c87b03e5Sespie 701*c87b03e5Sespie This code may also be used within the LHS of a MODIFY_EXPR, in which 702*c87b03e5Sespie case no actual data motion may occur. TREE_ADDRESSABLE will be set in 703*c87b03e5Sespie this case and GCC must abort if it could not do the operation without 704*c87b03e5Sespie generating insns. */ 705*c87b03e5SespieDEFTREECODE (VIEW_CONVERT_EXPR, "view_convert_expr", '1', 1) 706*c87b03e5Sespie 707*c87b03e5Sespie/* Represents something we computed once and will use multiple times. 708*c87b03e5Sespie First operand is that expression. Second is the function decl 709*c87b03e5Sespie in which the SAVE_EXPR was created. The third operand is the RTL, 710*c87b03e5Sespie nonzero only after the expression has been computed. */ 711*c87b03e5SespieDEFTREECODE (SAVE_EXPR, "save_expr", 'e', 3) 712*c87b03e5Sespie 713*c87b03e5Sespie/* For a UNSAVE_EXPR, operand 0 is the value to unsave. By unsave, we 714*c87b03e5Sespie mean that all _EXPRs such as TARGET_EXPRs, SAVE_EXPRs, 715*c87b03e5Sespie CALL_EXPRs and RTL_EXPRs, that are protected 716*c87b03e5Sespie from being evaluated more than once should be reset so that a new 717*c87b03e5Sespie expand_expr call of this expr will cause those to be re-evaluated. 718*c87b03e5Sespie This is useful when we want to reuse a tree in different places, 719*c87b03e5Sespie but where we must re-expand. */ 720*c87b03e5SespieDEFTREECODE (UNSAVE_EXPR, "unsave_expr", 'e', 1) 721*c87b03e5Sespie 722*c87b03e5Sespie/* Represents something whose RTL has already been expanded as a 723*c87b03e5Sespie sequence which should be emitted when this expression is expanded. 724*c87b03e5Sespie The first operand is the RTL to emit. It is the first of a chain 725*c87b03e5Sespie of insns. The second is the RTL expression for the result. Any 726*c87b03e5Sespie temporaries created during the building of the RTL_EXPR can be 727*c87b03e5Sespie reused once the RTL_EXPR has been expanded, with the exception of 728*c87b03e5Sespie the RTL_EXPR_RTL. */ 729*c87b03e5SespieDEFTREECODE (RTL_EXPR, "rtl_expr", 'e', 2) 730*c87b03e5Sespie 731*c87b03e5Sespie/* & in C. Value is the address at which the operand's value resides. 732*c87b03e5Sespie Operand may have any mode. Result mode is Pmode. */ 733*c87b03e5SespieDEFTREECODE (ADDR_EXPR, "addr_expr", 'e', 1) 734*c87b03e5Sespie 735*c87b03e5Sespie/* Non-lvalue reference or pointer to an object. */ 736*c87b03e5SespieDEFTREECODE (REFERENCE_EXPR, "reference_expr", 'e', 1) 737*c87b03e5Sespie 738*c87b03e5Sespie/* Operand is a function constant; result is a function variable value 739*c87b03e5Sespie of type EPmode. Used only for languages that need static chains. */ 740*c87b03e5SespieDEFTREECODE (ENTRY_VALUE_EXPR, "entry_value_expr", 'e', 1) 741*c87b03e5Sespie 742*c87b03e5Sespie/* Operand0 is a function constant; result is part N of a function 743*c87b03e5Sespie descriptor of type ptr_mode. */ 744*c87b03e5SespieDEFTREECODE (FDESC_EXPR, "fdesc_expr", 'e', 2) 745*c87b03e5Sespie 746*c87b03e5Sespie/* Given two real or integer operands of the same type, 747*c87b03e5Sespie returns a complex value of the corresponding complex type. */ 748*c87b03e5SespieDEFTREECODE (COMPLEX_EXPR, "complex_expr", '2', 2) 749*c87b03e5Sespie 750*c87b03e5Sespie/* Complex conjugate of operand. Used only on complex types. */ 751*c87b03e5SespieDEFTREECODE (CONJ_EXPR, "conj_expr", '1', 1) 752*c87b03e5Sespie 753*c87b03e5Sespie/* Used only on an operand of complex type, these return 754*c87b03e5Sespie a value of the corresponding component type. */ 755*c87b03e5SespieDEFTREECODE (REALPART_EXPR, "realpart_expr", '1', 1) 756*c87b03e5SespieDEFTREECODE (IMAGPART_EXPR, "imagpart_expr", '1', 1) 757*c87b03e5Sespie 758*c87b03e5Sespie/* Nodes for ++ and -- in C. 759*c87b03e5Sespie The second arg is how much to increment or decrement by. 760*c87b03e5Sespie For a pointer, it would be the size of the object pointed to. */ 761*c87b03e5SespieDEFTREECODE (PREDECREMENT_EXPR, "predecrement_expr", 'e', 2) 762*c87b03e5SespieDEFTREECODE (PREINCREMENT_EXPR, "preincrement_expr", 'e', 2) 763*c87b03e5SespieDEFTREECODE (POSTDECREMENT_EXPR, "postdecrement_expr", 'e', 2) 764*c87b03e5SespieDEFTREECODE (POSTINCREMENT_EXPR, "postincrement_expr", 'e', 2) 765*c87b03e5Sespie 766*c87b03e5Sespie/* Used to implement `va_arg'. */ 767*c87b03e5SespieDEFTREECODE (VA_ARG_EXPR, "va_arg_expr", 'e', 1) 768*c87b03e5Sespie 769*c87b03e5Sespie/* Evaluate operand 1. If and only if an exception is thrown during 770*c87b03e5Sespie the evaluation of operand 1, evaluate operand 2. 771*c87b03e5Sespie 772*c87b03e5Sespie This differs from WITH_CLEANUP_EXPR, in that operand 2 is never 773*c87b03e5Sespie evaluated unless an exception is throw. */ 774*c87b03e5SespieDEFTREECODE (TRY_CATCH_EXPR, "try_catch_expr", 'e', 2) 775*c87b03e5Sespie 776*c87b03e5Sespie/* Evaluate the first operand. 777*c87b03e5Sespie The second operand is a cleanup expression which is evaluated 778*c87b03e5Sespie before an exit (normal, exception, or jump out) from this expression. 779*c87b03e5Sespie 780*c87b03e5Sespie Like a CLEANUP_POINT_EXPR/WITH_CLEANUP_EXPR combination, but those 781*c87b03e5Sespie always copy the cleanup expression where needed. In contrast, 782*c87b03e5Sespie TRY_FINALLY_EXPR generates a jump to a cleanup subroutine. 783*c87b03e5Sespie (At least conceptually; the optimizer could inline the cleanup 784*c87b03e5Sespie subroutine in the same way it could inline normal subroutines.) 785*c87b03e5Sespie TRY_FINALLY_EXPR should be used when the cleanup is actual statements 786*c87b03e5Sespie in the source of the current function (which people might want to 787*c87b03e5Sespie set breakpoints in). */ 788*c87b03e5SespieDEFTREECODE (TRY_FINALLY_EXPR, "try_finally", 'e', 2) 789*c87b03e5Sespie 790*c87b03e5Sespie/* Used internally for cleanups in the implementation of TRY_FINALLY_EXPR. 791*c87b03e5Sespie (Specifically, it is created by expand_expr, not front-ends.) 792*c87b03e5Sespie Operand 0 is the rtx for the start of the subroutine we need to call. 793*c87b03e5Sespie Operand 1 is the rtx for a variable in which to store the address 794*c87b03e5Sespie of where the subroutine should return to. */ 795*c87b03e5SespieDEFTREECODE (GOTO_SUBROUTINE_EXPR, "goto_subroutine", 'e', 2) 796*c87b03e5Sespie 797*c87b03e5Sespie/* These types of expressions have no useful value, 798*c87b03e5Sespie and always have side effects. */ 799*c87b03e5Sespie 800*c87b03e5Sespie/* A label definition, encapsulated as a statement. 801*c87b03e5Sespie Operand 0 is the LABEL_DECL node for the label that appears here. 802*c87b03e5Sespie The type should be void and the value should be ignored. */ 803*c87b03e5SespieDEFTREECODE (LABEL_EXPR, "label_expr", 's', 1) 804*c87b03e5Sespie 805*c87b03e5Sespie/* GOTO. Operand 0 is a LABEL_DECL node or an expression. 806*c87b03e5Sespie The type should be void and the value should be ignored. */ 807*c87b03e5SespieDEFTREECODE (GOTO_EXPR, "goto_expr", 's', 1) 808*c87b03e5Sespie 809*c87b03e5Sespie/* RETURN. Evaluates operand 0, then returns from the current function. 810*c87b03e5Sespie Presumably that operand is an assignment that stores into the 811*c87b03e5Sespie RESULT_DECL that hold the value to be returned. 812*c87b03e5Sespie The operand may be null. 813*c87b03e5Sespie The type should be void and the value should be ignored. */ 814*c87b03e5SespieDEFTREECODE (RETURN_EXPR, "return_expr", 's', 1) 815*c87b03e5Sespie 816*c87b03e5Sespie/* Exit the inner most loop conditionally. Operand 0 is the condition. 817*c87b03e5Sespie The type should be void and the value should be ignored. */ 818*c87b03e5SespieDEFTREECODE (EXIT_EXPR, "exit_expr", 's', 1) 819*c87b03e5Sespie 820*c87b03e5Sespie/* A loop. Operand 0 is the body of the loop. 821*c87b03e5Sespie It must contain an EXIT_EXPR or is an infinite loop. 822*c87b03e5Sespie The type should be void and the value should be ignored. */ 823*c87b03e5SespieDEFTREECODE (LOOP_EXPR, "loop_expr", 's', 1) 824*c87b03e5Sespie 825*c87b03e5Sespie/* A labeled block. Operand 0 is the label that will be generated to 826*c87b03e5Sespie mark the end of the block. 827*c87b03e5Sespie Operand 1 is the labeled block body. */ 828*c87b03e5SespieDEFTREECODE (LABELED_BLOCK_EXPR, "labeled_block_expr", 'e', 2) 829*c87b03e5Sespie 830*c87b03e5Sespie/* Exit a labeled block, possibly returning a value. Operand 0 is a 831*c87b03e5Sespie LABELED_BLOCK_EXPR to exit. Operand 1 is the value to return. It 832*c87b03e5Sespie may be left null. */ 833*c87b03e5SespieDEFTREECODE (EXIT_BLOCK_EXPR, "exit_block_expr", 'e', 2) 834*c87b03e5Sespie 835*c87b03e5Sespie/* Annotates a tree node (usually an expression) with source location 836*c87b03e5Sespie information: a file name (EXPR_WFL_FILENAME); a line number 837*c87b03e5Sespie (EXPR_WFL_LINENO); and column number (EXPR_WFL_COLNO). It is 838*c87b03e5Sespie expanded as the contained node (EXPR_WFL_NODE); a line note should 839*c87b03e5Sespie be emitted first if EXPR_WFL_EMIT_LINE_NOTE. 840*c87b03e5Sespie The third operand is only used in the Java front-end, and will 841*c87b03e5Sespie eventually be removed. */ 842*c87b03e5SespieDEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location", 'e', 3) 843*c87b03e5Sespie 844*c87b03e5Sespie/* Switch expression. 845*c87b03e5Sespie Operand 0 is the expression used to perform the branch, 846*c87b03e5Sespie Operand 1 contains the case values. The way they're organized is 847*c87b03e5Sespie front-end implementation defined. */ 848*c87b03e5SespieDEFTREECODE (SWITCH_EXPR, "switch_expr", 'e', 2) 849*c87b03e5Sespie 850*c87b03e5Sespie/* The exception object from the runtime. */ 851*c87b03e5SespieDEFTREECODE (EXC_PTR_EXPR, "exc_ptr_expr", 'e', 0) 852*c87b03e5Sespie 853*c87b03e5Sespie/* 854*c87b03e5SespieLocal variables: 855*c87b03e5Sespiemode:c 856*c87b03e5SespieEnd: 857*c87b03e5Sespie*/ 858