Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | /* This file contains the definitions and documentation for the |
2 | tree codes used in the GNU C compiler. | |
3 | Copyright (C) 1987, 1988 Free Software Foundation, Inc. | |
4 | ||
5 | This file is part of GNU CC. | |
6 | ||
7 | GNU CC is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 1, or (at your option) | |
10 | any later version. | |
11 | ||
12 | GNU CC is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with GNU CC; see the file COPYING. If not, write to | |
19 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
20 | ||
21 | ||
22 | /* The third argument can be: | |
23 | "x" for an exceptional code (fits no category). | |
24 | "s" for a statement code. | |
25 | "t" for a type object code. | |
26 | ||
27 | "c" for codes for constants. | |
28 | "d" for codes for declarations (also serving as variable refs). | |
29 | "r" for codes for references to storage. | |
30 | "e" for codes for other kinds of expressions. */ | |
31 | ||
32 | /* For `r', `e' and `x' nodes, | |
33 | the 4th element is the number of argument slots to allocate. | |
34 | This determines the size of the tree node object. */ | |
35 | ||
36 | /* Any erroneous construct is parsed into a node of this type. | |
37 | This type of node is accepted without complaint in all contexts | |
38 | by later parsing activities, to avoid multiple error messages | |
39 | for one error. | |
40 | No fields in these nodes are used except the TREE_CODE. */ | |
41 | DEFTREECODE (ERROR_MARK, "error_mark", "x", 0) | |
42 | ||
43 | /* Used to represent a name (such as, in the DECL_NAME of a decl node). | |
44 | Internally it looks like a STRING_CST node. | |
45 | There is only one IDENTIFIER_NODE ever made for any particular name. | |
46 | Use `get_identifier' to get it (or create it, the first time). */ | |
47 | DEFTREECODE (IDENTIFIER_NODE, "identifier_node", "x", 7) | |
48 | ||
49 | /* Used to hold information to identify an operator (or combination | |
50 | of two operators) considered as a `noun' rather than a `verb'. | |
51 | The first operand is encoded in the TREE_TYPE field. */ | |
52 | DEFTREECODE (OP_IDENTIFIER, "op_identifier", "x", 2) | |
53 | ||
54 | /* Has the TREE_VALUE and TREE_PURPOSE fields. */ | |
55 | /* These nodes are made into lists by chaining through the | |
56 | TREE_CHAIN field. The elements of the list live in the | |
57 | TREE_VALUE fields, while TREE_PURPOSE fields are occasionally | |
58 | used as well to get the effect of Lisp association lists. */ | |
59 | DEFTREECODE (TREE_LIST, "tree_list", "x", 2) | |
60 | ||
61 | /* Each data type is represented by a tree node whose code is one of | |
62 | the following: */ | |
63 | /* Each node that represents a data type has a component TYPE_SIZE | |
64 | containing a tree that is an expression for the size in some units. | |
65 | The TYPE_SIZE_UNIT component is the number of bits in a unit. | |
66 | The TYPE_MODE contains the machine mode for values of this type. | |
67 | The TYPE_POINTER_TO field contains a type for a pointer to this type, | |
68 | or zero if no such has been created yet. | |
69 | The TYPE_NEXT_VARIANT field is used to chain together types | |
70 | that are variants made by type modifiers such as "const" and "volatile". | |
71 | The TYPE_MAIN_VARIANT field, in any member of such a chain, | |
72 | points to the start of the chain. | |
73 | The TYPE_NONCOPIED_PARTS field is a list specifying which parts | |
74 | of an object of this type should *not* be copied by assignment. | |
75 | The TREE_PURPOSE of each element is the offset of the part | |
76 | and the TREE_VALUE is the size in bits of the part. | |
77 | The TYPE_NAME field contains info on the name used in the program | |
78 | for this type (for GDB symbol table output). It is either a | |
79 | TYPE_DECL node, for types that are typedefs, or an IDENTIFIER_NODE | |
80 | in the case of structs, unions or enums that are known with a tag, | |
81 | or zero for types that have no special name. */ | |
82 | /* The TREE_CHAIN of a ..._TYPE node is normally used to put | |
83 | every type onto permanent_type_chain or temporary_type_chain (see tree.c). | |
84 | One exception is for ENUMERAL_TYPE, RECORD_TYPE and UNION_TYPE | |
85 | nodes used as forward-references to names; see below. */ | |
86 | ||
87 | DEFTREECODE (VOID_TYPE, "void_type", "t", 0) /* The void type in C */ | |
88 | ||
89 | /* Integer types in all languages, including char in C. */ | |
90 | /* Has components TYPE_MIN_VALUE, TYPE_MAX_VALUE (expressions, inclusive) | |
91 | and TYPE_PRECISION (number of bits used by this type). | |
92 | In the case of a subrange type in Pascal, the TREE_TYPE | |
93 | of this will point at the supertype (another INTEGER_TYPE). | |
94 | Otherwise, the TREE_TYPE is zero. */ | |
95 | DEFTREECODE (INTEGER_TYPE, "integer_type", "t", 0) | |
96 | ||
97 | /* C's float and double. Different floating types are distinguished | |
98 | by machine mode and by the TYPE_SIZE and the TYPE_PRECISION. */ | |
99 | DEFTREECODE (REAL_TYPE, "real_type", "t", 0) | |
100 | ||
101 | /* Complex number types. The TREE_TYPE field is the data type | |
102 | of the real and imaginary parts. */ | |
103 | DEFTREECODE (COMPLEX_TYPE, "complex_type", "t", 0) | |
104 | ||
105 | /* C enums. The type node looks just like an INTEGER_TYPE node. | |
106 | The symbols for the values of the enum type are defined by | |
107 | CONST_DECL nodes, but the type does not point to them; | |
108 | however, the TREE_VALUES is a list in which each elements' TREE_PURPOSE | |
109 | is a name and the TREE_VALUE is the value (an INTEGER_CST node). */ | |
110 | /* A forward reference `enum foo' when no enum named foo is defined yet | |
111 | has zero (a null pointer) in its TYPE_SIZE. The tag name is in | |
112 | the TYPE_NAME field. If the type is later defined, the normal | |
113 | fields are filled in. | |
114 | RECORD_TYPE and UNION_TYPE forward refs are treated similarly. */ | |
115 | DEFTREECODE (ENUMERAL_TYPE, "enumeral_type", "t", 0) | |
116 | ||
117 | /* Pascal's boolean type (true or false are the only values); | |
118 | no special fields needed. */ | |
119 | DEFTREECODE (BOOLEAN_TYPE, "boolean_type", "t", 0) | |
120 | ||
121 | /* CHAR in Pascal; not used in C. | |
122 | No special fields needed. */ | |
123 | DEFTREECODE (CHAR_TYPE, "char_type", "t", 0) | |
124 | ||
125 | /* All pointer-to-x types have code POINTER_TYPE. | |
126 | The TREE_TYPE points to the node for the type pointed to. */ | |
127 | DEFTREECODE (POINTER_TYPE, "pointer_type", "t", 0) | |
128 | ||
129 | /* An offset is a pointer relative to an object. | |
130 | The TREE_TYPE field is the type of the object at the offset. | |
131 | The TYPE_OFFSET_BASETYPE points to the node for the type of object | |
132 | that the offset is relative to. */ | |
133 | DEFTREECODE (OFFSET_TYPE, "offset_type", "t", 0) | |
134 | ||
135 | /* A reference is like a pointer except that it is coerced | |
136 | automatically to the value it points to. Used in C++. */ | |
137 | DEFTREECODE (REFERENCE_TYPE, "reference_type", "t", 0) | |
138 | ||
139 | /* METHOD_TYPE is the type of a function which takes an extra first | |
140 | argument for "self", which is not present in the declared argument list. | |
141 | The TREE_TYPE is the return type of the method. The TYPE_METHOD_BASETYPE | |
142 | is the type of "self". TYPE_ARG_TYPES is the real argument list, which | |
143 | includes the hidden argument for "self". */ | |
144 | DEFTREECODE (METHOD_TYPE, "method_type", "t", 0) | |
145 | ||
146 | /* Used for Pascal; details not determined right now. */ | |
147 | DEFTREECODE (FILE_TYPE, "file_type", "t", 0) | |
148 | ||
149 | /* Types of arrays. Special fields: | |
150 | TREE_TYPE Type of an array element. | |
151 | TYPE_DOMAIN Type to index by. | |
152 | Its range of values specifies the array length. | |
153 | TYPE_SEP Expression for units from one elt to the next. | |
154 | TYPE_SEP_UNIT Number of bits in a unit for previous. | |
155 | The field TYPE_POINTER_TO (TREE_TYPE (array_type)) is always nonzero | |
156 | and holds the type to coerce a value of that array type to in C. */ | |
157 | /* Array types in C or Pascal */ | |
158 | DEFTREECODE (ARRAY_TYPE, "array_type", "t", 0) | |
159 | ||
160 | /* Types of sets for Pascal. Special fields are the same as | |
161 | in an array type. The target type is always a boolean type. */ | |
162 | DEFTREECODE (SET_TYPE, "set_type", "t", 0) | |
163 | ||
164 | /* Not known whether Pascal really needs this | |
165 | or what it should contain. */ | |
166 | DEFTREECODE (STRING_TYPE, "string_type", "t", 0) | |
167 | ||
168 | /* Struct in C, or record in Pascal. */ | |
169 | /* Special fields: | |
170 | TYPE_FIELDS chain of FIELD_DECLs for the fields of the struct. | |
171 | A few may need to be added for Pascal. */ | |
172 | /* See the comment above, before ENUMERAL_TYPE, for how | |
173 | forward references to struct tags are handled in C. */ | |
174 | DEFTREECODE (RECORD_TYPE, "record_type", "t", 0) | |
175 | ||
176 | /* Union in C. Like a struct, except that the offsets of the fields | |
177 | will all be zero. */ | |
178 | /* See the comment above, before ENUMERAL_TYPE, for how | |
179 | forward references to union tags are handled in C. */ | |
180 | DEFTREECODE (UNION_TYPE, "union_type", "t", 0) /* C union type */ | |
181 | ||
182 | /* Type of functions. Special fields: | |
183 | TREE_TYPE type of value returned. | |
184 | TYPE_ARG_TYPES list of types of arguments expected. | |
185 | this list is made of TREE_LIST nodes. | |
186 | Types of "Procedures" in languages where they are different from functions | |
187 | have code FUNCTION_TYPE also, but then TREE_TYPE is zero or void type. */ | |
188 | DEFTREECODE (FUNCTION_TYPE, "function_type", "t", 0) | |
189 | ||
190 | /* This is a language-specific kind of type. | |
191 | Its meaning is defined by the language front end. | |
192 | layout_type does not know how to lay this out, | |
193 | so the front-end must do so manually. */ | |
194 | DEFTREECODE (LANG_TYPE, "lang_type", "t", 0) | |
195 | \f | |
196 | /* All statement types have fields STMT_SOURCE_FILE and STMT_SOURCE_LINE. */ | |
197 | /* Consecutive statements within a compound statement are chained together | |
198 | through the TREE_CHAIN field. */ | |
199 | ||
200 | /* A label definition, encapsulated as a statement. | |
201 | STMT_BODY is the LABEL_DECL node for the label that appears here. */ | |
202 | DEFTREECODE (LABEL_STMT, "label_stmt", "s", 1) | |
203 | ||
204 | /* GOTO, in any language. STMT_BODY is a LABEL_DECL node. */ | |
205 | DEFTREECODE (GOTO_STMT, "goto_stmt", "s", 1) | |
206 | ||
207 | /* RETURN, in any language. | |
208 | Evaluates the expression STMT_BODY, then returns from the current function. | |
209 | Presumably STMT_BODY is an assignment that stores into the | |
210 | RESULT_DECL that hold the value to be returned. | |
211 | STMT_BODY may be zero. */ | |
212 | DEFTREECODE (RETURN_STMT, "return_stmt", "s", 1) | |
213 | ||
214 | /* Statement that evaluates an expression. STMT_BODY is the expression. */ | |
215 | DEFTREECODE (EXPR_STMT, "expr_stmt", "s", 1) | |
216 | ||
217 | /* Pascal WITH statement. | |
218 | Contains a chain of variables (..._DECL nodes) in the STMT_VARS | |
219 | and a chain of statements (the STMT_BODY). | |
220 | STMT_SUPERCONTEXT points to the containing declaration scope. */ | |
221 | DEFTREECODE (WITH_STMT, "with_stmt", "s", 5) | |
222 | ||
223 | /* Declare variables whose scope is less than a function. | |
224 | This is used for C brace-pairs that contain declarations. | |
225 | Contains a chain of variables (..._DECL nodes) in the STMT_VARS | |
226 | and a chain of statements (the STMT_BODY). | |
227 | STMT_SUPERCONTEXT points to the containing declaration scope. | |
228 | STMT_BIND_SIZE is an expression for the size of local storage here. | |
229 | STMT_TYPE_TAGS is a list (chain of TREE_LIST nodes) | |
230 | pairing struct, union and enum tag names with the types they mean, | |
231 | for tags defined in this context. | |
232 | ||
233 | A LET_STMT can be used as an expression. Its STMT_BODY is expanded | |
234 | in its stead. Its TREE_USED is set if it is expanded. | |
235 | ||
236 | A LET_STMT whose TREE_USED is not set is ignored when symbols | |
237 | are output. If the LET_STMT is passed to expand_expr but it | |
238 | should not be ignored, set its TREE_USED by hand. */ | |
239 | DEFTREECODE (LET_STMT, "let_stmt", "s", 6) | |
240 | ||
241 | /* if-then-else statements in C and other languages. | |
242 | STMT_COND is the condition (an expression). | |
243 | STMT_THEN is the then-branch (a statement or chain of statements). | |
244 | STMT_ELSE is the else-branch (a statement or chain of statements). */ | |
245 | DEFTREECODE (IF_STMT, "if_stmt", "s", 3) | |
246 | ||
247 | /* if-else-exit; used in building parts of iterations. | |
248 | STMT_BODY is the condition (an expression). | |
249 | Exit if the iteration if the condition is FALSE. */ | |
250 | DEFTREECODE (EXIT_STMT, "exit_stmt", "s", 1) | |
251 | ||
252 | /* STMT_CASE_INDEX is an expression for the value to dispatch on. | |
253 | STMT_CASE_LIST is a list (a chain of TREE_LIST nodes) | |
254 | of the branches of the dispatch. | |
255 | Each such TREE_LIST node has the case it is for (a constant expression) | |
256 | as the TREE_PURPOSE | |
257 | and the label to go to (a LABEL_DECL) as the TREE_VALUE. | |
258 | ||
259 | Normally, the labels reside inside a COMPOUND_STMT | |
260 | which contains ths CASE_STMT as its first statement. */ | |
261 | DEFTREECODE (CASE_STMT, "case_stmt", "s", 3) | |
262 | ||
263 | /* STMT_BODY contains a chain of statements to be executed repeatedly. */ | |
264 | DEFTREECODE (LOOP_STMT, "loop_stmt", "s", 1) | |
265 | ||
266 | /* Contains as its STMT_BODY a chain of substatements. */ | |
267 | DEFTREECODE (COMPOUND_STMT, "compound_stmt", "s", 1) | |
268 | ||
269 | /* Contains as its STMT_BODY a string of assembly code. */ | |
270 | DEFTREECODE (ASM_STMT, "asm_stmt", "s", 1) | |
271 | \f | |
272 | /* Expressions */ | |
273 | ||
274 | /* First, the constants. */ | |
275 | ||
276 | /* Contents are in TREE_INT_CST_LOW and TREE_INT_CST_HIGH fields, | |
277 | 32 bits each, giving us a 64 bit constant capability. | |
278 | Note: constants of type char in Pascal are INTEGER_CST, | |
279 | and so are pointer constants such as nil in Pascal or NULL in C. | |
280 | `(int *) 1' in C also results in an INTEGER_CST. */ | |
281 | DEFTREECODE (INTEGER_CST, "integer_cst", "c", 2) | |
282 | ||
283 | /* Contents are in TREE_REAL_CST field. Also there is TREE_CST_RTL. */ | |
284 | DEFTREECODE (REAL_CST, "real_cst", "c", 3) | |
285 | ||
286 | /* Contents are in TREE_REALPART and TREE_IMAGPART fields, | |
287 | whose contents are other constant nodes. | |
288 | Also there is TREE_CST_RTL. */ | |
289 | DEFTREECODE (COMPLEX_CST, "complex_cst", "c", 3) | |
290 | ||
291 | /* Contents are TREE_STRING_LENGTH and TREE_STRING_POINTER fields. | |
292 | Also there is TREE_CST_RTL. */ | |
293 | DEFTREECODE (STRING_CST, "string_cst", "c", 3) | |
294 | ||
295 | /* Declarations. All references to names are represented as ..._DECL nodes. | |
296 | The decls in one binding context are chained through the TREE_CHAIN field. | |
297 | Each DECL has a DECL_NAME field which contains an IDENTIFIER_NODE. | |
298 | (Some decls, most often labels, may have zero as the DECL_NAME). | |
299 | DECL_CONTEXT points to the node representing the context in which | |
300 | this declaration has its scope. For FIELD_DECLs, this is the | |
301 | RECORD_TYPE or UNION_TYPE node that the field belongs to; | |
302 | for other kinds of decl nodes, this is a LET_STMT node or the ROOT_NODE. | |
303 | The TREE_TYPE field holds the data type of the object, when relevant. | |
304 | LABEL_DECLs have no data type. For TYPE_DECL, the TREE_TYPE field | |
305 | contents are the type whose name is being declared. | |
306 | The DECL_ALIGN, DECL_SIZE, DECL_SIZE_UNIT | |
307 | and DECL_MODE fields exist in decl nodes just as in type nodes. | |
308 | They are unused in LABEL_DECL, TYPE_DECL and CONST_DECL nodes. | |
309 | ||
310 | DECL_OFFSET holds an integer number of bits offset for the location. | |
311 | DECL_VOFFSET holds an expression for a variable offset; it is | |
312 | to be multiplied by DECL_VOFFSET_UNIT (an integer). | |
313 | These fields are relevant only in FIELD_DECLs and PARM_DECLs. | |
314 | ||
315 | DECL_INITIAL holds the value to initialize a variable to, | |
316 | or the value of a constant. For a function, it holds the body | |
317 | (a node of type LET_STMT representing the function's binding contour | |
318 | and whose body contains the function's statements.) | |
319 | ||
320 | PARM_DECLs use a special field: | |
321 | DECL_ARG_TYPE is the type in which the argument is actually | |
322 | passed, which may be different from its type within the function. | |
323 | ||
324 | FUNCTION_DECLs use four special fields: | |
325 | DECL_ARGUMENTS holds a chain of PARM_DECL nodes for the arguments. | |
326 | DECL_RESULT holds a RESULT_DECL node for the value of a function, | |
327 | or it is 0 for a function that returns no value. | |
328 | (C functions returning void have zero here.) | |
329 | DECL_RESULT_TYPE holds the type in which the result is actually | |
330 | returned. This is usually the same as the type of DECL_RESULT, | |
331 | but (1) it may be a wider integer type and | |
332 | (2) it remains valid, for the sake of inlining, even after the | |
333 | function's compilation is done. | |
334 | DECL_FUNCTION_CODE is a code number that is nonzero for | |
335 | built-in functions. Its value is an enum built_in_function | |
336 | that says which built-in function it is. | |
337 | DECL_BLOCK_SYMTAB_ADDRESS records (after the symtab data for the function's | |
338 | body has been output) the address in the symtab file of the | |
339 | `struct block' for the function's top-level binding context. | |
340 | This must be stored in the symtab structure for the function name. | |
341 | ||
342 | DECL_SOURCE_FILE holds a filename string and DECL_SOURCE_LINE | |
343 | holds a line number. */ | |
344 | ||
345 | DEFTREECODE (FUNCTION_DECL, "function_decl", "d", 0) | |
346 | DEFTREECODE (LABEL_DECL, "label_decl", "d", 0) | |
347 | DEFTREECODE (CONST_DECL, "const_decl", "d", 0) | |
348 | DEFTREECODE (TYPE_DECL, "type_decl", "d", 0) | |
349 | DEFTREECODE (VAR_DECL, "var_decl", "d", 0) | |
350 | DEFTREECODE (PARM_DECL, "parm_decl", "d", 0) | |
351 | DEFTREECODE (RESULT_DECL, "result_decl", "d", 0) | |
352 | DEFTREECODE (FIELD_DECL, "field_decl", "d", 0) | |
353 | \f | |
354 | /* References to storage. */ | |
355 | ||
356 | /* Value is structure or union component. | |
357 | Operand 0 is the structure or union (an expression); | |
358 | operand 1 is the field (a node of type FIELD_DECL). */ | |
359 | DEFTREECODE (COMPONENT_REF, "component_ref", "r", 2) | |
360 | ||
361 | /* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */ | |
362 | DEFTREECODE (INDIRECT_REF, "indirect_ref", "r", 1) | |
363 | ||
364 | /* Reference to the contents of an offset | |
365 | (a value whose type is an OFFSET_TYPE). | |
366 | Operand 0 is the object within which the offset is taken. | |
367 | Operand 1 is the offset. */ | |
368 | DEFTREECODE (OFFSET_REF, "offset_ref", "r", 2) | |
369 | ||
370 | /* Pascal `^` on a file. One operand, an expression for the file. */ | |
371 | DEFTREECODE (BUFFER_REF, "buffer_ref", "r", 1) | |
372 | ||
373 | /* Array indexing in languages other than C. | |
374 | Operand 0 is the array; operand 1 is a list of indices | |
375 | stored as a chain of TREE_LIST nodes. */ | |
376 | DEFTREECODE (ARRAY_REF, "array_ref", "r", 2) | |
377 | ||
378 | /* Constructor: return an aggregate value made from specified components. | |
379 | In C, this is used only for structure and array initializers. | |
380 | The first "operand" is really a pointer to the RTL, | |
381 | for constant constructors only. | |
382 | The second operand is a list of component values | |
383 | made out of a chain of TREE_LIST nodes. */ | |
384 | DEFTREECODE (CONSTRUCTOR, "constructor", "e", 2) | |
385 | ||
386 | /* The expression types are mostly straightforward, | |
387 | with the fourth argument of DEFTREECODE saying | |
388 | how many operands there are. | |
389 | Unless otherwise specified, the operands are expressions. */ | |
390 | ||
391 | /* Contains two expressions to compute, one followed by the other. | |
392 | the first value is ignored. The second one's value is used. */ | |
393 | DEFTREECODE (COMPOUND_EXPR, "compound_expr", "e", 2) | |
394 | ||
395 | /* Assignment expression. Operand 0 is the what to set; 1, the new value. */ | |
396 | DEFTREECODE (MODIFY_EXPR, "modify_expr", "e", 2) | |
397 | ||
398 | /* Initialization expression. Operand 0 is the variable to initialize; | |
399 | Operand 1 is the initializer. */ | |
400 | DEFTREECODE (INIT_EXPR, "init_expr", "e", 2) | |
401 | ||
402 | /* Use these for overloading `new' and `delete'. | |
403 | ??? Please describe the meaning of the operands. */ | |
404 | DEFTREECODE (NEW_EXPR, "new_expr", "e", 2) | |
405 | DEFTREECODE (DELETE_EXPR, "delete_expr", "e", 2) | |
406 | ||
407 | /* Use these for providing abstract push and pop operations for wrappers. | |
408 | Operand 0 is the abstract stack. Operand 1 is the value to push or pop. | |
409 | ??? What kind of value is an "abstract stack"? */ | |
410 | DEFTREECODE (PUSH_EXPR, "push_expr", "e", 2) | |
411 | DEFTREECODE (POP_EXPR, "pop_expr", "e", 2) | |
412 | ||
413 | /* Conditional expression ( ... ? ... : ... in C). | |
414 | Operand 0 is the condition. | |
415 | Operand 1 is the then-value. | |
416 | Operand 2 is the else-value. */ | |
417 | DEFTREECODE (COND_EXPR, "cond_expr", "e", 3) | |
418 | ||
419 | /* Function call. Operand 0 is the function. | |
420 | Operand 1 is the argument list, a list of expressions | |
421 | made out of a chain of TREE_LIST nodes. | |
422 | There is no operand 2. That slot is used for the | |
423 | CALL_EXPR_RTL macro (see preexpand_calls). */ | |
424 | DEFTREECODE (CALL_EXPR, "call_expr", "e", 3) | |
425 | ||
426 | /* Call a method. Operand 0 is the method, whose type is a METHOD_TYPE. | |
427 | Operand 1 is the expression for "self". | |
428 | Operand 2 is the list of explicit arguments. */ | |
429 | DEFTREECODE (METHOD_CALL_EXPR, "method_call_expr", "e", 4) | |
430 | ||
431 | /* Specify a value to compute along with its corresponding cleanup. | |
432 | Operand 0 argument is an expression whose value needs a cleanup. | |
433 | Operand 1 is an RTL_EXPR which will eventually represent that value. | |
434 | Operand 2 is the cleanup expression for the object. | |
435 | The RTL_EXPR is used in this expression, which is how the expression | |
436 | manages to act on the proper value. | |
437 | The cleanup is executed when the value is no longer needed, | |
438 | which is not at precisely the same time that this value is computed. */ | |
439 | DEFTREECODE (WITH_CLEANUP_EXPR, "with_cleanup_expr", "e", 3) | |
440 | ||
441 | /* Simple arithmetic. Operands must have the same machine mode | |
442 | and the value shares that mode. */ | |
443 | DEFTREECODE (PLUS_EXPR, "plus_expr", "e", 2) | |
444 | DEFTREECODE (MINUS_EXPR, "minus_expr", "e", 2) | |
445 | DEFTREECODE (MULT_EXPR, "mult_expr", "e", 2) | |
446 | ||
447 | /* Division for integer result that rounds the quotient toward zero. */ | |
448 | /* Operands must have the same machine mode. | |
449 | In principle they may be real, but that is not currently supported. | |
450 | The result is always fixed point, and it has the same type as the | |
451 | operands if they are fixed point. */ | |
452 | DEFTREECODE (TRUNC_DIV_EXPR, "trunc_div_expr", "e", 2) | |
453 | ||
454 | /* Division for integer result that rounds the quotient toward infinity. */ | |
455 | DEFTREECODE (CEIL_DIV_EXPR, "ceil_div_expr", "e", 2) | |
456 | ||
457 | /* Division for integer result that rounds toward minus infinity. */ | |
458 | DEFTREECODE (FLOOR_DIV_EXPR, "floor_div_expr", "e", 2) | |
459 | ||
460 | /* Division for integer result that rounds toward nearest integer. */ | |
461 | DEFTREECODE (ROUND_DIV_EXPR, "round_div_expr", "e", 2) | |
462 | ||
463 | /* Four kinds of remainder that go with the four kinds of division. */ | |
464 | DEFTREECODE (TRUNC_MOD_EXPR, "trunc_mod_expr", "e", 2) | |
465 | DEFTREECODE (CEIL_MOD_EXPR, "ceil_mod_expr", "e", 2) | |
466 | DEFTREECODE (FLOOR_MOD_EXPR, "floor_mod_expr", "e", 2) | |
467 | DEFTREECODE (ROUND_MOD_EXPR, "round_mod_expr", "e", 2) | |
468 | ||
469 | /* Division for real result. The two operands must have the same type. | |
470 | In principle they could be integers, but currently only real | |
471 | operands are supported. The result must have the same type | |
472 | as the operands. */ | |
473 | DEFTREECODE (RDIV_EXPR, "rdiv_expr", "e", 2) | |
474 | ||
475 | /* Division which is not supposed to need rounding. | |
476 | Used for pointer subtraction in C. */ | |
477 | DEFTREECODE (EXACT_DIV_EXPR, "exact_div_expr", "e", 2) | |
478 | ||
479 | /* Conversion of real to fixed point: four ways to round, | |
480 | like the four ways to divide. | |
481 | CONVERT_EXPR can also be used to convert a real to an integer, | |
482 | and that is what is used in languages that do not have ways of | |
483 | specifying which of these is wanted. Maybe these are not needed. */ | |
484 | DEFTREECODE (FIX_TRUNC_EXPR, "fix_trunc_expr", "e", 1) | |
485 | DEFTREECODE (FIX_CEIL_EXPR, "fix_ceil_expr", "e", 1) | |
486 | DEFTREECODE (FIX_FLOOR_EXPR, "fix_floor_expr", "e", 1) | |
487 | DEFTREECODE (FIX_ROUND_EXPR, "fix_round_expr", "e", 1) | |
488 | ||
489 | /* Conversion of an integer to a real. */ | |
490 | DEFTREECODE (FLOAT_EXPR, "float_expr", "e", 1) | |
491 | ||
492 | /* Exponentiation. Operands may have any types; | |
493 | constraints on value type are not known yet. */ | |
494 | DEFTREECODE (EXPON_EXPR, "expon_expr", "e", 2) | |
495 | ||
496 | /* Unary negation. Value has same type as operand. */ | |
497 | DEFTREECODE (NEGATE_EXPR, "negate_expr", "e", 1) | |
498 | ||
499 | DEFTREECODE (MIN_EXPR, "min_expr", "e", 2) | |
500 | DEFTREECODE (MAX_EXPR, "max_expr", "e", 2) | |
501 | DEFTREECODE (ABS_EXPR, "abs_expr", "e", 1) | |
502 | DEFTREECODE (FFS_EXPR, "ffs_expr", "e", 1) | |
503 | ||
504 | /* Shift operations for shift and rotate. | |
505 | Shift is supposed to mean logical shift if done on an | |
506 | unsigned type, arithmetic shift on a signed type. | |
507 | The second operand is the number of bits to | |
508 | shift by, and must always have mode SImode. | |
509 | The result has the same mode as the first operand. */ | |
510 | DEFTREECODE (LSHIFT_EXPR, "alshift_expr", "e", 2) | |
511 | DEFTREECODE (RSHIFT_EXPR, "arshift_expr", "e", 2) | |
512 | DEFTREECODE (LROTATE_EXPR, "lrotate_expr", "e", 2) | |
513 | DEFTREECODE (RROTATE_EXPR, "rrotate_expr", "e", 2) | |
514 | ||
515 | /* Bitwise operations. Operands have same mode as result. */ | |
516 | DEFTREECODE (BIT_IOR_EXPR, "bit_ior_expr", "e", 2) | |
517 | DEFTREECODE (BIT_XOR_EXPR, "bit_xor_expr", "e", 2) | |
518 | DEFTREECODE (BIT_AND_EXPR, "bit_and_expr", "e", 2) | |
519 | DEFTREECODE (BIT_ANDTC_EXPR, "bit_andtc_expr", "e", 2) | |
520 | DEFTREECODE (BIT_NOT_EXPR, "bit_not_expr", "e", 1) | |
521 | ||
522 | /* Combination of boolean values or of integers considered only | |
523 | as zero or nonzero. ANDIF and ORIF allow the second operand | |
524 | not to be computed if the value of the expression is determined | |
525 | from the first operand. AND and OR always compute the second | |
526 | operand whether its value is needed or not (for side effects). */ | |
527 | DEFTREECODE (TRUTH_ANDIF_EXPR, "truth_andif_expr", "e", 2) | |
528 | DEFTREECODE (TRUTH_ORIF_EXPR, "truth_orif_expr", "e", 2) | |
529 | DEFTREECODE (TRUTH_AND_EXPR, "truth_and_expr", "e", 2) | |
530 | DEFTREECODE (TRUTH_OR_EXPR, "truth_or_expr", "e", 2) | |
531 | DEFTREECODE (TRUTH_NOT_EXPR, "truth_not_expr", "e", 1) | |
532 | ||
533 | /* Relational operators. | |
534 | `EQ_EXPR' and `NE_EXPR' are allowed for any types. | |
535 | The others are allowed only for integer (or pointer or enumeral) | |
536 | or real types. | |
537 | In all cases the operands will have the same type, | |
538 | and the value is always the type used by the language for booleans. */ | |
539 | DEFTREECODE (LT_EXPR, "lt_expr", "e", 2) | |
540 | DEFTREECODE (LE_EXPR, "le_expr", "e", 2) | |
541 | DEFTREECODE (GT_EXPR, "gt_expr", "e", 2) | |
542 | DEFTREECODE (GE_EXPR, "ge_expr", "e", 2) | |
543 | DEFTREECODE (EQ_EXPR, "eq_expr", "e", 2) | |
544 | DEFTREECODE (NE_EXPR, "ne_expr", "e", 2) | |
545 | ||
546 | /* Operations for Pascal sets. Not used now. */ | |
547 | DEFTREECODE (IN_EXPR, "in_expr", "e", 2) | |
548 | DEFTREECODE (SET_LE_EXPR, "set_le_expr", "e", 2) | |
549 | DEFTREECODE (CARD_EXPR, "card_expr", "e", 1) | |
550 | DEFTREECODE (RANGE_EXPR, "range_expr", "e", 2) | |
551 | ||
552 | /* Represents a conversion of type of a value. | |
553 | All conversions, including implicit ones, must be | |
554 | represented by CONVERT_EXPR nodes. */ | |
555 | DEFTREECODE (CONVERT_EXPR, "convert_expr", "e", 1) | |
556 | ||
557 | /* Represents a conversion expected to require no code to be generated. */ | |
558 | DEFTREECODE (NOP_EXPR, "nop_expr", "e", 1) | |
559 | ||
560 | /* Represents something we computed once and will use multiple times. | |
561 | First operand is that expression. Second is the RTL, | |
562 | nonzero only after the expression has been computed. | |
563 | TREE_UNSIGNED in a SAVE_EXPR is nonzero if that SAVE_EXPR | |
564 | has been seen already in assign_vars_1. */ | |
565 | DEFTREECODE (SAVE_EXPR, "save_expr", "e", 2) | |
566 | ||
567 | /* Represents something whose RTL has already been expanded | |
568 | as a sequence which should be emitted when this expression is expanded. | |
569 | The first operand is the RTL to emit. It is the first of a chain of insns. | |
570 | The second is the RTL expression for the result. */ | |
571 | DEFTREECODE (RTL_EXPR, "rtl_expr", "e", 2) | |
572 | ||
573 | /* & in C. Value is the address at which the operand's value resides. | |
574 | Operand may have any mode. Result mode is Pmode. */ | |
575 | DEFTREECODE (ADDR_EXPR, "addr_expr", "e", 1) | |
576 | ||
577 | /* Postfix & in C++. Value is a reference to the object which is the operand. | |
578 | Operand type is preserved, but we know that it is no longer | |
579 | an lvalue. */ | |
580 | DEFTREECODE (REFERENCE_EXPR, "reference_expr", "e", 1) | |
581 | ||
582 | /* A wrapper in C++. Operand 0 is the type that the wrapper | |
583 | belongs to (if non-virtual). Operand 1 is the function | |
584 | being wrapped. An anti-wrapper means do not wrap the function | |
585 | (if it would be wrapped by default). */ | |
586 | DEFTREECODE (WRAPPER_EXPR, "wrapper_expr", "e", 2) | |
587 | DEFTREECODE (ANTI_WRAPPER_EXPR, "anti_wrapper_expr", "e", 2) | |
588 | ||
589 | /* Operand is a function constant; result is a function variable value | |
590 | of typeEPmode. Used only for languages that need static chains. */ | |
591 | DEFTREECODE (ENTRY_VALUE_EXPR, "entry_value_expr", "e", 1) | |
592 | ||
593 | /* Given two real or integer operands of the same type, | |
594 | returns a complex value of the corresponding complex type. */ | |
595 | DEFTREECODE (COMPLEX_EXPR, "complex_expr", "e", 2) | |
596 | ||
597 | /* Complex conjugate of operand. Used only on complex types. | |
598 | The value has the same type as the operand. */ | |
599 | DEFTREECODE (CONJ_EXPR, "conj_expr", "e", 1) | |
600 | ||
601 | /* Used only on an operand of complex type, these return | |
602 | a value of the corresponding component type. */ | |
603 | DEFTREECODE (REALPART_EXPR, "realpart_expr", "e", 1) | |
604 | DEFTREECODE (IMAGPART_EXPR, "imagpart_expr", "e", 1) | |
605 | ||
606 | /* Nodes for ++ and -- in C. | |
607 | The second arg is how much to increment or decrement by. | |
608 | For a pointer, it would be the size of the object pointed to. */ | |
609 | DEFTREECODE (PREDECREMENT_EXPR, "predecrement_expr", "e", 2) | |
610 | DEFTREECODE (PREINCREMENT_EXPR, "preincrement_expr", "e", 2) | |
611 | DEFTREECODE (POSTDECREMENT_EXPR, "postdecrement_expr", "e", 2) | |
612 | DEFTREECODE (POSTINCREMENT_EXPR, "postincrement_expr", "e", 2) | |
613 | ||
614 | /* | |
615 | Local variables: | |
616 | mode:c | |
617 | version-control: t | |
618 | End: | |
619 | */ |