aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/dump-parse-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/dump-parse-tree.c')
-rw-r--r--gcc/fortran/dump-parse-tree.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c
index 3099ae8..f798ed0 100644
--- a/gcc/fortran/dump-parse-tree.c
+++ b/gcc/fortran/dump-parse-tree.c
@@ -48,11 +48,37 @@ static void show_expr (gfc_expr *p);
static void show_code_node (int, gfc_code *);
static void show_namespace (gfc_namespace *ns);
static void show_code (int, gfc_code *);
-
+static void show_symbol (gfc_symbol *);
+static void show_typespec (gfc_typespec *);
/* Allow dumping of an expression in the debugger. */
void gfc_debug_expr (gfc_expr *);
+void debug (gfc_expr *e)
+{
+ FILE *tmp = dumpfile;
+ dumpfile = stderr;
+ show_expr (e);
+ fputc (' ', dumpfile);
+ show_typespec (&e->ts);
+ fputc ('\n', dumpfile);
+ dumpfile = tmp;
+}
+
+void debug (gfc_typespec *ts)
+{
+ FILE *tmp = dumpfile;
+ dumpfile = stderr;
+ show_typespec (ts);
+ fputc ('\n', dumpfile);
+ dumpfile = tmp;
+}
+
+void debug (gfc_typespec ts)
+{
+ debug (&ts);
+}
+
void
gfc_debug_expr (gfc_expr *e)
{
@@ -76,6 +102,15 @@ gfc_debug_code (gfc_code *c)
dumpfile = tmp;
}
+void debug (gfc_symbol *sym)
+{
+ FILE *tmp = dumpfile;
+ dumpfile = stderr;
+ show_symbol (sym);
+ fputc ('\n', dumpfile);
+ dumpfile = tmp;
+}
+
/* Do indentation for a specific level. */
static inline void