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 ");
484 ("gfc_show_expr(): Bad intrinsic in expression!");
487 gfc_show_expr (p->value.op.op1);
492 gfc_show_expr (p->value.op.op2);
499 if (p->value.function.name == NULL)
501 gfc_status ("%s[", p->symtree->n.sym->name);
502 gfc_show_actual_arglist (p->value.function.actual);
503 gfc_status_char (']');
507 gfc_status ("%s[[", p->value.function.name);
508 gfc_show_actual_arglist (p->value.function.actual);
509 gfc_status_char (']');
510 gfc_status_char (']');
516 gfc_internal_error ("gfc_show_expr(): Don't know how to show expr");
521 /* Show symbol attributes. The flavor and intent are followed by
522 whatever single bit attributes are present. */
525 gfc_show_attr (symbol_attribute * attr)
528 gfc_status ("(%s %s %s %s", gfc_code2string (flavors, attr->flavor),
529 gfc_intent_string (attr->intent),
530 gfc_code2string (access_types, attr->access),
531 gfc_code2string (procedures, attr->proc));
533 if (attr->allocatable)
534 gfc_status (" ALLOCATABLE");
536 gfc_status (" DIMENSION");
538 gfc_status (" EXTERNAL");
540 gfc_status (" INTRINSIC");
542 gfc_status (" OPTIONAL");
544 gfc_status (" POINTER");
546 gfc_status (" SAVE");
548 gfc_status (" TARGET");
550 gfc_status (" DUMMY");
552 gfc_status (" RESULT");
554 gfc_status (" ENTRY");
557 gfc_status (" DATA");
559 gfc_status (" USE-ASSOC");
560 if (attr->in_namelist)
561 gfc_status (" IN-NAMELIST");
563 gfc_status (" IN-COMMON");
566 gfc_status (" FUNCTION");
567 if (attr->subroutine)
568 gfc_status (" SUBROUTINE");
569 if (attr->implicit_type)
570 gfc_status (" IMPLICIT-TYPE");
573 gfc_status (" SEQUENCE");
575 gfc_status (" ELEMENTAL");
577 gfc_status (" PURE");
579 gfc_status (" RECURSIVE");
585 /* Show components of a derived type. */
588 gfc_show_components (gfc_symbol * sym)
592 for (c = sym->components; c; c = c->next)
594 gfc_status ("(%s ", c->name);
595 gfc_show_typespec (&c->ts);
597 gfc_status (" POINTER");
599 gfc_status (" DIMENSION");
600 gfc_status_char (' ');
601 gfc_show_array_spec (c->as);
604 gfc_status_char (' ');
609 /* Show a symbol. If a symbol is an ENTRY, SUBROUTINE or FUNCTION, we
610 show the interface. Information needed to reconstruct the list of
611 specific interfaces associated with a generic symbol is done within
615 gfc_show_symbol (gfc_symbol * sym)
617 gfc_formal_arglist *formal;
625 gfc_status ("symbol %s ", sym->name);
626 gfc_show_typespec (&sym->ts);
627 gfc_show_attr (&sym->attr);
632 gfc_status ("value: ");
633 gfc_show_expr (sym->value);
639 gfc_status ("Array spec:");
640 gfc_show_array_spec (sym->as);
646 gfc_status ("Generic interfaces:");
647 for (intr = sym->generic; intr; intr = intr->next)
648 gfc_status (" %s", intr->sym->name);
654 gfc_status ("result: %s", sym->result->name);
660 gfc_status ("components: ");
661 gfc_show_components (sym);
667 gfc_status ("Formal arglist:");
669 for (formal = sym->formal; formal; formal = formal->next)
671 if (formal->sym != NULL)
672 gfc_status (" %s", formal->sym->name);
674 gfc_status (" [Alt Return]");
681 gfc_status ("Formal namespace");
682 gfc_show_namespace (sym->formal_ns);
685 gfc_status_char ('\n');
689 /* Show a user-defined operator. Just prints an operator
690 and the name of the associated subroutine, really. */
693 show_uop (gfc_user_op * uop)
698 gfc_status ("%s:", uop->name);
700 for (intr = uop->operator; intr; intr = intr->next)
701 gfc_status (" %s", intr->sym->name);
705 /* Workhorse function for traversing the user operator symtree. */
708 traverse_uop (gfc_symtree * st, void (*func) (gfc_user_op *))
716 traverse_uop (st->left, func);
717 traverse_uop (st->right, func);
721 /* Traverse the tree of user operator nodes. */
724 gfc_traverse_user_op (gfc_namespace * ns, void (*func) (gfc_user_op *))
727 traverse_uop (ns->uop_root, func);
731 /* Function to display a common block. */
734 show_common (gfc_symtree * st)
739 gfc_status ("common: /%s/ ", st->name);
741 s = st->n.common->head;
744 gfc_status ("%s", s->name);
749 gfc_status_char ('\n');
753 /* Worker function to display the symbol tree. */
756 show_symtree (gfc_symtree * st)
760 gfc_status ("symtree: %s Ambig %d", st->name, st->ambiguous);
762 if (st->n.sym->ns != gfc_current_ns)
763 gfc_status (" from namespace %s", st->n.sym->ns->proc_name->name);
765 gfc_show_symbol (st->n.sym);
769 /******************* Show gfc_code structures **************/
773 static void gfc_show_code_node (int level, gfc_code * c);
775 /* Show a list of code structures. Mutually recursive with
776 gfc_show_code_node(). */
779 gfc_show_code (int level, gfc_code * c)
782 for (; c; c = c->next)
783 gfc_show_code_node (level, c);
787 /* Show a single code node and everything underneath it if necessary. */
790 gfc_show_code_node (int level, gfc_code * c)
792 gfc_forall_iterator *fa;
802 code_indent (level, c->here);
811 gfc_status ("CONTINUE");
815 gfc_status ("ENTRY %s", c->ext.entry->sym->name);
819 gfc_status ("ASSIGN ");
820 gfc_show_expr (c->expr);
821 gfc_status_char (' ');
822 gfc_show_expr (c->expr2);
825 case EXEC_LABEL_ASSIGN:
826 gfc_status ("LABEL ASSIGN ");
827 gfc_show_expr (c->expr);
828 gfc_status (" %d", c->label->value);
831 case EXEC_POINTER_ASSIGN:
832 gfc_status ("POINTER ASSIGN ");
833 gfc_show_expr (c->expr);
834 gfc_status_char (' ');
835 gfc_show_expr (c->expr2);
839 gfc_status ("GOTO ");
841 gfc_status ("%d", c->label->value);
844 gfc_show_expr (c->expr);
849 for (; d; d = d ->block)
851 code_indent (level, d->label);
852 if (d->block != NULL)
853 gfc_status_char (',');
855 gfc_status_char (')');
862 gfc_status ("CALL %s ", c->resolved_sym->name);
863 gfc_show_actual_arglist (c->ext.actual);
867 gfc_status ("RETURN ");
869 gfc_show_expr (c->expr);
873 gfc_status ("PAUSE ");
876 gfc_show_expr (c->expr);
878 gfc_status ("%d", c->ext.stop_code);
883 gfc_status ("STOP ");
886 gfc_show_expr (c->expr);
888 gfc_status ("%d", c->ext.stop_code);
892 case EXEC_ARITHMETIC_IF:
894 gfc_show_expr (c->expr);
895 gfc_status (" %d, %d, %d",
896 c->label->value, c->label2->value, c->label3->value);
902 gfc_show_expr (d->expr);
903 gfc_status_char ('\n');
904 gfc_show_code (level + 1, d->next);
907 for (; d; d = d->block)
909 code_indent (level, 0);
912 gfc_status ("ELSE\n");
915 gfc_status ("ELSE IF ");
916 gfc_show_expr (d->expr);
917 gfc_status_char ('\n');
920 gfc_show_code (level + 1, d->next);
923 code_indent (level, c->label);
925 gfc_status ("ENDIF");
930 gfc_status ("SELECT CASE ");
931 gfc_show_expr (c->expr);
932 gfc_status_char ('\n');
934 for (; d; d = d->block)
936 code_indent (level, 0);
938 gfc_status ("CASE ");
939 for (cp = d->ext.case_list; cp; cp = cp->next)
941 gfc_status_char ('(');
942 gfc_show_expr (cp->low);
943 gfc_status_char (' ');
944 gfc_show_expr (cp->high);
945 gfc_status_char (')');
946 gfc_status_char (' ');
948 gfc_status_char ('\n');
950 gfc_show_code (level + 1, d->next);
953 code_indent (level, c->label);
954 gfc_status ("END SELECT");
958 gfc_status ("WHERE ");
961 gfc_show_expr (d->expr);
962 gfc_status_char ('\n');
964 gfc_show_code (level + 1, d->next);
966 for (d = d->block; d; d = d->block)
968 code_indent (level, 0);
969 gfc_status ("ELSE WHERE ");
970 gfc_show_expr (d->expr);
971 gfc_status_char ('\n');
972 gfc_show_code (level + 1, d->next);
975 code_indent (level, 0);
976 gfc_status ("END WHERE");
981 gfc_status ("FORALL ");
982 for (fa = c->ext.forall_iterator; fa; fa = fa->next)
984 gfc_show_expr (fa->var);
985 gfc_status_char (' ');
986 gfc_show_expr (fa->start);
987 gfc_status_char (':');
988 gfc_show_expr (fa->end);
989 gfc_status_char (':');
990 gfc_show_expr (fa->stride);
992 if (fa->next != NULL)
993 gfc_status_char (',');
998 gfc_status_char (',');
999 gfc_show_expr (c->expr);
1001 gfc_status_char ('\n');
1003 gfc_show_code (level + 1, c->block->next);
1005 code_indent (level, 0);
1006 gfc_status ("END FORALL");
1012 gfc_show_expr (c->ext.iterator->var);
1013 gfc_status_char ('=');
1014 gfc_show_expr (c->ext.iterator->start);
1015 gfc_status_char (' ');
1016 gfc_show_expr (c->ext.iterator->end);
1017 gfc_status_char (' ');
1018 gfc_show_expr (c->ext.iterator->step);
1019 gfc_status_char ('\n');
1021 gfc_show_code (level + 1, c->block->next);
1023 code_indent (level, 0);
1024 gfc_status ("END DO");
1028 gfc_status ("DO WHILE ");
1029 gfc_show_expr (c->expr);
1030 gfc_status_char ('\n');
1032 gfc_show_code (level + 1, c->block->next);
1034 code_indent (level, c->label);
1035 gfc_status ("END DO");
1039 gfc_status ("CYCLE");
1041 gfc_status (" %s", c->symtree->n.sym->name);
1045 gfc_status ("EXIT");
1047 gfc_status (" %s", c->symtree->n.sym->name);
1051 gfc_status ("ALLOCATE ");
1054 gfc_status (" STAT=");
1055 gfc_show_expr (c->expr);
1058 for (a = c->ext.alloc_list; a; a = a->next)
1060 gfc_status_char (' ');
1061 gfc_show_expr (a->expr);
1066 case EXEC_DEALLOCATE:
1067 gfc_status ("DEALLOCATE ");
1070 gfc_status (" STAT=");
1071 gfc_show_expr (c->expr);
1074 for (a = c->ext.alloc_list; a; a = a->next)
1076 gfc_status_char (' ');
1077 gfc_show_expr (a->expr);
1083 gfc_status ("OPEN");
1088 gfc_status (" UNIT=");
1089 gfc_show_expr (open->unit);
1093 gfc_status (" IOMSG=");
1094 gfc_show_expr (open->iomsg);
1098 gfc_status (" IOSTAT=");
1099 gfc_show_expr (open->iostat);
1103 gfc_status (" FILE=");
1104 gfc_show_expr (open->file);
1108 gfc_status (" STATUS=");
1109 gfc_show_expr (open->status);
1113 gfc_status (" ACCESS=");
1114 gfc_show_expr (open->access);
1118 gfc_status (" FORM=");
1119 gfc_show_expr (open->form);
1123 gfc_status (" RECL=");
1124 gfc_show_expr (open->recl);
1128 gfc_status (" BLANK=");
1129 gfc_show_expr (open->blank);
1133 gfc_status (" POSITION=");
1134 gfc_show_expr (open->position);
1138 gfc_status (" ACTION=");
1139 gfc_show_expr (open->action);
1143 gfc_status (" DELIM=");
1144 gfc_show_expr (open->delim);
1148 gfc_status (" PAD=");
1149 gfc_show_expr (open->pad);
1151 if (open->err != NULL)
1152 gfc_status (" ERR=%d", open->err->value);
1157 gfc_status ("CLOSE");
1158 close = c->ext.close;
1162 gfc_status (" UNIT=");
1163 gfc_show_expr (close->unit);
1167 gfc_status (" IOMSG=");
1168 gfc_show_expr (close->iomsg);
1172 gfc_status (" IOSTAT=");
1173 gfc_show_expr (close->iostat);
1177 gfc_status (" STATUS=");
1178 gfc_show_expr (close->status);
1180 if (close->err != NULL)
1181 gfc_status (" ERR=%d", close->err->value);
1184 case EXEC_BACKSPACE:
1185 gfc_status ("BACKSPACE");
1189 gfc_status ("ENDFILE");
1193 gfc_status ("REWIND");
1197 gfc_status ("FLUSH");
1200 fp = c->ext.filepos;
1204 gfc_status (" UNIT=");
1205 gfc_show_expr (fp->unit);
1209 gfc_status (" IOMSG=");
1210 gfc_show_expr (fp->iomsg);
1214 gfc_status (" IOSTAT=");
1215 gfc_show_expr (fp->iostat);
1217 if (fp->err != NULL)
1218 gfc_status (" ERR=%d", fp->err->value);
1222 gfc_status ("INQUIRE");
1227 gfc_status (" UNIT=");
1228 gfc_show_expr (i->unit);
1232 gfc_status (" FILE=");
1233 gfc_show_expr (i->file);
1238 gfc_status (" IOMSG=");
1239 gfc_show_expr (i->iomsg);
1243 gfc_status (" IOSTAT=");
1244 gfc_show_expr (i->iostat);
1248 gfc_status (" EXIST=");
1249 gfc_show_expr (i->exist);
1253 gfc_status (" OPENED=");
1254 gfc_show_expr (i->opened);
1258 gfc_status (" NUMBER=");
1259 gfc_show_expr (i->number);
1263 gfc_status (" NAMED=");
1264 gfc_show_expr (i->named);
1268 gfc_status (" NAME=");
1269 gfc_show_expr (i->name);
1273 gfc_status (" ACCESS=");
1274 gfc_show_expr (i->access);
1278 gfc_status (" SEQUENTIAL=");
1279 gfc_show_expr (i->sequential);
1284 gfc_status (" DIRECT=");
1285 gfc_show_expr (i->direct);
1289 gfc_status (" FORM=");
1290 gfc_show_expr (i->form);
1294 gfc_status (" FORMATTED");
1295 gfc_show_expr (i->formatted);
1299 gfc_status (" UNFORMATTED=");
1300 gfc_show_expr (i->unformatted);
1304 gfc_status (" RECL=");
1305 gfc_show_expr (i->recl);
1309 gfc_status (" NEXTREC=");
1310 gfc_show_expr (i->nextrec);
1314 gfc_status (" BLANK=");
1315 gfc_show_expr (i->blank);
1319 gfc_status (" POSITION=");
1320 gfc_show_expr (i->position);
1324 gfc_status (" ACTION=");
1325 gfc_show_expr (i->action);
1329 gfc_status (" READ=");
1330 gfc_show_expr (i->read);
1334 gfc_status (" WRITE=");
1335 gfc_show_expr (i->write);
1339 gfc_status (" READWRITE=");
1340 gfc_show_expr (i->readwrite);
1344 gfc_status (" DELIM=");
1345 gfc_show_expr (i->delim);
1349 gfc_status (" PAD=");
1350 gfc_show_expr (i->pad);
1354 gfc_status (" ERR=%d", i->err->value);
1358 gfc_status ("IOLENGTH ");
1359 gfc_show_expr (c->expr);
1363 gfc_status ("READ");
1367 gfc_status ("WRITE");
1373 gfc_status (" UNIT=");
1374 gfc_show_expr (dt->io_unit);
1377 if (dt->format_expr)
1379 gfc_status (" FMT=");
1380 gfc_show_expr (dt->format_expr);
1383 if (dt->format_label != NULL)
1384 gfc_status (" FMT=%d", dt->format_label->value);
1386 gfc_status (" NML=%s", dt->namelist->name);
1390 gfc_status (" IOMSG=");
1391 gfc_show_expr (dt->iomsg);
1395 gfc_status (" IOSTAT=");
1396 gfc_show_expr (dt->iostat);
1400 gfc_status (" SIZE=");
1401 gfc_show_expr (dt->size);
1405 gfc_status (" REC=");
1406 gfc_show_expr (dt->rec);
1410 gfc_status (" ADVANCE=");
1411 gfc_show_expr (dt->advance);
1417 gfc_status ("TRANSFER ");
1418 gfc_show_expr (c->expr);
1422 gfc_status ("DT_END");
1425 if (dt->err != NULL)
1426 gfc_status (" ERR=%d", dt->err->value);
1427 if (dt->end != NULL)
1428 gfc_status (" END=%d", dt->end->value);
1429 if (dt->eor != NULL)
1430 gfc_status (" EOR=%d", dt->eor->value);
1434 gfc_internal_error ("gfc_show_code_node(): Bad statement code");
1437 gfc_status_char ('\n');
1441 /* Show an equivalence chain. */
1444 gfc_show_equiv (gfc_equiv *eq)
1447 gfc_status ("Equivalence: ");
1450 gfc_show_expr (eq->expr);
1458 /* Show a freakin' whole namespace. */
1461 gfc_show_namespace (gfc_namespace * ns)
1463 gfc_interface *intr;
1464 gfc_namespace *save;
1465 gfc_intrinsic_op op;
1469 save = gfc_current_ns;
1473 gfc_status ("Namespace:");
1481 while (i < GFC_LETTERS - 1
1482 && gfc_compare_types(&ns->default_type[i+1],
1483 &ns->default_type[l]))
1487 gfc_status(" %c-%c: ", l+'A', i+'A');
1489 gfc_status(" %c: ", l+'A');
1491 gfc_show_typespec(&ns->default_type[l]);
1493 } while (i < GFC_LETTERS);
1495 if (ns->proc_name != NULL)
1498 gfc_status ("procedure name = %s", ns->proc_name->name);
1501 gfc_current_ns = ns;
1502 gfc_traverse_symtree (ns->common_root, show_common);
1504 gfc_traverse_symtree (ns->sym_root, show_symtree);
1506 for (op = GFC_INTRINSIC_BEGIN; op != GFC_INTRINSIC_END; op++)
1508 /* User operator interfaces */
1509 intr = ns->operator[op];
1514 gfc_status ("Operator interfaces for %s:", gfc_op2string (op));
1516 for (; intr; intr = intr->next)
1517 gfc_status (" %s", intr->sym->name);
1520 if (ns->uop_root != NULL)
1523 gfc_status ("User operators:\n");
1524 gfc_traverse_user_op (ns, show_uop);
1528 for (eq = ns->equiv; eq; eq = eq->next)
1529 gfc_show_equiv (eq);
1531 gfc_status_char ('\n');
1532 gfc_status_char ('\n');
1534 gfc_show_code (0, ns->code);
1536 for (ns = ns->contained; ns; ns = ns->sibling)
1539 gfc_status ("CONTAINS\n");
1540 gfc_show_namespace (ns);
1544 gfc_status_char ('\n');
1545 gfc_current_ns = save;