From 5ea0d4df1e599d967b02fd4dad59796554f7f263 Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Thu, 21 Feb 2019 18:03:30 +0000 Subject: [PATCH] dump-parse-tree.c (debug): Implement for gfc_expr *, gfc_typespec *, gfc_typespec and gfc_symbol *. 2019-02-21 Thomas Koenig * dump-parse-tree.c (debug): Implement for gfc_expr *, gfc_typespec *, gfc_typespec and gfc_symbol *. From-SVN: r269071 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/dump-parse-tree.c | 37 ++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f8df63db99b..c3bc30c42f6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2019-02-21 Thomas Koenig + + * dump-parse-tree.c (debug): Implement for gfc_expr *, + gfc_typespec *, gfc_typespec and gfc_symbol *. + 2019-02-21 Thomas Koenig PR fortran/86119 diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c index 3099ae86e5e..f798ed0a447 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 -- 2.30.2