2 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
3 Free Software Foundation, Inc.
4 Contributed by Steven Bosscher
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
23 /* Actually this is just a collection of routines that used to be
24 scattered around the sources. Now that they are all in a single
25 file, almost all of them can be static, and the other files don't
26 have this mess in them.
28 As a nice side-effect, this file can act as documentation of the
29 gfc_code and gfc_expr structures and all their friends and
37 #include "constructor.h"
39 /* Keep track of indentation for symbol tree dumps. */
40 static int show_level = 0;
42 /* The file handle we're dumping to is kept in a static variable. This
43 is not too cool, but it avoids a lot of passing it around. */
44 static FILE *dumpfile;
46 /* Forward declaration of some of the functions. */
47 static void show_expr (gfc_expr *p);
48 static void show_code_node (int, gfc_code *);
49 static void show_namespace (gfc_namespace *ns);
52 /* Allow dumping of an expression in the debugger. */
53 void gfc_debug_expr (gfc_expr *);
56 gfc_debug_expr (gfc_expr *e)
61 fputc ('\n', dumpfile);
66 /* Do indentation for a specific level. */
69 code_indent (int level, gfc_st_label *label)
74 fprintf (dumpfile, "%-5d ", label->value);
76 for (i = 0; i < (2 * level - (label ? 6 : 0)); i++)
77 fputc (' ', dumpfile);
81 /* Simple indentation at the current level. This one
82 is used to show symbols. */
87 fputc ('\n', dumpfile);
88 code_indent (show_level, NULL);
92 /* Show type-specific information. */
95 show_typespec (gfc_typespec *ts)
97 fprintf (dumpfile, "(%s ", gfc_basic_typename (ts->type));
103 fprintf (dumpfile, "%s", ts->u.derived->name);
107 show_expr (ts->u.cl->length);
108 fprintf(dumpfile, " %d", ts->kind);
112 fprintf (dumpfile, "%d", ts->kind);
116 fputc (')', dumpfile);
120 /* Show an actual argument list. */
123 show_actual_arglist (gfc_actual_arglist *a)
125 fputc ('(', dumpfile);
127 for (; a; a = a->next)
129 fputc ('(', dumpfile);
131 fprintf (dumpfile, "%s = ", a->name);
135 fputs ("(arg not-present)", dumpfile);
137 fputc (')', dumpfile);
139 fputc (' ', dumpfile);
142 fputc (')', dumpfile);
146 /* Show a gfc_array_spec array specification structure. */
149 show_array_spec (gfc_array_spec *as)
156 fputs ("()", dumpfile);
160 fprintf (dumpfile, "(%d [%d]", as->rank, as->corank);
162 if (as->rank + as->corank > 0)
166 case AS_EXPLICIT: c = "AS_EXPLICIT"; break;
167 case AS_DEFERRED: c = "AS_DEFERRED"; break;
168 case AS_ASSUMED_SIZE: c = "AS_ASSUMED_SIZE"; break;
169 case AS_ASSUMED_SHAPE: c = "AS_ASSUMED_SHAPE"; break;
171 gfc_internal_error ("show_array_spec(): Unhandled array shape "
174 fprintf (dumpfile, " %s ", c);
176 for (i = 0; i < as->rank + as->corank; i++)
178 show_expr (as->lower[i]);
179 fputc (' ', dumpfile);
180 show_expr (as->upper[i]);
181 fputc (' ', dumpfile);
185 fputc (')', dumpfile);
189 /* Show a gfc_array_ref array reference structure. */
192 show_array_ref (gfc_array_ref * ar)
196 fputc ('(', dumpfile);
201 fputs ("FULL", dumpfile);
205 for (i = 0; i < ar->dimen; i++)
207 /* There are two types of array sections: either the
208 elements are identified by an integer array ('vector'),
209 or by an index range. In the former case we only have to
210 print the start expression which contains the vector, in
211 the latter case we have to print any of lower and upper
212 bound and the stride, if they're present. */
214 if (ar->start[i] != NULL)
215 show_expr (ar->start[i]);
217 if (ar->dimen_type[i] == DIMEN_RANGE)
219 fputc (':', dumpfile);
221 if (ar->end[i] != NULL)
222 show_expr (ar->end[i]);
224 if (ar->stride[i] != NULL)
226 fputc (':', dumpfile);
227 show_expr (ar->stride[i]);
231 if (i != ar->dimen - 1)
232 fputs (" , ", dumpfile);
237 for (i = 0; i < ar->dimen; i++)
239 show_expr (ar->start[i]);
240 if (i != ar->dimen - 1)
241 fputs (" , ", dumpfile);
246 fputs ("UNKNOWN", dumpfile);
250 gfc_internal_error ("show_array_ref(): Unknown array reference");
253 fputc (')', dumpfile);
257 /* Show a list of gfc_ref structures. */
260 show_ref (gfc_ref *p)
262 for (; p; p = p->next)
266 show_array_ref (&p->u.ar);
270 fprintf (dumpfile, " %% %s", p->u.c.component->name);
274 fputc ('(', dumpfile);
275 show_expr (p->u.ss.start);
276 fputc (':', dumpfile);
277 show_expr (p->u.ss.end);
278 fputc (')', dumpfile);
282 gfc_internal_error ("show_ref(): Bad component code");
287 /* Display a constructor. Works recursively for array constructors. */
290 show_constructor (gfc_constructor_base base)
293 for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c))
295 if (c->iterator == NULL)
299 fputc ('(', dumpfile);
302 fputc (' ', dumpfile);
303 show_expr (c->iterator->var);
304 fputc ('=', dumpfile);
305 show_expr (c->iterator->start);
306 fputc (',', dumpfile);
307 show_expr (c->iterator->end);
308 fputc (',', dumpfile);
309 show_expr (c->iterator->step);
311 fputc (')', dumpfile);
314 if (gfc_constructor_next (c) != NULL)
315 fputs (" , ", dumpfile);
321 show_char_const (const gfc_char_t *c, int length)
325 fputc ('\'', dumpfile);
326 for (i = 0; i < length; i++)
329 fputs ("''", dumpfile);
331 fputs (gfc_print_wide_char (c[i]), dumpfile);
333 fputc ('\'', dumpfile);
337 /* Show a component-call expression. */
340 show_compcall (gfc_expr* p)
342 gcc_assert (p->expr_type == EXPR_COMPCALL);
344 fprintf (dumpfile, "%s", p->symtree->n.sym->name);
346 fprintf (dumpfile, "%s", p->value.compcall.name);
348 show_actual_arglist (p->value.compcall.actual);
352 /* Show an expression. */
355 show_expr (gfc_expr *p)
362 fputs ("()", dumpfile);
366 switch (p->expr_type)
369 show_char_const (p->value.character.string, p->value.character.length);
374 fprintf (dumpfile, "%s(", p->ts.u.derived->name);
375 show_constructor (p->value.constructor);
376 fputc (')', dumpfile);
380 fputs ("(/ ", dumpfile);
381 show_constructor (p->value.constructor);
382 fputs (" /)", dumpfile);
388 fputs ("NULL()", dumpfile);
395 mpz_out_str (stdout, 10, p->value.integer);
397 if (p->ts.kind != gfc_default_integer_kind)
398 fprintf (dumpfile, "_%d", p->ts.kind);
402 if (p->value.logical)
403 fputs (".true.", dumpfile);
405 fputs (".false.", dumpfile);
409 mpfr_out_str (stdout, 10, 0, p->value.real, GFC_RND_MODE);
410 if (p->ts.kind != gfc_default_real_kind)
411 fprintf (dumpfile, "_%d", p->ts.kind);
415 show_char_const (p->value.character.string,
416 p->value.character.length);
420 fputs ("(complex ", dumpfile);
422 mpfr_out_str (stdout, 10, 0, mpc_realref (p->value.complex),
424 if (p->ts.kind != gfc_default_complex_kind)
425 fprintf (dumpfile, "_%d", p->ts.kind);
427 fputc (' ', dumpfile);
429 mpfr_out_str (stdout, 10, 0, mpc_imagref (p->value.complex),
431 if (p->ts.kind != gfc_default_complex_kind)
432 fprintf (dumpfile, "_%d", p->ts.kind);
434 fputc (')', dumpfile);
438 fprintf (dumpfile, "%dH", p->representation.length);
439 c = p->representation.string;
440 for (i = 0; i < p->representation.length; i++, c++)
442 fputc (*c, dumpfile);
447 fputs ("???", dumpfile);
451 if (p->representation.string)
453 fputs (" {", dumpfile);
454 c = p->representation.string;
455 for (i = 0; i < p->representation.length; i++, c++)
457 fprintf (dumpfile, "%.2x", (unsigned int) *c);
458 if (i < p->representation.length - 1)
459 fputc (',', dumpfile);
461 fputc ('}', dumpfile);
467 if (p->symtree->n.sym->ns && p->symtree->n.sym->ns->proc_name)
468 fprintf (dumpfile, "%s:", p->symtree->n.sym->ns->proc_name->name);
469 fprintf (dumpfile, "%s", p->symtree->n.sym->name);
474 fputc ('(', dumpfile);
475 switch (p->value.op.op)
477 case INTRINSIC_UPLUS:
478 fputs ("U+ ", dumpfile);
480 case INTRINSIC_UMINUS:
481 fputs ("U- ", dumpfile);
484 fputs ("+ ", dumpfile);
486 case INTRINSIC_MINUS:
487 fputs ("- ", dumpfile);
489 case INTRINSIC_TIMES:
490 fputs ("* ", dumpfile);
492 case INTRINSIC_DIVIDE:
493 fputs ("/ ", dumpfile);
495 case INTRINSIC_POWER:
496 fputs ("** ", dumpfile);
498 case INTRINSIC_CONCAT:
499 fputs ("// ", dumpfile);
502 fputs ("AND ", dumpfile);
505 fputs ("OR ", dumpfile);
508 fputs ("EQV ", dumpfile);
511 fputs ("NEQV ", dumpfile);
514 case INTRINSIC_EQ_OS:
515 fputs ("= ", dumpfile);
518 case INTRINSIC_NE_OS:
519 fputs ("/= ", dumpfile);
522 case INTRINSIC_GT_OS:
523 fputs ("> ", dumpfile);
526 case INTRINSIC_GE_OS:
527 fputs (">= ", dumpfile);
530 case INTRINSIC_LT_OS:
531 fputs ("< ", dumpfile);
534 case INTRINSIC_LE_OS:
535 fputs ("<= ", dumpfile);
538 fputs ("NOT ", dumpfile);
540 case INTRINSIC_PARENTHESES:
541 fputs ("parens ", dumpfile);
546 ("show_expr(): Bad intrinsic in expression!");
549 show_expr (p->value.op.op1);
553 fputc (' ', dumpfile);
554 show_expr (p->value.op.op2);
557 fputc (')', dumpfile);
561 if (p->value.function.name == NULL)
563 fprintf (dumpfile, "%s", p->symtree->n.sym->name);
564 if (gfc_is_proc_ptr_comp (p, NULL))
566 fputc ('[', dumpfile);
567 show_actual_arglist (p->value.function.actual);
568 fputc (']', dumpfile);
572 fprintf (dumpfile, "%s", p->value.function.name);
573 if (gfc_is_proc_ptr_comp (p, NULL))
575 fputc ('[', dumpfile);
576 fputc ('[', dumpfile);
577 show_actual_arglist (p->value.function.actual);
578 fputc (']', dumpfile);
579 fputc (']', dumpfile);
589 gfc_internal_error ("show_expr(): Don't know how to show expr");
593 /* Show symbol attributes. The flavor and intent are followed by
594 whatever single bit attributes are present. */
597 show_attr (symbol_attribute *attr, const char * module)
599 if (attr->flavor != FL_UNKNOWN)
600 fprintf (dumpfile, "(%s ", gfc_code2string (flavors, attr->flavor));
601 if (attr->access != ACCESS_UNKNOWN)
602 fprintf (dumpfile, "%s ", gfc_code2string (access_types, attr->access));
603 if (attr->proc != PROC_UNKNOWN)
604 fprintf (dumpfile, "%s ", gfc_code2string (procedures, attr->proc));
605 if (attr->save != SAVE_NONE)
606 fprintf (dumpfile, "%s", gfc_code2string (save_status, attr->save));
608 if (attr->allocatable)
609 fputs (" ALLOCATABLE", dumpfile);
610 if (attr->asynchronous)
611 fputs (" ASYNCHRONOUS", dumpfile);
612 if (attr->codimension)
613 fputs (" CODIMENSION", dumpfile);
615 fputs (" DIMENSION", dumpfile);
616 if (attr->contiguous)
617 fputs (" CONTIGUOUS", dumpfile);
619 fputs (" EXTERNAL", dumpfile);
621 fputs (" INTRINSIC", dumpfile);
623 fputs (" OPTIONAL", dumpfile);
625 fputs (" POINTER", dumpfile);
626 if (attr->is_protected)
627 fputs (" PROTECTED", dumpfile);
629 fputs (" VALUE", dumpfile);
631 fputs (" VOLATILE", dumpfile);
632 if (attr->threadprivate)
633 fputs (" THREADPRIVATE", dumpfile);
635 fputs (" TARGET", dumpfile);
638 fputs (" DUMMY", dumpfile);
639 if (attr->intent != INTENT_UNKNOWN)
640 fprintf (dumpfile, "(%s)", gfc_intent_string (attr->intent));
644 fputs (" RESULT", dumpfile);
646 fputs (" ENTRY", dumpfile);
648 fputs (" BIND(C)", dumpfile);
651 fputs (" DATA", dumpfile);
654 fputs (" USE-ASSOC", dumpfile);
656 fprintf (dumpfile, "(%s)", module);
659 if (attr->in_namelist)
660 fputs (" IN-NAMELIST", dumpfile);
662 fputs (" IN-COMMON", dumpfile);
665 fputs (" ABSTRACT", dumpfile);
667 fputs (" FUNCTION", dumpfile);
668 if (attr->subroutine)
669 fputs (" SUBROUTINE", dumpfile);
670 if (attr->implicit_type)
671 fputs (" IMPLICIT-TYPE", dumpfile);
674 fputs (" SEQUENCE", dumpfile);
676 fputs (" ELEMENTAL", dumpfile);
678 fputs (" PURE", dumpfile);
680 fputs (" RECURSIVE", dumpfile);
682 fputc (')', dumpfile);
686 /* Show components of a derived type. */
689 show_components (gfc_symbol *sym)
693 for (c = sym->components; c; c = c->next)
695 fprintf (dumpfile, "(%s ", c->name);
696 show_typespec (&c->ts);
697 if (c->attr.allocatable)
698 fputs (" ALLOCATABLE", dumpfile);
700 fputs (" POINTER", dumpfile);
701 if (c->attr.proc_pointer)
702 fputs (" PPC", dumpfile);
703 if (c->attr.dimension)
704 fputs (" DIMENSION", dumpfile);
705 fputc (' ', dumpfile);
706 show_array_spec (c->as);
708 fprintf (dumpfile, " %s", gfc_code2string (access_types, c->attr.access));
709 fputc (')', dumpfile);
711 fputc (' ', dumpfile);
716 /* Show the f2k_derived namespace with procedure bindings. */
719 show_typebound_proc (gfc_typebound_proc* tb, const char* name)
724 fputs ("GENERIC", dumpfile);
727 fputs ("PROCEDURE, ", dumpfile);
729 fputs ("NOPASS", dumpfile);
733 fprintf (dumpfile, "PASS(%s)", tb->pass_arg);
735 fputs ("PASS", dumpfile);
737 if (tb->non_overridable)
738 fputs (", NON_OVERRIDABLE", dumpfile);
741 if (tb->access == ACCESS_PUBLIC)
742 fputs (", PUBLIC", dumpfile);
744 fputs (", PRIVATE", dumpfile);
746 fprintf (dumpfile, " :: %s => ", name);
751 for (g = tb->u.generic; g; g = g->next)
753 fputs (g->specific_st->name, dumpfile);
755 fputs (", ", dumpfile);
759 fputs (tb->u.specific->n.sym->name, dumpfile);
763 show_typebound_symtree (gfc_symtree* st)
765 gcc_assert (st->n.tb);
766 show_typebound_proc (st->n.tb, st->name);
770 show_f2k_derived (gfc_namespace* f2k)
776 fputs ("Procedure bindings:", dumpfile);
779 /* Finalizer bindings. */
780 for (f = f2k->finalizers; f; f = f->next)
783 fprintf (dumpfile, "FINAL %s", f->proc_sym->name);
786 /* Type-bound procedures. */
787 gfc_traverse_symtree (f2k->tb_sym_root, &show_typebound_symtree);
792 fputs ("Operator bindings:", dumpfile);
795 /* User-defined operators. */
796 gfc_traverse_symtree (f2k->tb_uop_root, &show_typebound_symtree);
798 /* Intrinsic operators. */
799 for (op = GFC_INTRINSIC_BEGIN; op != GFC_INTRINSIC_END; ++op)
801 show_typebound_proc (f2k->tb_op[op],
802 gfc_op2string ((gfc_intrinsic_op) op));
808 /* Show a symbol. If a symbol is an ENTRY, SUBROUTINE or FUNCTION, we
809 show the interface. Information needed to reconstruct the list of
810 specific interfaces associated with a generic symbol is done within
814 show_symbol (gfc_symbol *sym)
816 gfc_formal_arglist *formal;
823 fprintf (dumpfile, "|| symbol: '%s' ", sym->name);
824 len = strlen (sym->name);
825 for (i=len; i<12; i++)
826 fputc(' ', dumpfile);
831 fputs ("type spec : ", dumpfile);
832 show_typespec (&sym->ts);
835 fputs ("attributes: ", dumpfile);
836 show_attr (&sym->attr, sym->module);
841 fputs ("value: ", dumpfile);
842 show_expr (sym->value);
848 fputs ("Array spec:", dumpfile);
849 show_array_spec (sym->as);
855 fputs ("Generic interfaces:", dumpfile);
856 for (intr = sym->generic; intr; intr = intr->next)
857 fprintf (dumpfile, " %s", intr->sym->name);
863 fprintf (dumpfile, "result: %s", sym->result->name);
869 fputs ("components: ", dumpfile);
870 show_components (sym);
873 if (sym->f2k_derived)
877 fprintf (dumpfile, "hash: %d", sym->hash_value);
878 show_f2k_derived (sym->f2k_derived);
884 fputs ("Formal arglist:", dumpfile);
886 for (formal = sym->formal; formal; formal = formal->next)
888 if (formal->sym != NULL)
889 fprintf (dumpfile, " %s", formal->sym->name);
891 fputs (" [Alt Return]", dumpfile);
895 if (sym->formal_ns && (sym->formal_ns->proc_name != sym)
896 && sym->attr.proc != PROC_ST_FUNCTION
900 fputs ("Formal namespace", dumpfile);
901 show_namespace (sym->formal_ns);
907 /* Show a user-defined operator. Just prints an operator
908 and the name of the associated subroutine, really. */
911 show_uop (gfc_user_op *uop)
916 fprintf (dumpfile, "%s:", uop->name);
918 for (intr = uop->op; intr; intr = intr->next)
919 fprintf (dumpfile, " %s", intr->sym->name);
923 /* Workhorse function for traversing the user operator symtree. */
926 traverse_uop (gfc_symtree *st, void (*func) (gfc_user_op *))
933 traverse_uop (st->left, func);
934 traverse_uop (st->right, func);
938 /* Traverse the tree of user operator nodes. */
941 gfc_traverse_user_op (gfc_namespace *ns, void (*func) (gfc_user_op *))
943 traverse_uop (ns->uop_root, func);
947 /* Function to display a common block. */
950 show_common (gfc_symtree *st)
955 fprintf (dumpfile, "common: /%s/ ", st->name);
957 s = st->n.common->head;
960 fprintf (dumpfile, "%s", s->name);
963 fputs (", ", dumpfile);
965 fputc ('\n', dumpfile);
969 /* Worker function to display the symbol tree. */
972 show_symtree (gfc_symtree *st)
978 len = strlen(st->name);
979 fprintf (dumpfile, "symtree: '%s'", st->name);
981 for (i=len; i<12; i++)
982 fputc(' ', dumpfile);
985 fputs( " Ambiguous", dumpfile);
987 if (st->n.sym->ns != gfc_current_ns)
988 fprintf (dumpfile, "|| symbol: '%s' from namespace '%s'", st->n.sym->name,
989 st->n.sym->ns->proc_name->name);
991 show_symbol (st->n.sym);
995 /******************* Show gfc_code structures **************/
998 /* Show a list of code structures. Mutually recursive with
1002 show_code (int level, gfc_code *c)
1004 for (; c; c = c->next)
1005 show_code_node (level, c);
1009 show_namelist (gfc_namelist *n)
1011 for (; n->next; n = n->next)
1012 fprintf (dumpfile, "%s,", n->sym->name);
1013 fprintf (dumpfile, "%s", n->sym->name);
1016 /* Show a single OpenMP directive node and everything underneath it
1020 show_omp_node (int level, gfc_code *c)
1022 gfc_omp_clauses *omp_clauses = NULL;
1023 const char *name = NULL;
1027 case EXEC_OMP_ATOMIC: name = "ATOMIC"; break;
1028 case EXEC_OMP_BARRIER: name = "BARRIER"; break;
1029 case EXEC_OMP_CRITICAL: name = "CRITICAL"; break;
1030 case EXEC_OMP_FLUSH: name = "FLUSH"; break;
1031 case EXEC_OMP_DO: name = "DO"; break;
1032 case EXEC_OMP_MASTER: name = "MASTER"; break;
1033 case EXEC_OMP_ORDERED: name = "ORDERED"; break;
1034 case EXEC_OMP_PARALLEL: name = "PARALLEL"; break;
1035 case EXEC_OMP_PARALLEL_DO: name = "PARALLEL DO"; break;
1036 case EXEC_OMP_PARALLEL_SECTIONS: name = "PARALLEL SECTIONS"; break;
1037 case EXEC_OMP_PARALLEL_WORKSHARE: name = "PARALLEL WORKSHARE"; break;
1038 case EXEC_OMP_SECTIONS: name = "SECTIONS"; break;
1039 case EXEC_OMP_SINGLE: name = "SINGLE"; break;
1040 case EXEC_OMP_TASK: name = "TASK"; break;
1041 case EXEC_OMP_TASKWAIT: name = "TASKWAIT"; break;
1042 case EXEC_OMP_WORKSHARE: name = "WORKSHARE"; break;
1046 fprintf (dumpfile, "!$OMP %s", name);
1050 case EXEC_OMP_PARALLEL:
1051 case EXEC_OMP_PARALLEL_DO:
1052 case EXEC_OMP_PARALLEL_SECTIONS:
1053 case EXEC_OMP_SECTIONS:
1054 case EXEC_OMP_SINGLE:
1055 case EXEC_OMP_WORKSHARE:
1056 case EXEC_OMP_PARALLEL_WORKSHARE:
1058 omp_clauses = c->ext.omp_clauses;
1060 case EXEC_OMP_CRITICAL:
1061 if (c->ext.omp_name)
1062 fprintf (dumpfile, " (%s)", c->ext.omp_name);
1064 case EXEC_OMP_FLUSH:
1065 if (c->ext.omp_namelist)
1067 fputs (" (", dumpfile);
1068 show_namelist (c->ext.omp_namelist);
1069 fputc (')', dumpfile);
1072 case EXEC_OMP_BARRIER:
1073 case EXEC_OMP_TASKWAIT:
1082 if (omp_clauses->if_expr)
1084 fputs (" IF(", dumpfile);
1085 show_expr (omp_clauses->if_expr);
1086 fputc (')', dumpfile);
1088 if (omp_clauses->num_threads)
1090 fputs (" NUM_THREADS(", dumpfile);
1091 show_expr (omp_clauses->num_threads);
1092 fputc (')', dumpfile);
1094 if (omp_clauses->sched_kind != OMP_SCHED_NONE)
1097 switch (omp_clauses->sched_kind)
1099 case OMP_SCHED_STATIC: type = "STATIC"; break;
1100 case OMP_SCHED_DYNAMIC: type = "DYNAMIC"; break;
1101 case OMP_SCHED_GUIDED: type = "GUIDED"; break;
1102 case OMP_SCHED_RUNTIME: type = "RUNTIME"; break;
1103 case OMP_SCHED_AUTO: type = "AUTO"; break;
1107 fprintf (dumpfile, " SCHEDULE (%s", type);
1108 if (omp_clauses->chunk_size)
1110 fputc (',', dumpfile);
1111 show_expr (omp_clauses->chunk_size);
1113 fputc (')', dumpfile);
1115 if (omp_clauses->default_sharing != OMP_DEFAULT_UNKNOWN)
1118 switch (omp_clauses->default_sharing)
1120 case OMP_DEFAULT_NONE: type = "NONE"; break;
1121 case OMP_DEFAULT_PRIVATE: type = "PRIVATE"; break;
1122 case OMP_DEFAULT_SHARED: type = "SHARED"; break;
1123 case OMP_DEFAULT_FIRSTPRIVATE: type = "FIRSTPRIVATE"; break;
1127 fprintf (dumpfile, " DEFAULT(%s)", type);
1129 if (omp_clauses->ordered)
1130 fputs (" ORDERED", dumpfile);
1131 if (omp_clauses->untied)
1132 fputs (" UNTIED", dumpfile);
1133 if (omp_clauses->collapse)
1134 fprintf (dumpfile, " COLLAPSE(%d)", omp_clauses->collapse);
1135 for (list_type = 0; list_type < OMP_LIST_NUM; list_type++)
1136 if (omp_clauses->lists[list_type] != NULL
1137 && list_type != OMP_LIST_COPYPRIVATE)
1140 if (list_type >= OMP_LIST_REDUCTION_FIRST)
1144 case OMP_LIST_PLUS: type = "+"; break;
1145 case OMP_LIST_MULT: type = "*"; break;
1146 case OMP_LIST_SUB: type = "-"; break;
1147 case OMP_LIST_AND: type = ".AND."; break;
1148 case OMP_LIST_OR: type = ".OR."; break;
1149 case OMP_LIST_EQV: type = ".EQV."; break;
1150 case OMP_LIST_NEQV: type = ".NEQV."; break;
1151 case OMP_LIST_MAX: type = "MAX"; break;
1152 case OMP_LIST_MIN: type = "MIN"; break;
1153 case OMP_LIST_IAND: type = "IAND"; break;
1154 case OMP_LIST_IOR: type = "IOR"; break;
1155 case OMP_LIST_IEOR: type = "IEOR"; break;
1159 fprintf (dumpfile, " REDUCTION(%s:", type);
1165 case OMP_LIST_PRIVATE: type = "PRIVATE"; break;
1166 case OMP_LIST_FIRSTPRIVATE: type = "FIRSTPRIVATE"; break;
1167 case OMP_LIST_LASTPRIVATE: type = "LASTPRIVATE"; break;
1168 case OMP_LIST_SHARED: type = "SHARED"; break;
1169 case OMP_LIST_COPYIN: type = "COPYIN"; break;
1173 fprintf (dumpfile, " %s(", type);
1175 show_namelist (omp_clauses->lists[list_type]);
1176 fputc (')', dumpfile);
1179 fputc ('\n', dumpfile);
1180 if (c->op == EXEC_OMP_SECTIONS || c->op == EXEC_OMP_PARALLEL_SECTIONS)
1182 gfc_code *d = c->block;
1185 show_code (level + 1, d->next);
1186 if (d->block == NULL)
1188 code_indent (level, 0);
1189 fputs ("!$OMP SECTION\n", dumpfile);
1194 show_code (level + 1, c->block->next);
1195 if (c->op == EXEC_OMP_ATOMIC)
1197 code_indent (level, 0);
1198 fprintf (dumpfile, "!$OMP END %s", name);
1199 if (omp_clauses != NULL)
1201 if (omp_clauses->lists[OMP_LIST_COPYPRIVATE])
1203 fputs (" COPYPRIVATE(", dumpfile);
1204 show_namelist (omp_clauses->lists[OMP_LIST_COPYPRIVATE]);
1205 fputc (')', dumpfile);
1207 else if (omp_clauses->nowait)
1208 fputs (" NOWAIT", dumpfile);
1210 else if (c->op == EXEC_OMP_CRITICAL && c->ext.omp_name)
1211 fprintf (dumpfile, " (%s)", c->ext.omp_name);
1215 /* Show a single code node and everything underneath it if necessary. */
1218 show_code_node (int level, gfc_code *c)
1220 gfc_forall_iterator *fa;
1233 fputc ('\n', dumpfile);
1234 code_indent (level, c->here);
1241 case EXEC_END_PROCEDURE:
1245 fputs ("NOP", dumpfile);
1249 fputs ("CONTINUE", dumpfile);
1253 fprintf (dumpfile, "ENTRY %s", c->ext.entry->sym->name);
1256 case EXEC_INIT_ASSIGN:
1258 fputs ("ASSIGN ", dumpfile);
1259 show_expr (c->expr1);
1260 fputc (' ', dumpfile);
1261 show_expr (c->expr2);
1264 case EXEC_LABEL_ASSIGN:
1265 fputs ("LABEL ASSIGN ", dumpfile);
1266 show_expr (c->expr1);
1267 fprintf (dumpfile, " %d", c->label1->value);
1270 case EXEC_POINTER_ASSIGN:
1271 fputs ("POINTER ASSIGN ", dumpfile);
1272 show_expr (c->expr1);
1273 fputc (' ', dumpfile);
1274 show_expr (c->expr2);
1278 fputs ("GOTO ", dumpfile);
1280 fprintf (dumpfile, "%d", c->label1->value);
1283 show_expr (c->expr1);
1287 fputs (", (", dumpfile);
1288 for (; d; d = d ->block)
1290 code_indent (level, d->label1);
1291 if (d->block != NULL)
1292 fputc (',', dumpfile);
1294 fputc (')', dumpfile);
1301 case EXEC_ASSIGN_CALL:
1302 if (c->resolved_sym)
1303 fprintf (dumpfile, "CALL %s ", c->resolved_sym->name);
1304 else if (c->symtree)
1305 fprintf (dumpfile, "CALL %s ", c->symtree->name);
1307 fputs ("CALL ?? ", dumpfile);
1309 show_actual_arglist (c->ext.actual);
1313 fputs ("CALL ", dumpfile);
1314 show_compcall (c->expr1);
1318 fputs ("CALL ", dumpfile);
1319 show_expr (c->expr1);
1320 show_actual_arglist (c->ext.actual);
1324 fputs ("RETURN ", dumpfile);
1326 show_expr (c->expr1);
1330 fputs ("PAUSE ", dumpfile);
1332 if (c->expr1 != NULL)
1333 show_expr (c->expr1);
1335 fprintf (dumpfile, "%d", c->ext.stop_code);
1339 case EXEC_ERROR_STOP:
1340 fputs ("ERROR ", dumpfile);
1344 fputs ("STOP ", dumpfile);
1346 if (c->expr1 != NULL)
1347 show_expr (c->expr1);
1349 fprintf (dumpfile, "%d", c->ext.stop_code);
1354 fputs ("SYNC ALL ", dumpfile);
1355 if (c->expr2 != NULL)
1357 fputs (" stat=", dumpfile);
1358 show_expr (c->expr2);
1360 if (c->expr3 != NULL)
1362 fputs (" errmsg=", dumpfile);
1363 show_expr (c->expr3);
1367 case EXEC_SYNC_MEMORY:
1368 fputs ("SYNC MEMORY ", dumpfile);
1369 if (c->expr2 != NULL)
1371 fputs (" stat=", dumpfile);
1372 show_expr (c->expr2);
1374 if (c->expr3 != NULL)
1376 fputs (" errmsg=", dumpfile);
1377 show_expr (c->expr3);
1381 case EXEC_SYNC_IMAGES:
1382 fputs ("SYNC IMAGES image-set=", dumpfile);
1383 if (c->expr1 != NULL)
1384 show_expr (c->expr1);
1386 fputs ("* ", dumpfile);
1387 if (c->expr2 != NULL)
1389 fputs (" stat=", dumpfile);
1390 show_expr (c->expr2);
1392 if (c->expr3 != NULL)
1394 fputs (" errmsg=", dumpfile);
1395 show_expr (c->expr3);
1401 if (c->op == EXEC_LOCK)
1402 fputs ("LOCK ", dumpfile);
1404 fputs ("UNLOCK ", dumpfile);
1406 fputs ("lock-variable=", dumpfile);
1407 if (c->expr1 != NULL)
1408 show_expr (c->expr1);
1409 if (c->expr4 != NULL)
1411 fputs (" acquired_lock=", dumpfile);
1412 show_expr (c->expr4);
1414 if (c->expr2 != NULL)
1416 fputs (" stat=", dumpfile);
1417 show_expr (c->expr2);
1419 if (c->expr3 != NULL)
1421 fputs (" errmsg=", dumpfile);
1422 show_expr (c->expr3);
1426 case EXEC_ARITHMETIC_IF:
1427 fputs ("IF ", dumpfile);
1428 show_expr (c->expr1);
1429 fprintf (dumpfile, " %d, %d, %d",
1430 c->label1->value, c->label2->value, c->label3->value);
1435 fputs ("IF ", dumpfile);
1436 show_expr (d->expr1);
1439 show_code (level + 1, d->next);
1443 for (; d; d = d->block)
1445 code_indent (level, 0);
1447 if (d->expr1 == NULL)
1448 fputs ("ELSE", dumpfile);
1451 fputs ("ELSE IF ", dumpfile);
1452 show_expr (d->expr1);
1456 show_code (level + 1, d->next);
1461 code_indent (level, c->label1);
1465 fputs ("ENDIF", dumpfile);
1470 const char* blocktype;
1471 gfc_namespace *saved_ns;
1473 if (c->ext.block.assoc)
1474 blocktype = "ASSOCIATE";
1476 blocktype = "BLOCK";
1478 fprintf (dumpfile, "%s ", blocktype);
1480 ns = c->ext.block.ns;
1481 saved_ns = gfc_current_ns;
1482 gfc_current_ns = ns;
1483 gfc_traverse_symtree (ns->sym_root, show_symtree);
1484 gfc_current_ns = saved_ns;
1485 show_code (show_level, ns->code);
1488 fprintf (dumpfile, "END %s ", blocktype);
1494 fputs ("SELECT CASE ", dumpfile);
1495 show_expr (c->expr1);
1496 fputc ('\n', dumpfile);
1498 for (; d; d = d->block)
1500 code_indent (level, 0);
1502 fputs ("CASE ", dumpfile);
1503 for (cp = d->ext.block.case_list; cp; cp = cp->next)
1505 fputc ('(', dumpfile);
1506 show_expr (cp->low);
1507 fputc (' ', dumpfile);
1508 show_expr (cp->high);
1509 fputc (')', dumpfile);
1510 fputc (' ', dumpfile);
1512 fputc ('\n', dumpfile);
1514 show_code (level + 1, d->next);
1517 code_indent (level, c->label1);
1518 fputs ("END SELECT", dumpfile);
1522 fputs ("WHERE ", dumpfile);
1525 show_expr (d->expr1);
1526 fputc ('\n', dumpfile);
1528 show_code (level + 1, d->next);
1530 for (d = d->block; d; d = d->block)
1532 code_indent (level, 0);
1533 fputs ("ELSE WHERE ", dumpfile);
1534 show_expr (d->expr1);
1535 fputc ('\n', dumpfile);
1536 show_code (level + 1, d->next);
1539 code_indent (level, 0);
1540 fputs ("END WHERE", dumpfile);
1545 fputs ("FORALL ", dumpfile);
1546 for (fa = c->ext.forall_iterator; fa; fa = fa->next)
1548 show_expr (fa->var);
1549 fputc (' ', dumpfile);
1550 show_expr (fa->start);
1551 fputc (':', dumpfile);
1552 show_expr (fa->end);
1553 fputc (':', dumpfile);
1554 show_expr (fa->stride);
1556 if (fa->next != NULL)
1557 fputc (',', dumpfile);
1560 if (c->expr1 != NULL)
1562 fputc (',', dumpfile);
1563 show_expr (c->expr1);
1565 fputc ('\n', dumpfile);
1567 show_code (level + 1, c->block->next);
1569 code_indent (level, 0);
1570 fputs ("END FORALL", dumpfile);
1574 fputs ("CRITICAL\n", dumpfile);
1575 show_code (level + 1, c->block->next);
1576 code_indent (level, 0);
1577 fputs ("END CRITICAL", dumpfile);
1581 fputs ("DO ", dumpfile);
1583 fprintf (dumpfile, " %-5d ", c->label1->value);
1585 show_expr (c->ext.iterator->var);
1586 fputc ('=', dumpfile);
1587 show_expr (c->ext.iterator->start);
1588 fputc (' ', dumpfile);
1589 show_expr (c->ext.iterator->end);
1590 fputc (' ', dumpfile);
1591 show_expr (c->ext.iterator->step);
1594 show_code (level + 1, c->block->next);
1601 fputs ("END DO", dumpfile);
1605 fputs ("DO WHILE ", dumpfile);
1606 show_expr (c->expr1);
1607 fputc ('\n', dumpfile);
1609 show_code (level + 1, c->block->next);
1611 code_indent (level, c->label1);
1612 fputs ("END DO", dumpfile);
1616 fputs ("CYCLE", dumpfile);
1618 fprintf (dumpfile, " %s", c->symtree->n.sym->name);
1622 fputs ("EXIT", dumpfile);
1624 fprintf (dumpfile, " %s", c->symtree->n.sym->name);
1628 fputs ("ALLOCATE ", dumpfile);
1631 fputs (" STAT=", dumpfile);
1632 show_expr (c->expr1);
1637 fputs (" ERRMSG=", dumpfile);
1638 show_expr (c->expr2);
1644 fputs (" MOLD=", dumpfile);
1646 fputs (" SOURCE=", dumpfile);
1647 show_expr (c->expr3);
1650 for (a = c->ext.alloc.list; a; a = a->next)
1652 fputc (' ', dumpfile);
1653 show_expr (a->expr);
1658 case EXEC_DEALLOCATE:
1659 fputs ("DEALLOCATE ", dumpfile);
1662 fputs (" STAT=", dumpfile);
1663 show_expr (c->expr1);
1668 fputs (" ERRMSG=", dumpfile);
1669 show_expr (c->expr2);
1672 for (a = c->ext.alloc.list; a; a = a->next)
1674 fputc (' ', dumpfile);
1675 show_expr (a->expr);
1681 fputs ("OPEN", dumpfile);
1686 fputs (" UNIT=", dumpfile);
1687 show_expr (open->unit);
1691 fputs (" IOMSG=", dumpfile);
1692 show_expr (open->iomsg);
1696 fputs (" IOSTAT=", dumpfile);
1697 show_expr (open->iostat);
1701 fputs (" FILE=", dumpfile);
1702 show_expr (open->file);
1706 fputs (" STATUS=", dumpfile);
1707 show_expr (open->status);
1711 fputs (" ACCESS=", dumpfile);
1712 show_expr (open->access);
1716 fputs (" FORM=", dumpfile);
1717 show_expr (open->form);
1721 fputs (" RECL=", dumpfile);
1722 show_expr (open->recl);
1726 fputs (" BLANK=", dumpfile);
1727 show_expr (open->blank);
1731 fputs (" POSITION=", dumpfile);
1732 show_expr (open->position);
1736 fputs (" ACTION=", dumpfile);
1737 show_expr (open->action);
1741 fputs (" DELIM=", dumpfile);
1742 show_expr (open->delim);
1746 fputs (" PAD=", dumpfile);
1747 show_expr (open->pad);
1751 fputs (" DECIMAL=", dumpfile);
1752 show_expr (open->decimal);
1756 fputs (" ENCODING=", dumpfile);
1757 show_expr (open->encoding);
1761 fputs (" ROUND=", dumpfile);
1762 show_expr (open->round);
1766 fputs (" SIGN=", dumpfile);
1767 show_expr (open->sign);
1771 fputs (" CONVERT=", dumpfile);
1772 show_expr (open->convert);
1774 if (open->asynchronous)
1776 fputs (" ASYNCHRONOUS=", dumpfile);
1777 show_expr (open->asynchronous);
1779 if (open->err != NULL)
1780 fprintf (dumpfile, " ERR=%d", open->err->value);
1785 fputs ("CLOSE", dumpfile);
1786 close = c->ext.close;
1790 fputs (" UNIT=", dumpfile);
1791 show_expr (close->unit);
1795 fputs (" IOMSG=", dumpfile);
1796 show_expr (close->iomsg);
1800 fputs (" IOSTAT=", dumpfile);
1801 show_expr (close->iostat);
1805 fputs (" STATUS=", dumpfile);
1806 show_expr (close->status);
1808 if (close->err != NULL)
1809 fprintf (dumpfile, " ERR=%d", close->err->value);
1812 case EXEC_BACKSPACE:
1813 fputs ("BACKSPACE", dumpfile);
1817 fputs ("ENDFILE", dumpfile);
1821 fputs ("REWIND", dumpfile);
1825 fputs ("FLUSH", dumpfile);
1828 fp = c->ext.filepos;
1832 fputs (" UNIT=", dumpfile);
1833 show_expr (fp->unit);
1837 fputs (" IOMSG=", dumpfile);
1838 show_expr (fp->iomsg);
1842 fputs (" IOSTAT=", dumpfile);
1843 show_expr (fp->iostat);
1845 if (fp->err != NULL)
1846 fprintf (dumpfile, " ERR=%d", fp->err->value);
1850 fputs ("INQUIRE", dumpfile);
1855 fputs (" UNIT=", dumpfile);
1856 show_expr (i->unit);
1860 fputs (" FILE=", dumpfile);
1861 show_expr (i->file);
1866 fputs (" IOMSG=", dumpfile);
1867 show_expr (i->iomsg);
1871 fputs (" IOSTAT=", dumpfile);
1872 show_expr (i->iostat);
1876 fputs (" EXIST=", dumpfile);
1877 show_expr (i->exist);
1881 fputs (" OPENED=", dumpfile);
1882 show_expr (i->opened);
1886 fputs (" NUMBER=", dumpfile);
1887 show_expr (i->number);
1891 fputs (" NAMED=", dumpfile);
1892 show_expr (i->named);
1896 fputs (" NAME=", dumpfile);
1897 show_expr (i->name);
1901 fputs (" ACCESS=", dumpfile);
1902 show_expr (i->access);
1906 fputs (" SEQUENTIAL=", dumpfile);
1907 show_expr (i->sequential);
1912 fputs (" DIRECT=", dumpfile);
1913 show_expr (i->direct);
1917 fputs (" FORM=", dumpfile);
1918 show_expr (i->form);
1922 fputs (" FORMATTED", dumpfile);
1923 show_expr (i->formatted);
1927 fputs (" UNFORMATTED=", dumpfile);
1928 show_expr (i->unformatted);
1932 fputs (" RECL=", dumpfile);
1933 show_expr (i->recl);
1937 fputs (" NEXTREC=", dumpfile);
1938 show_expr (i->nextrec);
1942 fputs (" BLANK=", dumpfile);
1943 show_expr (i->blank);
1947 fputs (" POSITION=", dumpfile);
1948 show_expr (i->position);
1952 fputs (" ACTION=", dumpfile);
1953 show_expr (i->action);
1957 fputs (" READ=", dumpfile);
1958 show_expr (i->read);
1962 fputs (" WRITE=", dumpfile);
1963 show_expr (i->write);
1967 fputs (" READWRITE=", dumpfile);
1968 show_expr (i->readwrite);
1972 fputs (" DELIM=", dumpfile);
1973 show_expr (i->delim);
1977 fputs (" PAD=", dumpfile);
1982 fputs (" CONVERT=", dumpfile);
1983 show_expr (i->convert);
1985 if (i->asynchronous)
1987 fputs (" ASYNCHRONOUS=", dumpfile);
1988 show_expr (i->asynchronous);
1992 fputs (" DECIMAL=", dumpfile);
1993 show_expr (i->decimal);
1997 fputs (" ENCODING=", dumpfile);
1998 show_expr (i->encoding);
2002 fputs (" PENDING=", dumpfile);
2003 show_expr (i->pending);
2007 fputs (" ROUND=", dumpfile);
2008 show_expr (i->round);
2012 fputs (" SIGN=", dumpfile);
2013 show_expr (i->sign);
2017 fputs (" SIZE=", dumpfile);
2018 show_expr (i->size);
2022 fputs (" ID=", dumpfile);
2027 fprintf (dumpfile, " ERR=%d", i->err->value);
2031 fputs ("IOLENGTH ", dumpfile);
2032 show_expr (c->expr1);
2037 fputs ("READ", dumpfile);
2041 fputs ("WRITE", dumpfile);
2047 fputs (" UNIT=", dumpfile);
2048 show_expr (dt->io_unit);
2051 if (dt->format_expr)
2053 fputs (" FMT=", dumpfile);
2054 show_expr (dt->format_expr);
2057 if (dt->format_label != NULL)
2058 fprintf (dumpfile, " FMT=%d", dt->format_label->value);
2060 fprintf (dumpfile, " NML=%s", dt->namelist->name);
2064 fputs (" IOMSG=", dumpfile);
2065 show_expr (dt->iomsg);
2069 fputs (" IOSTAT=", dumpfile);
2070 show_expr (dt->iostat);
2074 fputs (" SIZE=", dumpfile);
2075 show_expr (dt->size);
2079 fputs (" REC=", dumpfile);
2080 show_expr (dt->rec);
2084 fputs (" ADVANCE=", dumpfile);
2085 show_expr (dt->advance);
2089 fputs (" ID=", dumpfile);
2094 fputs (" POS=", dumpfile);
2095 show_expr (dt->pos);
2097 if (dt->asynchronous)
2099 fputs (" ASYNCHRONOUS=", dumpfile);
2100 show_expr (dt->asynchronous);
2104 fputs (" BLANK=", dumpfile);
2105 show_expr (dt->blank);
2109 fputs (" DECIMAL=", dumpfile);
2110 show_expr (dt->decimal);
2114 fputs (" DELIM=", dumpfile);
2115 show_expr (dt->delim);
2119 fputs (" PAD=", dumpfile);
2120 show_expr (dt->pad);
2124 fputs (" ROUND=", dumpfile);
2125 show_expr (dt->round);
2129 fputs (" SIGN=", dumpfile);
2130 show_expr (dt->sign);
2134 for (c = c->block->next; c; c = c->next)
2135 show_code_node (level + (c->next != NULL), c);
2139 fputs ("TRANSFER ", dumpfile);
2140 show_expr (c->expr1);
2144 fputs ("DT_END", dumpfile);
2147 if (dt->err != NULL)
2148 fprintf (dumpfile, " ERR=%d", dt->err->value);
2149 if (dt->end != NULL)
2150 fprintf (dumpfile, " END=%d", dt->end->value);
2151 if (dt->eor != NULL)
2152 fprintf (dumpfile, " EOR=%d", dt->eor->value);
2155 case EXEC_OMP_ATOMIC:
2156 case EXEC_OMP_BARRIER:
2157 case EXEC_OMP_CRITICAL:
2158 case EXEC_OMP_FLUSH:
2160 case EXEC_OMP_MASTER:
2161 case EXEC_OMP_ORDERED:
2162 case EXEC_OMP_PARALLEL:
2163 case EXEC_OMP_PARALLEL_DO:
2164 case EXEC_OMP_PARALLEL_SECTIONS:
2165 case EXEC_OMP_PARALLEL_WORKSHARE:
2166 case EXEC_OMP_SECTIONS:
2167 case EXEC_OMP_SINGLE:
2169 case EXEC_OMP_TASKWAIT:
2170 case EXEC_OMP_WORKSHARE:
2171 show_omp_node (level, c);
2175 gfc_internal_error ("show_code_node(): Bad statement code");
2180 /* Show an equivalence chain. */
2183 show_equiv (gfc_equiv *eq)
2186 fputs ("Equivalence: ", dumpfile);
2189 show_expr (eq->expr);
2192 fputs (", ", dumpfile);
2197 /* Show a freakin' whole namespace. */
2200 show_namespace (gfc_namespace *ns)
2202 gfc_interface *intr;
2203 gfc_namespace *save;
2208 save = gfc_current_ns;
2211 fputs ("Namespace:", dumpfile);
2219 while (i < GFC_LETTERS - 1
2220 && gfc_compare_types(&ns->default_type[i+1],
2221 &ns->default_type[l]))
2225 fprintf (dumpfile, " %c-%c: ", l+'A', i+'A');
2227 fprintf (dumpfile, " %c: ", l+'A');
2229 show_typespec(&ns->default_type[l]);
2231 } while (i < GFC_LETTERS);
2233 if (ns->proc_name != NULL)
2236 fprintf (dumpfile, "procedure name = %s", ns->proc_name->name);
2240 gfc_current_ns = ns;
2241 gfc_traverse_symtree (ns->common_root, show_common);
2243 gfc_traverse_symtree (ns->sym_root, show_symtree);
2245 for (op = GFC_INTRINSIC_BEGIN; op != GFC_INTRINSIC_END; op++)
2247 /* User operator interfaces */
2253 fprintf (dumpfile, "Operator interfaces for %s:",
2254 gfc_op2string ((gfc_intrinsic_op) op));
2256 for (; intr; intr = intr->next)
2257 fprintf (dumpfile, " %s", intr->sym->name);
2260 if (ns->uop_root != NULL)
2263 fputs ("User operators:\n", dumpfile);
2264 gfc_traverse_user_op (ns, show_uop);
2270 for (eq = ns->equiv; eq; eq = eq->next)
2273 fputc ('\n', dumpfile);
2275 fputs ("code:", dumpfile);
2276 show_code (show_level, ns->code);
2279 for (ns = ns->contained; ns; ns = ns->sibling)
2281 fputs ("\nCONTAINS\n", dumpfile);
2283 show_namespace (ns);
2287 fputc ('\n', dumpfile);
2288 gfc_current_ns = save;
2292 /* Main function for dumping a parse tree. */
2295 gfc_dump_parse_tree (gfc_namespace *ns, FILE *file)
2298 show_namespace (ns);