Commit d32e1fd8 by Thomas Koenig

dump-parse-tree.c (show_code): Add prototype.

2016-11-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* dump-parse-tree.c (show_code):  Add prototype.
	(gfc_debug_code):  New function.
	(show_code_node):  Add space after SELECT TYPE.

From-SVN: r242393
parent d809e15a
2016-11-14 Thomas Koenig <tkoenig@gcc.gnu.org>
* dump-parse-tree.c (show_code): Add prototype.
(gfc_debug_code): New function.
(show_code_node): Add space after SELECT TYPE.
2016-11-14 Janus Weil <janus@gcc.gnu.org> 2016-11-14 Janus Weil <janus@gcc.gnu.org>
PR fortran/78300 PR fortran/78300
......
...@@ -47,6 +47,7 @@ static FILE *dumpfile; ...@@ -47,6 +47,7 @@ static FILE *dumpfile;
static void show_expr (gfc_expr *p); static void show_expr (gfc_expr *p);
static void show_code_node (int, gfc_code *); static void show_code_node (int, gfc_code *);
static void show_namespace (gfc_namespace *ns); static void show_namespace (gfc_namespace *ns);
static void show_code (int, gfc_code *);
/* Allow dumping of an expression in the debugger. */ /* Allow dumping of an expression in the debugger. */
...@@ -62,6 +63,18 @@ gfc_debug_expr (gfc_expr *e) ...@@ -62,6 +63,18 @@ gfc_debug_expr (gfc_expr *e)
dumpfile = tmp; dumpfile = tmp;
} }
/* Allow for dumping of a piece of code in the debugger. */
void gfc_debug_code (gfc_code *c);
void
gfc_debug_code (gfc_code *c)
{
FILE *tmp = dumpfile;
dumpfile = stderr;
show_code (1, c);
fputc ('\n', dumpfile);
dumpfile = tmp;
}
/* Do indentation for a specific level. */ /* Do indentation for a specific level. */
...@@ -1987,7 +2000,7 @@ show_code_node (int level, gfc_code *c) ...@@ -1987,7 +2000,7 @@ show_code_node (int level, gfc_code *c)
case EXEC_SELECT_TYPE: case EXEC_SELECT_TYPE:
d = c->block; d = c->block;
if (c->op == EXEC_SELECT_TYPE) if (c->op == EXEC_SELECT_TYPE)
fputs ("SELECT TYPE", dumpfile); fputs ("SELECT TYPE ", dumpfile);
else else
fputs ("SELECT CASE ", dumpfile); fputs ("SELECT CASE ", dumpfile);
show_expr (c->expr1); show_expr (c->expr1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment