2 Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3 Contributed by Steven Bosscher
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
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 /* Keep track of indentation for symbol tree dumps. */
38 static int show_level = 0;
41 /* Forward declaration because this one needs all, and all need
43 static void gfc_show_expr (gfc_expr *);
45 /* Do indentation for a specific level. */
48 code_indent (int level, gfc_st_label * label)
53 gfc_status ("%-5d ", label->value);
57 for (i = 0; i < 2 * level; i++)
58 gfc_status_char (' ');
62 /* Simple indentation at the current level. This one
63 is used to show symbols. */
69 code_indent (show_level, NULL);
73 /* Show type-specific information. */
76 gfc_show_typespec (gfc_typespec * ts)
79 gfc_status ("(%s ", gfc_basic_typename (ts->type));
84 gfc_status ("%s", ts->derived->name);
88 gfc_show_expr (ts->cl->length);
92 gfc_status ("%d", ts->kind);
100 /* Show an actual argument list. */
103 gfc_show_actual_arglist (gfc_actual_arglist * a)
108 for (; a; a = a->next)
110 gfc_status_char ('(');
112 gfc_status ("%s = ", a->name);
114 gfc_show_expr (a->expr);
116 gfc_status ("(arg not-present)");
118 gfc_status_char (')');
127 /* Show a gfc_array_spec array specification structure. */
130 gfc_show_array_spec (gfc_array_spec * as)
141 gfc_status ("(%d", as->rank);
147 case AS_EXPLICIT: c = "AS_EXPLICIT"; break;
148 case AS_DEFERRED: c = "AS_DEFERRED"; break;
149 case AS_ASSUMED_SIZE: c = "AS_ASSUMED_SIZE"; break;
150 case AS_ASSUMED_SHAPE: c = "AS_ASSUMED_SHAPE"; break;
153 ("gfc_show_array_spec(): Unhandled array shape type.");
155 gfc_status (" %s ", c);
157 for (i = 0; i < as->rank; i++)
159 gfc_show_expr (as->lower[i]);
160 gfc_status_char (' ');
161 gfc_show_expr (as->upper[i]);
162 gfc_status_char (' ');
170 /* Show a gfc_array_ref array reference structure. */
173 gfc_show_array_ref (gfc_array_ref * ar)
177 gfc_status_char ('(');
186 for (i = 0; i < ar->dimen; i++)
188 /* There are two types of array sections: either the
189 elements are identified by an integer array ('vector'),
190 or by an index range. In the former case we only have to
191 print the start expression which contains the vector, in
192 the latter case we have to print any of lower and upper
193 bound and the stride, if they're present. */
195 if (ar->start[i] != NULL)
196 gfc_show_expr (ar->start[i]);
198 if (ar->dimen_type[i] == DIMEN_RANGE)
200 gfc_status_char (':');
202 if (ar->end[i] != NULL)
203 gfc_show_expr (ar->end[i]);
205 if (ar->stride[i] != NULL)
207 gfc_status_char (':');
208 gfc_show_expr (ar->stride[i]);
212 if (i != ar->dimen - 1)
218 for (i = 0; i < ar->dimen; i++)
220 gfc_show_expr (ar->start[i]);
221 if (i != ar->dimen - 1)
227 gfc_status ("UNKNOWN");
231 gfc_internal_error ("gfc_show_array_ref(): Unknown array reference");
234 gfc_status_char (')');
238 /* Show a list of gfc_ref structures. */
241 gfc_show_ref (gfc_ref * p)
244 for (; p; p = p->next)
248 gfc_show_array_ref (&p->u.ar);
252 gfc_status (" %% %s", p->u.c.component->name);
256 gfc_status_char ('(');
257 gfc_show_expr (p->u.ss.start);
258 gfc_status_char (':');
259 gfc_show_expr (p->u.ss.end);
260 gfc_status_char (')');
264 gfc_internal_error ("gfc_show_ref(): Bad component code");
269 /* Display a constructor. Works recursively for array constructors. */
272 gfc_show_constructor (gfc_constructor * c)
275 for (; c; c = c->next)
277 if (c->iterator == NULL)
278 gfc_show_expr (c->expr);
281 gfc_status_char ('(');
282 gfc_show_expr (c->expr);
284 gfc_status_char (' ');
285 gfc_show_expr (c->iterator->var);
286 gfc_status_char ('=');
287 gfc_show_expr (c->iterator->start);
288 gfc_status_char (',');
289 gfc_show_expr (c->iterator->end);
290 gfc_status_char (',');
291 gfc_show_expr (c->iterator->step);
293 gfc_status_char (')');
302 /* Show an expression. */
305 gfc_show_expr (gfc_expr * p)
316 switch (p->expr_type)
319 c = p->value.character.string;
321 for (i = 0; i < p->value.character.length; i++, c++)
326 gfc_status ("%c", *c);
329 gfc_show_ref (p->ref);
333 gfc_status ("%s(", p->ts.derived->name);
334 gfc_show_constructor (p->value.constructor);
335 gfc_status_char (')');
340 gfc_show_constructor (p->value.constructor);
343 gfc_show_ref (p->ref);
347 gfc_status ("NULL()");
354 mpz_out_str (stdout, 10, p->value.integer);
356 if (p->ts.kind != gfc_default_integer_kind)
357 gfc_status ("_%d", p->ts.kind);
361 if (p->value.logical)
362 gfc_status (".true.");
364 gfc_status (".false.");
368 mpfr_out_str (stdout, 10, 0, p->value.real, GFC_RND_MODE);
369 if (p->ts.kind != gfc_default_real_kind)
370 gfc_status ("_%d", p->ts.kind);
374 c = p->value.character.string;
376 gfc_status_char ('\'');
378 for (i = 0; i < p->value.character.length; i++, c++)
383 gfc_status_char (*c);
386 gfc_status_char ('\'');
391 gfc_status ("(complex ");
393 mpfr_out_str (stdout, 10, 0, p->value.complex.r, GFC_RND_MODE);
394 if (p->ts.kind != gfc_default_complex_kind)
395 gfc_status ("_%d", p->ts.kind);
399 mpfr_out_str (stdout, 10, 0, p->value.complex.i, GFC_RND_MODE);
400 if (p->ts.kind != gfc_default_complex_kind)
401 gfc_status ("_%d", p->ts.kind);
414 if (p->symtree->n.sym->ns && p->symtree->n.sym->ns->proc_name)
415 gfc_status ("%s:", p->symtree->n.sym->ns->proc_name->name);
416 gfc_status ("%s", p->symtree->n.sym->name);
417 gfc_show_ref (p->ref);
422 switch (p->value.op.operator)
424 case INTRINSIC_UPLUS:
427 case INTRINSIC_UMINUS:
433 case INTRINSIC_MINUS:
436 case INTRINSIC_TIMES:
439 case INTRINSIC_DIVIDE:
442 case INTRINSIC_POWER:
445 case INTRINSIC_CONCAT:
458 gfc_status ("NEQV ");
481 case INTRINSIC_PARENTHESES:
482 gfc_status ("parens");
487 ("gfc_show_expr(): Bad intrinsic in expression!");
490 gfc_show_expr (p->value.op.op1);
495 gfc_show_expr (p->value.op.op2);
502 if (p->value.function.name == NULL)
504 gfc_status ("%s[", p->symtree->n.sym->name);
505 gfc_show_actual_arglist (p->value.function.actual);
506 gfc_status_char (']');
510 gfc_status ("%s[[", p->value.function.name);
511 gfc_show_actual_arglist (p->value.function.actual);
512 gfc_status_char (']');
513 gfc_status_char (']');
519 gfc_internal_error ("gfc_show_expr(): Don't know how to show expr");
524 /* Show symbol attributes. The flavor and intent are followed by
525 whatever single bit attributes are present. */
528 gfc_show_attr (symbol_attribute * attr)
531 gfc_status ("(%s %s %s %s", gfc_code2string (flavors, attr->flavor),
532 gfc_intent_string (attr->intent),
533 gfc_code2string (access_types, attr->access),
534 gfc_code2string (procedures, attr->proc));
536 if (attr->allocatable)
537 gfc_status (" ALLOCATABLE");
539 gfc_status (" DIMENSION");
541 gfc_status (" EXTERNAL");
543 gfc_status (" INTRINSIC");
545 gfc_status (" OPTIONAL");
547 gfc_status (" POINTER");
549 gfc_status (" SAVE");
551 gfc_status (" TARGET");
553 gfc_status (" DUMMY");
555 gfc_status (" RESULT");
557 gfc_status (" ENTRY");
560 gfc_status (" DATA");
562 gfc_status (" USE-ASSOC");
563 if (attr->in_namelist)
564 gfc_status (" IN-NAMELIST");
566 gfc_status (" IN-COMMON");
569 gfc_status (" FUNCTION");
570 if (attr->subroutine)
571 gfc_status (" SUBROUTINE");
572 if (attr->implicit_type)
573 gfc_status (" IMPLICIT-TYPE");
576 gfc_status (" SEQUENCE");
578 gfc_status (" ELEMENTAL");
580 gfc_status (" PURE");
582 gfc_status (" RECURSIVE");
588 /* Show components of a derived type. */
591 gfc_show_components (gfc_symbol * sym)
595 for (c = sym->components; c; c = c->next)
597 gfc_status ("(%s ", c->name);
598 gfc_show_typespec (&c->ts);
600 gfc_status (" POINTER");
602 gfc_status (" DIMENSION");
603 gfc_status_char (' ');
604 gfc_show_array_spec (c->as);
607 gfc_status_char (' ');
612 /* Show a symbol. If a symbol is an ENTRY, SUBROUTINE or FUNCTION, we
613 show the interface. Information needed to reconstruct the list of
614 specific interfaces associated with a generic symbol is done within
618 gfc_show_symbol (gfc_symbol * sym)
620 gfc_formal_arglist *formal;
628 gfc_status ("symbol %s ", sym->name);
629 gfc_show_typespec (&sym->ts);
630 gfc_show_attr (&sym->attr);
635 gfc_status ("value: ");
636 gfc_show_expr (sym->value);
642 gfc_status ("Array spec:");
643 gfc_show_array_spec (sym->as);
649 gfc_status ("Generic interfaces:");
650 for (intr = sym->generic; intr; intr = intr->next)
651 gfc_status (" %s", intr->sym->name);
657 gfc_status ("result: %s", sym->result->name);
663 gfc_status ("components: ");
664 gfc_show_components (sym);
670 gfc_status ("Formal arglist:");
672 for (formal = sym->formal; formal; formal = formal->next)
674 if (formal->sym != NULL)
675 gfc_status (" %s", formal->sym->name);
677 gfc_status (" [Alt Return]");
684 gfc_status ("Formal namespace");
685 gfc_show_namespace (sym->formal_ns);
688 gfc_status_char ('\n');
692 /* Show a user-defined operator. Just prints an operator
693 and the name of the associated subroutine, really. */
696 show_uop (gfc_user_op * uop)
701 gfc_status ("%s:", uop->name);
703 for (intr = uop->operator; intr; intr = intr->next)
704 gfc_status (" %s", intr->sym->name);
708 /* Workhorse function for traversing the user operator symtree. */
711 traverse_uop (gfc_symtree * st, void (*func) (gfc_user_op *))
719 traverse_uop (st->left, func);
720 traverse_uop (st->right, func);
724 /* Traverse the tree of user operator nodes. */
727 gfc_traverse_user_op (gfc_namespace * ns, void (*func) (gfc_user_op *))
730 traverse_uop (ns->uop_root, func);
734 /* Function to display a common block. */
737 show_common (gfc_symtree * st)
742 gfc_status ("common: /%s/ ", st->name);
744 s = st->n.common->head;
747 gfc_status ("%s", s->name);
752 gfc_status_char ('\n');
756 /* Worker function to display the symbol tree. */
759 show_symtree (gfc_symtree * st)
763 gfc_status ("symtree: %s Ambig %d", st->name, st->ambiguous);
765 if (st->n.sym->ns != gfc_current_ns)
766 gfc_status (" from namespace %s", st->n.sym->ns->proc_name->name);
768 gfc_show_symbol (st->n.sym);
772 /******************* Show gfc_code structures **************/
776 static void gfc_show_code_node (int level, gfc_code * c);
778 /* Show a list of code structures. Mutually recursive with
779 gfc_show_code_node(). */
782 gfc_show_code (int level, gfc_code * c)
785 for (; c; c = c->next)
786 gfc_show_code_node (level, c);
790 /* Show a single code node and everything underneath it if necessary. */
793 gfc_show_code_node (int level, gfc_code * c)
795 gfc_forall_iterator *fa;
805 code_indent (level, c->here);
814 gfc_status ("CONTINUE");
818 gfc_status ("ENTRY %s", c->ext.entry->sym->name);
822 gfc_status ("ASSIGN ");
823 gfc_show_expr (c->expr);
824 gfc_status_char (' ');
825 gfc_show_expr (c->expr2);
828 case EXEC_LABEL_ASSIGN:
829 gfc_status ("LABEL ASSIGN ");
830 gfc_show_expr (c->expr);
831 gfc_status (" %d", c->label->value);
834 case EXEC_POINTER_ASSIGN:
835 gfc_status ("POINTER ASSIGN ");
836 gfc_show_expr (c->expr);
837 gfc_status_char (' ');
838 gfc_show_expr (c->expr2);
842 gfc_status ("GOTO ");
844 gfc_status ("%d", c->label->value);
847 gfc_show_expr (c->expr);
852 for (; d; d = d ->block)
854 code_indent (level, d->label);
855 if (d->block != NULL)
856 gfc_status_char (',');
858 gfc_status_char (')');
865 gfc_status ("CALL %s ", c->resolved_sym->name);
866 gfc_show_actual_arglist (c->ext.actual);
870 gfc_status ("RETURN ");
872 gfc_show_expr (c->expr);
876 gfc_status ("PAUSE ");
879 gfc_show_expr (c->expr);
881 gfc_status ("%d", c->ext.stop_code);
886 gfc_status ("STOP ");
889 gfc_show_expr (c->expr);
891 gfc_status ("%d", c->ext.stop_code);
895 case EXEC_ARITHMETIC_IF:
897 gfc_show_expr (c->expr);
898 gfc_status (" %d, %d, %d",
899 c->label->value, c->label2->value, c->label3->value);
905 gfc_show_expr (d->expr);
906 gfc_status_char ('\n');
907 gfc_show_code (level + 1, d->next);
910 for (; d; d = d->block)
912 code_indent (level, 0);
915 gfc_status ("ELSE\n");
918 gfc_status ("ELSE IF ");
919 gfc_show_expr (d->expr);
920 gfc_status_char ('\n');
923 gfc_show_code (level + 1, d->next);
926 code_indent (level, c->label);
928 gfc_status ("ENDIF");
933 gfc_status ("SELECT CASE ");
934 gfc_show_expr (c->expr);
935 gfc_status_char ('\n');
937 for (; d; d = d->block)
939 code_indent (level, 0);
941 gfc_status ("CASE ");
942 for (cp = d->ext.case_list; cp; cp = cp->next)
944 gfc_status_char ('(');
945 gfc_show_expr (cp->low);
946 gfc_status_char (' ');
947 gfc_show_expr (cp->high);
948 gfc_status_char (')');
949 gfc_status_char (' ');
951 gfc_status_char ('\n');
953 gfc_show_code (level + 1, d->next);
956 code_indent (level, c->label);
957 gfc_status ("END SELECT");
961 gfc_status ("WHERE ");
964 gfc_show_expr (d->expr);
965 gfc_status_char ('\n');
967 gfc_show_code (level + 1, d->next);
969 for (d = d->block; d; d = d->block)
971 code_indent (level, 0);
972 gfc_status ("ELSE WHERE ");
973 gfc_show_expr (d->expr);
974 gfc_status_char ('\n');
975 gfc_show_code (level + 1, d->next);
978 code_indent (level, 0);
979 gfc_status ("END WHERE");
984 gfc_status ("FORALL ");
985 for (fa = c->ext.forall_iterator; fa; fa = fa->next)
987 gfc_show_expr (fa->var);
988 gfc_status_char (' ');
989 gfc_show_expr (fa->start);
990 gfc_status_char (':');
991 gfc_show_expr (fa->end);
992 gfc_status_char (':');
993 gfc_show_expr (fa->stride);
995 if (fa->next != NULL)
996 gfc_status_char (',');
1001 gfc_status_char (',');
1002 gfc_show_expr (c->expr);
1004 gfc_status_char ('\n');
1006 gfc_show_code (level + 1, c->block->next);
1008 code_indent (level, 0);
1009 gfc_status ("END FORALL");
1015 gfc_show_expr (c->ext.iterator->var);
1016 gfc_status_char ('=');
1017 gfc_show_expr (c->ext.iterator->start);
1018 gfc_status_char (' ');
1019 gfc_show_expr (c->ext.iterator->end);
1020 gfc_status_char (' ');
1021 gfc_show_expr (c->ext.iterator->step);
1022 gfc_status_char ('\n');
1024 gfc_show_code (level + 1, c->block->next);
1026 code_indent (level, 0);
1027 gfc_status ("END DO");
1031 gfc_status ("DO WHILE ");
1032 gfc_show_expr (c->expr);
1033 gfc_status_char ('\n');
1035 gfc_show_code (level + 1, c->block->next);
1037 code_indent (level, c->label);
1038 gfc_status ("END DO");
1042 gfc_status ("CYCLE");
1044 gfc_status (" %s", c->symtree->n.sym->name);
1048 gfc_status ("EXIT");
1050 gfc_status (" %s", c->symtree->n.sym->name);
1054 gfc_status ("ALLOCATE ");
1057 gfc_status (" STAT=");
1058 gfc_show_expr (c->expr);
1061 for (a = c->ext.alloc_list; a; a = a->next)
1063 gfc_status_char (' ');
1064 gfc_show_expr (a->expr);
1069 case EXEC_DEALLOCATE:
1070 gfc_status ("DEALLOCATE ");
1073 gfc_status (" STAT=");
1074 gfc_show_expr (c->expr);
1077 for (a = c->ext.alloc_list; a; a = a->next)
1079 gfc_status_char (' ');
1080 gfc_show_expr (a->expr);
1086 gfc_status ("OPEN");
1091 gfc_status (" UNIT=");
1092 gfc_show_expr (open->unit);
1096 gfc_status (" IOMSG=");
1097 gfc_show_expr (open->iomsg);
1101 gfc_status (" IOSTAT=");
1102 gfc_show_expr (open->iostat);
1106 gfc_status (" FILE=");
1107 gfc_show_expr (open->file);
1111 gfc_status (" STATUS=");
1112 gfc_show_expr (open->status);
1116 gfc_status (" ACCESS=");
1117 gfc_show_expr (open->access);
1121 gfc_status (" FORM=");
1122 gfc_show_expr (open->form);
1126 gfc_status (" RECL=");
1127 gfc_show_expr (open->recl);
1131 gfc_status (" BLANK=");
1132 gfc_show_expr (open->blank);
1136 gfc_status (" POSITION=");
1137 gfc_show_expr (open->position);
1141 gfc_status (" ACTION=");
1142 gfc_show_expr (open->action);
1146 gfc_status (" DELIM=");
1147 gfc_show_expr (open->delim);
1151 gfc_status (" PAD=");
1152 gfc_show_expr (open->pad);
1156 gfc_status (" CONVERT=");
1157 gfc_show_expr (open->convert);
1159 if (open->err != NULL)
1160 gfc_status (" ERR=%d", open->err->value);
1165 gfc_status ("CLOSE");
1166 close = c->ext.close;
1170 gfc_status (" UNIT=");
1171 gfc_show_expr (close->unit);
1175 gfc_status (" IOMSG=");
1176 gfc_show_expr (close->iomsg);
1180 gfc_status (" IOSTAT=");
1181 gfc_show_expr (close->iostat);
1185 gfc_status (" STATUS=");
1186 gfc_show_expr (close->status);
1188 if (close->err != NULL)
1189 gfc_status (" ERR=%d", close->err->value);
1192 case EXEC_BACKSPACE:
1193 gfc_status ("BACKSPACE");
1197 gfc_status ("ENDFILE");
1201 gfc_status ("REWIND");
1205 gfc_status ("FLUSH");
1208 fp = c->ext.filepos;
1212 gfc_status (" UNIT=");
1213 gfc_show_expr (fp->unit);
1217 gfc_status (" IOMSG=");
1218 gfc_show_expr (fp->iomsg);
1222 gfc_status (" IOSTAT=");
1223 gfc_show_expr (fp->iostat);
1225 if (fp->err != NULL)
1226 gfc_status (" ERR=%d", fp->err->value);
1230 gfc_status ("INQUIRE");
1235 gfc_status (" UNIT=");
1236 gfc_show_expr (i->unit);
1240 gfc_status (" FILE=");
1241 gfc_show_expr (i->file);
1246 gfc_status (" IOMSG=");
1247 gfc_show_expr (i->iomsg);
1251 gfc_status (" IOSTAT=");
1252 gfc_show_expr (i->iostat);
1256 gfc_status (" EXIST=");
1257 gfc_show_expr (i->exist);
1261 gfc_status (" OPENED=");
1262 gfc_show_expr (i->opened);
1266 gfc_status (" NUMBER=");
1267 gfc_show_expr (i->number);
1271 gfc_status (" NAMED=");
1272 gfc_show_expr (i->named);
1276 gfc_status (" NAME=");
1277 gfc_show_expr (i->name);
1281 gfc_status (" ACCESS=");
1282 gfc_show_expr (i->access);
1286 gfc_status (" SEQUENTIAL=");
1287 gfc_show_expr (i->sequential);
1292 gfc_status (" DIRECT=");
1293 gfc_show_expr (i->direct);
1297 gfc_status (" FORM=");
1298 gfc_show_expr (i->form);
1302 gfc_status (" FORMATTED");
1303 gfc_show_expr (i->formatted);
1307 gfc_status (" UNFORMATTED=");
1308 gfc_show_expr (i->unformatted);
1312 gfc_status (" RECL=");
1313 gfc_show_expr (i->recl);
1317 gfc_status (" NEXTREC=");
1318 gfc_show_expr (i->nextrec);
1322 gfc_status (" BLANK=");
1323 gfc_show_expr (i->blank);
1327 gfc_status (" POSITION=");
1328 gfc_show_expr (i->position);
1332 gfc_status (" ACTION=");
1333 gfc_show_expr (i->action);
1337 gfc_status (" READ=");
1338 gfc_show_expr (i->read);
1342 gfc_status (" WRITE=");
1343 gfc_show_expr (i->write);
1347 gfc_status (" READWRITE=");
1348 gfc_show_expr (i->readwrite);
1352 gfc_status (" DELIM=");
1353 gfc_show_expr (i->delim);
1357 gfc_status (" PAD=");
1358 gfc_show_expr (i->pad);
1362 gfc_status (" CONVERT=");
1363 gfc_show_expr (i->convert);
1367 gfc_status (" ERR=%d", i->err->value);
1371 gfc_status ("IOLENGTH ");
1372 gfc_show_expr (c->expr);
1377 gfc_status ("READ");
1381 gfc_status ("WRITE");
1387 gfc_status (" UNIT=");
1388 gfc_show_expr (dt->io_unit);
1391 if (dt->format_expr)
1393 gfc_status (" FMT=");
1394 gfc_show_expr (dt->format_expr);
1397 if (dt->format_label != NULL)
1398 gfc_status (" FMT=%d", dt->format_label->value);
1400 gfc_status (" NML=%s", dt->namelist->name);
1404 gfc_status (" IOMSG=");
1405 gfc_show_expr (dt->iomsg);
1409 gfc_status (" IOSTAT=");
1410 gfc_show_expr (dt->iostat);
1414 gfc_status (" SIZE=");
1415 gfc_show_expr (dt->size);
1419 gfc_status (" REC=");
1420 gfc_show_expr (dt->rec);
1424 gfc_status (" ADVANCE=");
1425 gfc_show_expr (dt->advance);
1429 gfc_status_char ('\n');
1430 for (c = c->block->next; c; c = c->next)
1431 gfc_show_code_node (level + (c->next != NULL), c);
1435 gfc_status ("TRANSFER ");
1436 gfc_show_expr (c->expr);
1440 gfc_status ("DT_END");
1443 if (dt->err != NULL)
1444 gfc_status (" ERR=%d", dt->err->value);
1445 if (dt->end != NULL)
1446 gfc_status (" END=%d", dt->end->value);
1447 if (dt->eor != NULL)
1448 gfc_status (" EOR=%d", dt->eor->value);
1452 gfc_internal_error ("gfc_show_code_node(): Bad statement code");
1455 gfc_status_char ('\n');
1459 /* Show an equivalence chain. */
1462 gfc_show_equiv (gfc_equiv *eq)
1465 gfc_status ("Equivalence: ");
1468 gfc_show_expr (eq->expr);
1476 /* Show a freakin' whole namespace. */
1479 gfc_show_namespace (gfc_namespace * ns)
1481 gfc_interface *intr;
1482 gfc_namespace *save;
1483 gfc_intrinsic_op op;
1487 save = gfc_current_ns;
1491 gfc_status ("Namespace:");
1499 while (i < GFC_LETTERS - 1
1500 && gfc_compare_types(&ns->default_type[i+1],
1501 &ns->default_type[l]))
1505 gfc_status(" %c-%c: ", l+'A', i+'A');
1507 gfc_status(" %c: ", l+'A');
1509 gfc_show_typespec(&ns->default_type[l]);
1511 } while (i < GFC_LETTERS);
1513 if (ns->proc_name != NULL)
1516 gfc_status ("procedure name = %s", ns->proc_name->name);
1519 gfc_current_ns = ns;
1520 gfc_traverse_symtree (ns->common_root, show_common);
1522 gfc_traverse_symtree (ns->sym_root, show_symtree);
1524 for (op = GFC_INTRINSIC_BEGIN; op != GFC_INTRINSIC_END; op++)
1526 /* User operator interfaces */
1527 intr = ns->operator[op];
1532 gfc_status ("Operator interfaces for %s:", gfc_op2string (op));
1534 for (; intr; intr = intr->next)
1535 gfc_status (" %s", intr->sym->name);
1538 if (ns->uop_root != NULL)
1541 gfc_status ("User operators:\n");
1542 gfc_traverse_user_op (ns, show_uop);
1546 for (eq = ns->equiv; eq; eq = eq->next)
1547 gfc_show_equiv (eq);
1549 gfc_status_char ('\n');
1550 gfc_status_char ('\n');
1552 gfc_show_code (0, ns->code);
1554 for (ns = ns->contained; ns; ns = ns->sibling)
1557 gfc_status ("CONTAINS\n");
1558 gfc_show_namespace (ns);
1562 gfc_status_char ('\n');
1563 gfc_current_ns = save;