OSDN Git Service

* c.opt: Document more options.
[pf3gnuchains/gcc-fork.git] / gcc / treelang / treetree.c
1 /*
2
3     TREELANG Compiler back end interface (treetree.c)
4     Called by the parser.
5
6     If you want a working example of how to write a front end to GCC,
7     you are in the right place.
8
9     Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
10     1999, 2000, 2001, 2002, 2003, Free Software Foundation, Inc.
11
12     This code is based on toy.c written by Richard Kenner.
13
14     It was later modified by Jonathan Bartlett whose changes have all
15     been removed (by Tim Josling).
16
17     Various bits and pieces were cloned from the GCC main tree, as
18     GCC evolved, for COBOLForGCC, by Tim Josling.
19
20     It was adapted to TREELANG by Tim Josling 2001.
21
22     ---------------------------------------------------------------------------
23
24     This program is free software; you can redistribute it and/or modify it
25     under the terms of the GNU General Public License as published by the
26     Free Software Foundation; either version 2, or (at your option) any
27     later version.
28
29     This program is distributed in the hope that it will be useful,
30     but WITHOUT ANY WARRANTY; without even the implied warranty of
31     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32     GNU General Public License for more details.
33
34     You should have received a copy of the GNU General Public License
35     along with this program; if not, write to the Free Software
36     Foundation, 59 Temple Place - Suite 330,
37     Boston, MA 02111-1307, USA.
38
39     In other words, you are welcome to use, share and improve this program.
40     You are forbidden to forbid anyone else to use, share and improve
41     what you give them.   Help stamp out software-hoarding!
42
43     ---------------------------------------------------------------------------
44
45  */
46
47 /*
48   Assumption: garbage collection is never called implicitly.  It will
49   not be called 'at any time' when short of memory.  It will only be
50   called explicitly at the end of each function.  This removes the
51   need for a *lot* of bother to ensure everything is in the mark trees
52   at all times.  */
53
54   /* Note it is OK to use GCC extensions such as long long in a compiler front end.
55      This is because the GCC front ends are built using GCC. */
56
57 /* GCC headers.  */
58
59 #include "config.h"
60 #include "system.h"
61 #include "coretypes.h"
62 #include "tm.h"
63 #include "tree.h"
64 #include "flags.h"
65 #include "output.h"
66 #include "rtl.h"
67 #include "ggc.h"
68 #include "toplev.h"
69 #include "varray.h"
70 #include "langhooks-def.h"
71 #include "langhooks.h"
72 #include "target.h"
73
74 #include "treelang.h"
75 #include "treetree.h"
76 #include "opts.h"
77
78 extern int option_main;
79 extern char **file_names;
80
81 /* Types expected by gcc's garbage collector.
82    These types exist to allow language front-ends to
83    add extra information in gcc's parse tree data structure.
84    But the treelang front end doesn't use them -- it has
85    its own parse tree data structure.
86    We define them here only to satisfy gcc's garbage collector.  */
87
88 /* Language-specific identifier information.  */
89
90 struct lang_identifier GTY(())
91 {
92   struct tree_identifier common;
93 };
94
95 /* Language-specific tree node information.  */
96
97 union lang_tree_node 
98   GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE")))
99 {
100   union tree_node GTY ((tag ("0"), 
101                         desc ("tree_node_structure (&%h)"))) 
102     generic;
103   struct lang_identifier GTY ((tag ("1"))) identifier;
104 };
105
106 /* Language-specific type information.  */
107
108 struct lang_type GTY(())
109 {
110   char junk; /* dummy field to ensure struct is not empty */
111 };
112
113 /* Language-specific declaration information.  */
114
115 struct lang_decl GTY(())
116 {
117   char junk; /* dummy field to ensure struct is not empty */
118 };
119
120 struct language_function GTY(())
121 {
122   char junk; /* dummy field to ensure struct is not empty */
123 };
124
125 static tree tree_lang_truthvalue_conversion PARAMS((tree expr));
126 static bool tree_mark_addressable PARAMS((tree exp));
127 static tree tree_lang_type_for_size PARAMS((unsigned precision,
128                                             int unsignedp));
129 static tree tree_lang_type_for_mode PARAMS((enum machine_mode mode,
130                                             int unsignedp));
131 static tree tree_lang_unsigned_type PARAMS((tree type_node));
132 static tree tree_lang_signed_type PARAMS((tree type_node));
133 static tree tree_lang_signed_or_unsigned_type PARAMS((int unsignedp,
134                                                       tree type));
135
136 /* XXX these should be static */
137 void pushlevel PARAMS((int ignore));
138 tree poplevel PARAMS((int keep, int reverse, int functionbody));
139 int global_bindings_p PARAMS((void));
140 void insert_block PARAMS((tree block));
141 void set_block PARAMS((tree block));
142 tree pushdecl PARAMS((tree decl));
143 tree getdecls PARAMS((void));
144 int kept_level_p PARAMS((void));
145
146 static void tree_push_type_decl PARAMS((tree id, tree type_node));
147 static void tree_push_atomic_type_decl PARAMS((tree id, tree type_node));
148
149 /* The front end language hooks (addresses of code for this front
150    end).  These are not really very language-dependent, i.e.
151    treelang, C, Mercury, etc. can all use almost the same definitions.  */
152
153 #undef LANG_HOOKS_TRUTHVALUE_CONVERSION
154 #define LANG_HOOKS_TRUTHVALUE_CONVERSION tree_lang_truthvalue_conversion
155 #undef LANG_HOOKS_MARK_ADDRESSABLE
156 #define LANG_HOOKS_MARK_ADDRESSABLE tree_mark_addressable
157 #undef LANG_HOOKS_SIGNED_TYPE
158 #define LANG_HOOKS_SIGNED_TYPE tree_lang_signed_type
159 #undef LANG_HOOKS_UNSIGNED_TYPE
160 #define LANG_HOOKS_UNSIGNED_TYPE tree_lang_unsigned_type
161 #undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
162 #define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE tree_lang_signed_or_unsigned_type
163 #undef LANG_HOOKS_TYPE_FOR_MODE
164 #define LANG_HOOKS_TYPE_FOR_MODE tree_lang_type_for_mode
165 #undef LANG_HOOKS_TYPE_FOR_SIZE
166 #define LANG_HOOKS_TYPE_FOR_SIZE tree_lang_type_for_size
167 #undef LANG_HOOKS_PARSE_FILE
168 #define LANG_HOOKS_PARSE_FILE treelang_parse_file
169
170 /* Hook routines and data unique to treelang.  */
171
172 #undef LANG_HOOKS_INIT
173 #define LANG_HOOKS_INIT treelang_init
174 #undef LANG_HOOKS_NAME
175 #define LANG_HOOKS_NAME "GNU treelang"
176 #undef LANG_HOOKS_FINISH
177 #define LANG_HOOKS_FINISH               treelang_finish
178 #undef LANG_HOOKS_INIT_OPTIONS
179 #define LANG_HOOKS_INIT_OPTIONS  treelang_init_options
180 #undef LANG_HOOKS_HANDLE_OPTION
181 #define LANG_HOOKS_HANDLE_OPTION treelang_handle_option
182 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
183
184 /* Tree code type/name/code tables.  */
185
186 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
187
188 const char tree_code_type[] = {
189 #include "tree.def"
190   'x'
191 };
192 #undef DEFTREECODE
193
194 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
195
196 const unsigned char tree_code_length[] = {
197 #include "tree.def"
198   0
199 };
200 #undef DEFTREECODE
201
202 #define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
203
204 const char *const tree_code_name[] = {
205 #include "tree.def"
206   "@@dummy"
207 };
208 #undef DEFTREECODE
209
210 /* Number of bits in int and char - accessed by front end.  */
211
212 unsigned int tree_code_int_size = SIZEOF_INT * HOST_BITS_PER_CHAR;
213
214 unsigned int tree_code_char_size = HOST_BITS_PER_CHAR;
215
216 /* Return the tree stuff for this type TYPE_NUM.  */
217
218 tree
219 tree_code_get_type (int type_num)
220 {
221   switch (type_num)
222     {
223     case SIGNED_CHAR:
224       return signed_char_type_node;
225
226     case UNSIGNED_CHAR:
227       return unsigned_char_type_node;
228
229     case SIGNED_INT:
230       return integer_type_node;
231
232     case UNSIGNED_INT:
233       return unsigned_type_node;
234
235     case VOID_TYPE:
236       return void_type_node;
237
238     default:
239       abort ();
240     }
241 }
242
243 /* Output the code for the start of an if statement.  The test
244    expression is EXP (true if not zero), and the stmt occurred at line
245    LINENO in file FILENAME.  */
246
247 void
248 tree_code_if_start (tree exp, location_t loc)
249 {
250   tree cond_exp;
251   cond_exp = build (NE_EXPR,
252                  TREE_TYPE (exp),
253                  exp,
254                  build1 (CONVERT_EXPR, TREE_TYPE (exp), integer_zero_node));
255   emit_line_note (loc); /* Output the line number information.  */
256   expand_start_cond (cond_exp, /* Exit-able if nonzero.  */ 0);
257 }
258
259 /* Output the code for the else of an if statement.  The else occurred
260    at line LINENO in file FILENAME.  */
261
262 void
263 tree_code_if_else (location_t loc)
264 {
265   emit_line_note (loc); /* Output the line number information.  */
266   expand_start_else ();
267 }
268
269 /* Output the code for the end_if an if statement.  The end_if (final brace) occurred
270    at line LINENO in file FILENAME.  */
271
272 void
273 tree_code_if_end (location_t loc)
274 {
275   emit_line_note (loc); /* Output the line number information.  */
276   expand_end_cond ();
277 }
278
279 /* Create a function.  The prototype name is NAME, storage class is
280    STORAGE_CLASS, type of return variable is RET_TYPE, parameter lists
281    is PARMS, returns decl for this function.  */
282
283 tree
284 tree_code_create_function_prototype (unsigned char* chars,
285                                      unsigned int storage_class,
286                                      unsigned int ret_type,
287                                      struct prod_token_parm_item* parms,
288                                      location_t loc)
289 {
290
291   tree id;
292   struct prod_token_parm_item* parm;
293   tree type_list = NULL_TREE;
294   tree type_node;
295   tree fn_type;
296   tree fn_decl;
297
298   /* Build the type.  */
299   id = get_identifier ((const char*)chars);
300   for (parm = parms; parm; parm = parm->tp.par.next)
301     {
302       if (parm->category != parameter_category)
303         abort ();
304       type_node = get_type_for_numeric_type (parm->type);
305       type_list = tree_cons (NULL_TREE, type_node, type_list);
306     }
307   /* Last parm if void indicates fixed length list (as opposed to
308      printf style va_* list).  */
309   type_list = tree_cons (NULL_TREE, void_type_node, type_list);
310   /* The back end needs them in reverse order.  */
311   type_list = nreverse (type_list);
312
313   type_node = get_type_for_numeric_type (ret_type);
314   fn_type = build_function_type (type_node, type_list);
315
316   id = get_identifier ((const char*)chars);
317   fn_decl = build_decl (FUNCTION_DECL, id, fn_type);
318
319   DECL_CONTEXT (fn_decl) = NULL_TREE; /* Nested functions not supported here.  */
320   DECL_SOURCE_LOCATION (fn_decl) = loc;
321
322   TREE_USED (fn_decl) = 1;
323
324   /* Real name (optional).  */
325   SET_DECL_ASSEMBLER_NAME (fn_decl, DECL_NAME (fn_decl));
326
327   TREE_PUBLIC (fn_decl) = 0;
328   DECL_EXTERNAL (fn_decl) = 0;
329   TREE_STATIC (fn_decl) = 0;
330   switch (storage_class)
331     {
332     case STATIC_STORAGE:
333       TREE_PUBLIC (fn_decl) = 0;
334       break;
335
336     case EXTERNAL_DEFINITION_STORAGE:
337       TREE_PUBLIC (fn_decl) = 1;
338       TREE_STATIC (fn_decl) = 0;
339       DECL_EXTERNAL (fn_decl) = 0;
340       break;
341
342     case EXTERNAL_REFERENCE_STORAGE:
343       TREE_PUBLIC (fn_decl) = 0;
344       DECL_EXTERNAL (fn_decl) = 1;
345       break;
346
347
348     case AUTOMATIC_STORAGE:
349     default:
350       abort ();
351     }
352
353   /* Process declaration of function defined elsewhere.  */
354   rest_of_decl_compilation (fn_decl, NULL, 1, 0);
355
356   return fn_decl;
357 }
358
359
360 /* Output code for start of function; the decl of the function is in
361     PREV_SAVED (as created by tree_code_create_function_prototype),
362     the function is at line number LINENO in file FILENAME.  The
363     parameter details are in the lists PARMS. Returns nothing.  */
364 void
365 tree_code_create_function_initial (tree prev_saved,
366                                    location_t loc,
367                                    struct prod_token_parm_item* parms)
368 {
369   tree fn_decl;
370   tree param_decl;
371   tree next_param;
372   tree first_param;
373   tree parm_decl;
374   tree parm_list;
375   tree resultdecl;
376   struct prod_token_parm_item* this_parm;
377   struct prod_token_parm_item* parm;
378
379   fn_decl = prev_saved;
380   if (!fn_decl)
381     abort ();
382
383   /* Output message if not -quiet.  */
384   announce_function (fn_decl);
385
386   /* This has something to do with forcing output also.  */
387   pushdecl (fn_decl);
388
389   /* Set current function for error msgs etc.  */
390   current_function_decl = fn_decl;
391   DECL_INITIAL (fn_decl) = error_mark_node;
392
393   DECL_SOURCE_LOCATION (fn_decl) = loc;
394
395   /* Prepare creation of rtl for a new function.  */
396
397   resultdecl = DECL_RESULT (fn_decl) 
398     = build_decl (RESULT_DECL, NULL_TREE, TREE_TYPE (TREE_TYPE (fn_decl)));
399   DECL_CONTEXT (DECL_RESULT (fn_decl)) = fn_decl;
400   DECL_SOURCE_LOCATION (resultdecl) = loc;
401
402   /* Work out the size. ??? is this needed.  */
403   layout_decl (DECL_RESULT (fn_decl), 0);
404
405   /* Make the argument variable decls.  */
406   parm_list = NULL_TREE;
407   for (parm = parms; parm; parm = parm->tp.par.next)
408     {
409       parm_decl = build_decl (PARM_DECL, get_identifier
410                               ((const char*) (parm->tp.par.variable_name)),
411                               get_type_for_numeric_type (parm->type));
412
413       /* Some languages have different nominal and real types.  */
414       DECL_ARG_TYPE (parm_decl) = TREE_TYPE (parm_decl);
415       if (!DECL_ARG_TYPE (parm_decl))
416         abort ();
417       if (!fn_decl)
418         abort ();
419       DECL_CONTEXT (parm_decl) = fn_decl;
420       DECL_SOURCE_LOCATION (parm_decl) = loc;
421       parm_list = chainon (parm_decl, parm_list);
422     }
423
424   /* Back into reverse order as the back end likes them.  */
425   parm_list = nreverse (parm_list);
426
427   DECL_ARGUMENTS (fn_decl) = parm_list;
428
429   /* Save the decls for use when the args are referred to.  */
430   for (param_decl = DECL_ARGUMENTS (fn_decl),
431          this_parm = parms;
432        param_decl;
433        param_decl = TREE_CHAIN (param_decl),
434          this_parm = this_parm->tp.par.next)
435     {
436       if (!this_parm)
437         abort (); /* Too few.  */
438       *this_parm->tp.par.where_to_put_var_tree = param_decl;
439     }
440   if (this_parm)
441     abort (); /* Too many.  */
442
443   /* Output the decl rtl (not the rtl for the function code).  ???.
444      If the function is not defined in this file, when should you
445      execute this?  */
446   make_decl_rtl (fn_decl, NULL);
447
448   init_function_start (fn_decl);
449
450   /* Create rtl for startup code of function, such as saving registers.  */
451
452   expand_function_start (fn_decl, 0);
453
454   /* Function.c requires a push at the start of the function. that
455      looks like a bug to me but let's make it happy.  */
456
457   (*lang_hooks.decls.pushlevel) (0);
458
459   /* Create rtl for the start of a new scope.  */
460
461   expand_start_bindings (2);
462
463   /* Put the parameters into the symbol table.  */
464
465   for (first_param = param_decl = nreverse (DECL_ARGUMENTS (fn_decl));
466        param_decl;
467        param_decl = next_param)
468     {
469       next_param = TREE_CHAIN (param_decl);
470       TREE_CHAIN (param_decl) = NULL;
471       /* layout_decl (param_decl, 0);  Already done in build_decl tej 13/4/2002.  */
472       pushdecl (param_decl);
473       if (DECL_CONTEXT (param_decl) != current_function_decl)
474         abort ();
475     }
476
477   /* Store back the PARM_DECL nodes.  They appear in the right order.  */
478   DECL_ARGUMENTS (fn_decl) = getdecls ();
479
480   /* Force it to be output, else may be solely inlined.  */
481   TREE_ADDRESSABLE (fn_decl) = 1;
482
483   /* Stop -O3 from deleting it.  */
484   TREE_USED (fn_decl) = 1;
485
486   /* Add a new level to the debugger symbol table.  */
487
488   (*lang_hooks.decls.pushlevel) (0);
489
490   /* Create rtl for the start of a new scope.  */
491
492   expand_start_bindings (0);
493
494   emit_line_note (loc); /* Output the line number information.  */
495 }
496
497 /* Wrapup a function contained in file FILENAME, ending at line LINENO.  */
498 void
499 tree_code_create_function_wrapup (location_t loc)
500 {
501   tree block;
502   tree fn_decl;
503
504   fn_decl = current_function_decl;
505
506   emit_line_note (loc); /* Output the line number information.  */
507
508   /* Get completely built level from debugger symbol table.  */
509
510   block = (*lang_hooks.decls.poplevel) (1, 0, 0);
511
512   /* Emit rtl for end of scope.  */
513
514   expand_end_bindings (block, 0, 1);
515
516   /* Emit rtl for end of function.  */
517
518   expand_function_end ();
519
520   /* Pop the level.  */
521
522   block = (*lang_hooks.decls.poplevel) (1, 0, 1);
523
524   /* And attach it to the function.  */
525
526   DECL_INITIAL (fn_decl) = block;
527
528   /* Emit rtl for end of scope.  */
529
530   expand_end_bindings (block, 0, 1);
531
532   /* Call optimization and convert optimized rtl to assembly code.  */
533
534   rest_of_compilation (fn_decl);
535
536   /* We are not inside of any scope now.  */
537
538   current_function_decl = NULL_TREE;
539 }
540
541 /*
542    Create a variable.
543
544    The storage class is STORAGE_CLASS (eg LOCAL).
545    The name is CHARS/LENGTH.
546    The type is EXPRESSION_TYPE (eg UNSIGNED_TYPE).
547    The init tree is INIT.
548 */
549
550 tree
551 tree_code_create_variable (unsigned int storage_class,
552                            unsigned char* chars,
553                            unsigned int length,
554                            unsigned int expression_type,
555                            tree init,
556                            location_t loc)
557 {
558   tree var_type;
559   tree var_id;
560   tree var_decl;
561
562   /* 1. Build the type.  */
563   var_type = get_type_for_numeric_type (expression_type);
564
565   /* 2. Build the name.  */
566   if (chars[length] != 0)
567     abort (); /* Should be null terminated.  */
568
569   var_id = get_identifier ((const char*)chars);
570
571   /* 3. Build the decl and set up init.  */
572   var_decl = build_decl (VAR_DECL, var_id, var_type);
573
574   /* 3a. Initialization.  */
575   if (init)
576     DECL_INITIAL (var_decl) = build1 (CONVERT_EXPR, var_type, init);
577   else
578     DECL_INITIAL (var_decl) = NULL_TREE;
579
580   /* 4. Compute size etc.  */
581   layout_decl (var_decl, 0);
582
583   if (TYPE_SIZE (var_type) == 0)
584     abort (); /* Did not calculate size.  */
585
586   DECL_CONTEXT (var_decl) = current_function_decl;
587
588   DECL_SOURCE_LOCATION (var_decl) = loc;
589
590   /* Set the storage mode and whether only visible in the same file.  */
591   switch (storage_class)
592     {
593     case STATIC_STORAGE:
594       TREE_STATIC (var_decl) = 1;
595       TREE_PUBLIC (var_decl) = 0;
596       break;
597
598     case AUTOMATIC_STORAGE:
599       TREE_STATIC (var_decl) = 0;
600       TREE_PUBLIC (var_decl) = 0;
601       break;
602
603     case EXTERNAL_DEFINITION_STORAGE:
604       TREE_STATIC (var_decl) = 0;
605       TREE_PUBLIC (var_decl) = 1;
606       break;
607
608     case EXTERNAL_REFERENCE_STORAGE:
609       DECL_EXTERNAL (var_decl) = 1;
610       TREE_PUBLIC (var_decl) = 0;
611       break;
612
613     default:
614       abort ();
615     }
616
617   /* This should really only be set if the variable is used.  */
618   TREE_USED (var_decl) = 1;
619
620   /* Expand declaration and initial value if any.  */
621
622   if (TREE_STATIC (var_decl))
623     rest_of_decl_compilation (var_decl, 0, 0, 0);
624   else
625     {
626       expand_decl (var_decl);
627       if (DECL_INITIAL (var_decl))
628         expand_decl_init (var_decl);
629     }
630
631   return pushdecl (copy_node (var_decl));
632
633 }
634
635
636 /* Generate code for return statement.  Type is in TYPE, expression
637    is in EXP if present.  */
638
639 void
640 tree_code_generate_return (tree type, tree exp)
641 {
642   tree setret;
643   tree param;
644
645   for (param = DECL_ARGUMENTS (current_function_decl);
646        param;
647        param = TREE_CHAIN (param))
648     {
649       if (DECL_CONTEXT (param) != current_function_decl)
650         abort ();
651     }
652
653   if (exp)
654     {
655       setret = build (MODIFY_EXPR, type, DECL_RESULT (current_function_decl),
656                      build1 (CONVERT_EXPR, type, exp));
657       TREE_SIDE_EFFECTS (setret) = 1;
658       TREE_USED (setret) = 1;
659       expand_expr_stmt (setret);
660     }
661   expand_return (DECL_RESULT (current_function_decl));
662 }
663
664 /* Output the code for this expression statement CODE.  */
665
666
667 void
668 tree_code_output_expression_statement (tree code, location_t loc)
669 {
670   /* Output the line number information.  */
671   emit_line_note (loc);
672   TREE_USED (code) = 1;
673   TREE_SIDE_EFFECTS (code) = 1;
674   expand_expr_stmt (code);
675 }
676
677 /* Return a tree for a constant integer value in the token TOK.  No
678    size checking is done.  */
679
680 tree
681 tree_code_get_integer_value (unsigned char* chars, unsigned int length)
682 {
683   long long int val = 0;
684   unsigned int ix;
685   unsigned int start = 0;
686   int negative = 1;
687   switch (chars[0])
688     {
689     case (unsigned char)'-':
690       negative = -1;
691       start = 1;
692       break;
693
694     case (unsigned char)'+':
695       start = 1;
696       break;
697
698     default:
699       break;
700     }
701   for (ix = start; ix < length; ix++)
702     val = val * 10 + chars[ix] - (unsigned char)'0';
703   val = val*negative;
704   return build_int_2 (val & 0xffffffff, (val >> 32) & 0xffffffff);
705 }
706
707 /* Return the tree for an expresssion, type EXP_TYPE (see treetree.h)
708    with tree type TYPE and with operands1 OP1, OP2 (maybe), OP3 (maybe).  */
709 tree
710 tree_code_get_expression (unsigned int exp_type,
711                           tree type, tree op1, tree op2, tree op3 ATTRIBUTE_UNUSED)
712 {
713   tree ret1;
714   int operator;
715
716   switch (exp_type)
717     {
718     case EXP_ASSIGN:
719       if (!op1 || !op2)
720         abort ();
721       operator = MODIFY_EXPR;
722       ret1 = build (operator, type,
723                  op1,
724                  build1 (CONVERT_EXPR, type, op2));
725
726       break;
727
728     case EXP_PLUS:
729       operator = PLUS_EXPR;
730       goto binary_expression;
731
732     case EXP_MINUS:
733       operator = MINUS_EXPR;
734       goto binary_expression;
735
736     case EXP_EQUALS:
737       operator = EQ_EXPR;
738       goto binary_expression;
739
740       /* Expand a binary expression.  Ensure the operands are the right type.  */
741     binary_expression:
742       if (!op1 || !op2)
743         abort ();
744       ret1  =  build (operator, type,
745                    build1 (CONVERT_EXPR, type, op1),
746                    build1 (CONVERT_EXPR, type, op2));
747       break;
748
749       /* Reference to a variable.  This is dead easy, just return the
750          decl for the variable.  If the TYPE is different than the
751          variable type, convert it.  */
752     case EXP_REFERENCE:
753       if (!op1)
754         abort ();
755       if (type == TREE_TYPE (op1))
756         ret1 = op1;
757       else
758         ret1 = build1 (CONVERT_EXPR, type, op1);
759       break;
760
761     case EXP_FUNCTION_INVOCATION:
762       if (!op1 || !op2)
763         abort ();
764       {
765         tree fun_ptr;
766         fun_ptr = build1 (ADDR_EXPR, build_pointer_type (type), op1);
767         ret1 = build (CALL_EXPR, type, fun_ptr, nreverse (op2));
768       }
769       break;
770
771     default:
772       abort ();
773     }
774
775   return ret1;
776 }
777
778 /* Init parameter list and return empty list.  */
779
780 tree
781 tree_code_init_parameters (void)
782 {
783   return NULL_TREE;
784 }
785
786 /* Add a parameter EXP whose expression type is EXP_PROTO to list
787    LIST, returning the new list.  */
788
789 tree
790 tree_code_add_parameter (tree list, tree proto_exp, tree exp)
791 {
792   tree new_exp;
793   new_exp = tree_cons (NULL_TREE,
794                     build1 (CONVERT_EXPR, TREE_TYPE (proto_exp), exp),
795                     NULL_TREE);
796   if (!list)
797     return new_exp;
798   return chainon (new_exp, list);
799 }
800
801 /* Get the tree type for this type whose number is NUMERIC_TYPE.  */
802
803 tree
804 get_type_for_numeric_type (unsigned int numeric_type)
805 {
806
807   int size1;
808   int sign1;
809   switch (numeric_type)
810     {
811     case VOID_TYPE:
812       return void_type_node;
813
814     case SIGNED_INT:
815       size1 = tree_code_int_size;
816       sign1 = 1;
817       break;
818
819     case UNSIGNED_INT:
820       size1 = tree_code_int_size;
821       sign1 = 0;
822       break;
823
824     case SIGNED_CHAR:
825       size1 = tree_code_char_size;
826       sign1 = 1;
827       break;
828
829     case UNSIGNED_CHAR:
830       size1 = tree_code_char_size;
831       sign1 = 0;
832       break;
833
834     default:
835       abort ();
836     }
837
838   return tree_code_get_numeric_type (size1, sign1);
839
840 }
841
842 /* Return tree representing a numeric type of size SIZE1 bits and
843    signed if SIGN1 !=  0.  */
844 tree
845 tree_code_get_numeric_type (unsigned int size1, unsigned int sign1)
846 {
847   tree ret1;
848   if (!size1)
849     abort ();
850   if (size1 == tree_code_int_size)
851     {
852       if (sign1)
853         ret1 = integer_type_node;
854       else
855         ret1 = unsigned_type_node;
856     }
857   else
858     if (size1 == tree_code_char_size)
859       {
860         if (sign1)
861           ret1 = signed_char_type_node;
862         else
863           ret1 = unsigned_char_type_node;
864       }
865     else
866       abort ();
867
868   return ret1;
869 }
870
871 /* Get a stringpool entry for a string S of length L.  This is needed
872    because the GTY routines don't mark strings, forcing you to put
873    them into stringpool, which is never freed.  */
874
875 const char*
876 get_string (const char *s, size_t l)
877 {
878   tree t;
879   t = get_identifier_with_length (s, l);
880   return IDENTIFIER_POINTER(t);
881 }
882   
883 /* Save typing debug_tree all the time. Dump a tree T pretty and
884    concise.  */
885
886 void dt (tree t);
887
888 void
889 dt (tree t)
890 {
891   debug_tree (t);
892 }
893
894 /* Routines Expected by gcc:  */
895
896 /* These are used to build types for various sizes.  The code below
897    is a simplified version of that of GNAT.  */
898
899 #ifndef MAX_BITS_PER_WORD
900 #define MAX_BITS_PER_WORD  BITS_PER_WORD
901 #endif
902
903 /* This variable keeps a table for types for each precision so that we only 
904    allocate each of them once. Signed and unsigned types are kept separate.  */
905 static GTY(()) tree signed_and_unsigned_types[MAX_BITS_PER_WORD + 1][2];
906
907 /* XXX is this definition OK? */
908 static tree
909 tree_lang_truthvalue_conversion (expr)
910      tree expr;
911 {
912   return expr;
913 }
914
915 /* Mark EXP saying that we need to be able to take the
916    address of it; it should not be allocated in a register.
917    Value is 1 if successful.  
918    
919    This implementation was copied from c-decl.c. */
920
921 static bool
922 tree_mark_addressable (exp)
923      tree exp;
924 {
925   register tree x = exp;
926   while (1)
927     switch (TREE_CODE (x))
928       {
929       case COMPONENT_REF:
930       case ADDR_EXPR:
931       case ARRAY_REF:
932       case REALPART_EXPR:
933       case IMAGPART_EXPR:
934         x = TREE_OPERAND (x, 0);
935         break;
936   
937       case CONSTRUCTOR:
938         TREE_ADDRESSABLE (x) = 1;
939         return 1;
940
941       case VAR_DECL:
942       case CONST_DECL:
943       case PARM_DECL:
944       case RESULT_DECL:
945         if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
946             && DECL_NONLOCAL (x))
947           {
948             if (TREE_PUBLIC (x))
949               {
950                 error ("global register variable `%s' used in nested function",
951                        IDENTIFIER_POINTER (DECL_NAME (x)));
952                 return 0;
953               }
954             pedwarn ("register variable `%s' used in nested function",
955                      IDENTIFIER_POINTER (DECL_NAME (x)));
956           }
957         else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x))
958           {
959             if (TREE_PUBLIC (x))
960               {
961                 error ("address of global register variable `%s' requested",
962                        IDENTIFIER_POINTER (DECL_NAME (x)));
963                 return 0;
964               }
965
966             pedwarn ("address of register variable `%s' requested",
967                      IDENTIFIER_POINTER (DECL_NAME (x)));
968           }
969         put_var_into_stack (x, /*rescan=*/ true);
970
971         /* drops in */
972       case FUNCTION_DECL:
973         TREE_ADDRESSABLE (x) = 1;
974
975       default:
976         return 1;
977     }
978 }
979   
980 /* Return an integer type with the number of bits of precision given by  
981    PRECISION.  UNSIGNEDP is nonzero if the type is unsigned; otherwise
982    it is a signed type.  */
983   
984 static tree
985 tree_lang_type_for_size (precision, unsignedp)
986      unsigned precision;
987      int unsignedp;
988 {
989   tree t;
990
991   if (precision <= MAX_BITS_PER_WORD
992       && signed_and_unsigned_types[precision][unsignedp] != 0)
993     return signed_and_unsigned_types[precision][unsignedp];
994
995   if (unsignedp)
996     t = signed_and_unsigned_types[precision][1]
997       = make_unsigned_type (precision);
998   else
999     t = signed_and_unsigned_types[precision][0]
1000       = make_signed_type (precision);
1001   
1002   return t;
1003 }
1004
1005 /* Return a data type that has machine mode MODE.  UNSIGNEDP selects
1006    an unsigned type; otherwise a signed type is returned.  */
1007
1008 static tree
1009 tree_lang_type_for_mode (mode, unsignedp)
1010      enum machine_mode mode;
1011      int unsignedp;
1012 {
1013   return tree_lang_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
1014 }
1015
1016 /* Return the unsigned version of a TYPE_NODE, a scalar type.  */
1017
1018 static tree
1019 tree_lang_unsigned_type (type_node)
1020      tree type_node;
1021 {
1022   return tree_lang_type_for_size (TYPE_PRECISION (type_node), 1);
1023 }
1024
1025 /* Return the signed version of a TYPE_NODE, a scalar type.  */
1026
1027 static tree
1028 tree_lang_signed_type (type_node)
1029      tree type_node;
1030 {
1031   return tree_lang_type_for_size (TYPE_PRECISION (type_node), 0);
1032 }
1033
1034 /* Return a type the same as TYPE except unsigned or signed according to
1035    UNSIGNEDP.  */
1036
1037 static tree
1038 tree_lang_signed_or_unsigned_type (unsignedp, type)
1039      int unsignedp;
1040      tree type;
1041 {
1042   if (! INTEGRAL_TYPE_P (type) || TREE_UNSIGNED (type) == unsignedp)
1043     return type;
1044   else
1045     return tree_lang_type_for_size (TYPE_PRECISION (type), unsignedp);
1046 }
1047 \f
1048 /* These functions and variables deal with binding contours.  We only
1049    need these functions for the list of PARM_DECLs, but we leave the
1050    functions more general; these are a simplified version of the
1051    functions from GNAT.  */
1052
1053 /* For each binding contour we allocate a binding_level structure which records
1054    the entities defined or declared in that contour. Contours include:
1055
1056         the global one
1057         one for each subprogram definition
1058         one for each compound statement (declare block)
1059
1060    Binding contours are used to create GCC tree BLOCK nodes.  */
1061
1062 struct binding_level
1063 {
1064   /* A chain of ..._DECL nodes for all variables, constants, functions,
1065      parameters and type declarations.  These ..._DECL nodes are chained
1066      through the TREE_CHAIN field. Note that these ..._DECL nodes are stored
1067      in the reverse of the order supplied to be compatible with the
1068      back-end.  */
1069   tree names;
1070   /* For each level (except the global one), a chain of BLOCK nodes for all
1071      the levels that were entered and exited one level down from this one.  */
1072   tree blocks;
1073   /* The back end may need, for its own internal processing, to create a BLOCK
1074      node. This field is set aside for this purpose. If this field is non-null
1075      when the level is popped, i.e. when poplevel is invoked, we will use such
1076      block instead of creating a new one from the 'names' field, that is the
1077      ..._DECL nodes accumulated so far.  Typically the routine 'pushlevel'
1078      will be called before setting this field, so that if the front-end had
1079      inserted ..._DECL nodes in the current block they will not be lost.   */
1080   tree block_created_by_back_end;
1081   /* The binding level containing this one (the enclosing binding level). */
1082   struct binding_level *level_chain;
1083 };
1084
1085 /* The binding level currently in effect.  */
1086 static struct binding_level *current_binding_level = NULL;
1087
1088 /* The outermost binding level. This binding level is created when the
1089    compiler is started and it will exist through the entire compilation.  */
1090 static struct binding_level *global_binding_level;
1091
1092 /* Binding level structures are initialized by copying this one.  */
1093 static struct binding_level clear_binding_level = {NULL, NULL, NULL, NULL};
1094 \f
1095 /* Return non-zero if we are currently in the global binding level.  */
1096
1097 int
1098 global_bindings_p ()
1099 {
1100   return current_binding_level == global_binding_level ? -1 : 0;
1101 }
1102
1103 /* Return the list of declarations in the current level. Note that this list
1104    is in reverse order (it has to be so for back-end compatibility).  */
1105
1106 tree
1107 getdecls ()
1108 {
1109   return current_binding_level->names;
1110 }
1111
1112 /* Nonzero if the current level needs to have a BLOCK made.  */
1113
1114 int
1115 kept_level_p ()
1116 {
1117   return (current_binding_level->names != 0);
1118 }
1119
1120 /* Enter a new binding level. The input parameter is ignored, but has to be
1121    specified for back-end compatibility.  */
1122
1123 void
1124 pushlevel (ignore)
1125      int ignore ATTRIBUTE_UNUSED;
1126 {
1127   struct binding_level *newlevel
1128     = (struct binding_level *) xmalloc (sizeof (struct binding_level));
1129
1130   *newlevel = clear_binding_level;
1131
1132   /* Add this level to the front of the chain (stack) of levels that are
1133      active.  */
1134   newlevel->level_chain = current_binding_level;
1135   current_binding_level = newlevel;
1136 }
1137
1138 /* Exit a binding level.
1139    Pop the level off, and restore the state of the identifier-decl mappings
1140    that were in effect when this level was entered.
1141
1142    If KEEP is nonzero, this level had explicit declarations, so
1143    and create a "block" (a BLOCK node) for the level
1144    to record its declarations and subblocks for symbol table output.
1145
1146    If FUNCTIONBODY is nonzero, this level is the body of a function,
1147    so create a block as if KEEP were set and also clear out all
1148    label names.
1149
1150    If REVERSE is nonzero, reverse the order of decls before putting
1151    them into the BLOCK.  */
1152
1153 tree
1154 poplevel (keep, reverse, functionbody)
1155      int keep;
1156      int reverse;
1157      int functionbody;
1158 {
1159   /* Points to a BLOCK tree node. This is the BLOCK node construted for the
1160      binding level that we are about to exit and which is returned by this
1161      routine.  */
1162   tree block_node = NULL_TREE;
1163   tree decl_chain;
1164   tree subblock_chain = current_binding_level->blocks;
1165   tree subblock_node;
1166   tree block_created_by_back_end;
1167
1168   /* Reverse the list of *_DECL nodes if desired.  Note that the ..._DECL
1169      nodes chained through the `names' field of current_binding_level are in
1170      reverse order except for PARM_DECL node, which are explicitely stored in
1171      the right order.  */
1172   decl_chain = (reverse) ? nreverse (current_binding_level->names)
1173                          : current_binding_level->names;
1174
1175   block_created_by_back_end = current_binding_level->block_created_by_back_end;
1176   if (block_created_by_back_end != 0)
1177     {
1178       block_node = block_created_by_back_end;
1179
1180       /* Check if we are about to discard some information that was gathered
1181          by the front-end. Nameley check if the back-end created a new block 
1182          without calling pushlevel first. To understand why things are lost
1183          just look at the next case (i.e. no block created by back-end.  */
1184       if ((keep || functionbody) && (decl_chain || subblock_chain))
1185         abort ();
1186     }
1187
1188   /* If there were any declarations in the current binding level, or if this
1189      binding level is a function body, or if there are any nested blocks then
1190      create a BLOCK node to record them for the life of this function.  */
1191   else if (keep || functionbody)
1192     block_node = build_block (keep ? decl_chain : 0, 0, subblock_chain, 0, 0);
1193
1194   /* Record the BLOCK node just built as the subblock its enclosing scope.  */
1195   for (subblock_node = subblock_chain; subblock_node;
1196        subblock_node = TREE_CHAIN (subblock_node))
1197     BLOCK_SUPERCONTEXT (subblock_node) = block_node;
1198
1199   /* Clear out the meanings of the local variables of this level.  */
1200
1201   for (subblock_node = decl_chain; subblock_node;
1202        subblock_node = TREE_CHAIN (subblock_node))
1203     if (DECL_NAME (subblock_node) != 0)
1204       /* If the identifier was used or addressed via a local extern decl,  
1205          don't forget that fact.   */
1206       if (DECL_EXTERNAL (subblock_node))
1207         {
1208           if (TREE_USED (subblock_node))
1209             TREE_USED (DECL_NAME (subblock_node)) = 1;
1210           if (TREE_ADDRESSABLE (subblock_node))
1211             TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (subblock_node)) = 1;
1212         }
1213
1214   /* Pop the current level.  */
1215   current_binding_level = current_binding_level->level_chain;
1216
1217   if (functionbody)
1218     {
1219       /* This is the top level block of a function. The ..._DECL chain stored
1220          in BLOCK_VARS are the function's parameters (PARM_DECL nodes). Don't
1221          leave them in the BLOCK because they are found in the FUNCTION_DECL
1222          instead.  */
1223       DECL_INITIAL (current_function_decl) = block_node;
1224       BLOCK_VARS (block_node) = 0;
1225     }
1226   else if (block_node)
1227     {
1228       if (block_created_by_back_end == NULL)
1229         current_binding_level->blocks
1230           = chainon (current_binding_level->blocks, block_node);
1231     }
1232
1233   /* If we did not make a block for the level just exited, any blocks made for
1234      inner levels (since they cannot be recorded as subblocks in that level)
1235      must be carried forward so they will later become subblocks of something
1236      else.  */
1237   else if (subblock_chain)
1238     current_binding_level->blocks
1239       = chainon (current_binding_level->blocks, subblock_chain);
1240   if (block_node)
1241     TREE_USED (block_node) = 1;
1242
1243   return block_node;
1244 }
1245 \f
1246 /* Insert BLOCK at the end of the list of subblocks of the
1247    current binding level.  This is used when a BIND_EXPR is expanded,
1248    to handle the BLOCK node inside the BIND_EXPR.  */
1249
1250 void
1251 insert_block (block)
1252      tree block;
1253 {
1254   TREE_USED (block) = 1;
1255   current_binding_level->blocks
1256     = chainon (current_binding_level->blocks, block);
1257 }
1258
1259 /* Set the BLOCK node for the innermost scope
1260    (the one we are currently in).  */
1261
1262 void
1263 set_block (block)
1264      tree block;
1265 {
1266   current_binding_level->block_created_by_back_end = block;
1267 }
1268
1269 /* Records a ..._DECL node DECL as belonging to the current lexical scope.
1270    Returns the ..._DECL node. */
1271
1272 tree
1273 pushdecl (decl)
1274      tree decl;
1275 {
1276   /* External objects aren't nested, other objects may be.  */
1277     
1278   if ((DECL_EXTERNAL (decl)) || (decl==current_function_decl))
1279     DECL_CONTEXT (decl) = 0;
1280   else
1281     DECL_CONTEXT (decl) = current_function_decl;
1282
1283   /* Put the declaration on the list.  The list of declarations is in reverse
1284      order. The list will be reversed later if necessary.  This needs to be
1285      this way for compatibility with the back-end.  */
1286
1287   TREE_CHAIN (decl) = current_binding_level->names;
1288   current_binding_level->names = decl;
1289
1290   /* For the declartion of a type, set its name if it is not already set. */
1291
1292   if (TREE_CODE (decl) == TYPE_DECL
1293       && TYPE_NAME (TREE_TYPE (decl)) == 0)
1294     TYPE_NAME (TREE_TYPE (decl)) = DECL_NAME (decl);
1295
1296   return decl;
1297 }
1298 \f
1299
1300 static void
1301 tree_push_type_decl(id, type_node)
1302      tree id;
1303      tree type_node;
1304 {
1305   tree decl = build_decl (TYPE_DECL, id, type_node);
1306   TYPE_NAME (type_node) = decl;
1307   TYPE_STUB_DECL (type_node) = decl;
1308   pushdecl (decl);
1309 }
1310
1311 /* push_atomic_type_decl() ensures that the type's type is itself. 
1312    Needed for DBX.  Must only be used for atomic types,
1313    not for e.g. pointer or array types.  */
1314
1315 static void
1316 tree_push_atomic_type_decl(id, type_node)
1317      tree id;
1318      tree type_node;
1319 {
1320   TREE_TYPE (type_node) = type_node;
1321   tree_push_type_decl (id, type_node);
1322 }
1323
1324 #define NULL_BINDING_LEVEL (struct binding_level *) NULL                        
1325
1326 /* Create the predefined scalar types of C,
1327    and some nodes representing standard constants (0, 1, (void *) 0).
1328    Initialize the global binding level.
1329    Make definitions for built-in primitive functions.  */
1330
1331 void
1332 treelang_init_decl_processing ()
1333 {
1334   current_function_decl = NULL;
1335   current_binding_level = NULL_BINDING_LEVEL;
1336   pushlevel (0);        /* make the binding_level structure for global names */
1337   global_binding_level = current_binding_level;
1338
1339   build_common_tree_nodes (flag_signed_char);
1340
1341   /* set standard type names */
1342
1343   /* Define `int' and `char' first so that dbx will output them first.  */
1344
1345   tree_push_atomic_type_decl (get_identifier ("int"), integer_type_node);
1346   tree_push_atomic_type_decl (get_identifier ("char"), char_type_node);
1347   tree_push_atomic_type_decl (get_identifier ("long int"),
1348                               long_integer_type_node);
1349   tree_push_atomic_type_decl (get_identifier ("unsigned int"),
1350                               unsigned_type_node);
1351   tree_push_atomic_type_decl (get_identifier ("long unsigned int"),
1352                               long_unsigned_type_node);
1353   tree_push_atomic_type_decl (get_identifier ("long long int"),
1354                               long_long_integer_type_node);
1355   tree_push_atomic_type_decl (get_identifier ("long long unsigned int"),
1356                               long_long_unsigned_type_node);
1357   tree_push_atomic_type_decl (get_identifier ("short int"),
1358                               short_integer_type_node);
1359   tree_push_atomic_type_decl (get_identifier ("short unsigned int"),
1360                               short_unsigned_type_node);
1361   tree_push_atomic_type_decl (get_identifier ("signed char"),
1362                               signed_char_type_node);
1363   tree_push_atomic_type_decl (get_identifier ("unsigned char"),
1364                               unsigned_char_type_node);
1365   tree_push_atomic_type_decl (NULL_TREE, intQI_type_node);
1366   tree_push_atomic_type_decl (NULL_TREE, intHI_type_node);
1367   tree_push_atomic_type_decl (NULL_TREE, intSI_type_node);
1368   tree_push_atomic_type_decl (NULL_TREE, intDI_type_node);
1369 #if HOST_BITS_PER_WIDE_INT >= 64
1370   tree_push_atomic_type_decl (NULL_TREE, intTI_type_node);
1371 #endif
1372   tree_push_atomic_type_decl (NULL_TREE, unsigned_intQI_type_node);
1373   tree_push_atomic_type_decl (NULL_TREE, unsigned_intHI_type_node);
1374   tree_push_atomic_type_decl (NULL_TREE, unsigned_intSI_type_node);
1375   tree_push_atomic_type_decl (NULL_TREE, unsigned_intDI_type_node);
1376 #if HOST_BITS_PER_WIDE_INT >= 64
1377   tree_push_atomic_type_decl (NULL_TREE, unsigned_intTI_type_node);
1378 #endif
1379   
1380   size_type_node = make_unsigned_type (POINTER_SIZE);
1381   tree_push_atomic_type_decl (get_identifier ("size_t"), size_type_node);
1382   set_sizetype (size_type_node);
1383
1384   build_common_tree_nodes_2 (/* short_double= */ 0);
1385
1386   tree_push_atomic_type_decl (get_identifier ("float"), float_type_node);
1387   tree_push_atomic_type_decl (get_identifier ("double"), double_type_node);
1388   tree_push_atomic_type_decl (get_identifier ("long double"), long_double_type_node);
1389   tree_push_atomic_type_decl (get_identifier ("void"), void_type_node);
1390
1391   /* Add any target-specific builtin functions.  */
1392   (*targetm.init_builtins) ();
1393
1394   pedantic_lvalues = pedantic;
1395 }
1396
1397 /* Return a definition for a builtin function named NAME and whose data type
1398    is TYPE.  TYPE should be a function type with argument types.
1399    FUNCTION_CODE tells later passes how to compile calls to this function.
1400    See tree.h for its possible values.
1401
1402    If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME,
1403    the name to be called if we can't opencode the function.  If
1404    ATTRS is nonzero, use that for the function's attribute list.
1405
1406    copied from gcc/c-decl.c
1407 */
1408
1409 tree
1410 builtin_function (name, type, function_code, class, library_name, attrs)
1411      const char *name;
1412      tree type;
1413      int function_code;
1414      enum built_in_class class;
1415      const char *library_name;
1416      tree attrs;
1417 {
1418   tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
1419   DECL_EXTERNAL (decl) = 1;
1420   TREE_PUBLIC (decl) = 1;
1421   if (library_name)
1422     SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
1423   make_decl_rtl (decl, NULL);
1424   pushdecl (decl);
1425   DECL_BUILT_IN_CLASS (decl) = class;
1426   DECL_FUNCTION_CODE (decl) = function_code;
1427
1428   /* Possibly apply some default attributes to this built-in function.  */
1429   if (attrs)
1430     decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
1431   else
1432     decl_attributes (&decl, NULL_TREE, 0);
1433
1434   return decl;
1435 }
1436
1437 #include "debug.h" /* for debug_hooks, needed by gt-treelang-treetree.h */
1438 #include "gt-treelang-treetree.h"