mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-15 16:21:27 +08:00
Show coarrays on parse tree dump, implement debug for array references.
gcc/fortran/ChangeLog: * dump-parse-tree.c (show_array_ref): Also show coarrays. (debug): Implement for array reference.
This commit is contained in:
parent
f1eeabc1fd
commit
501f470267
@ -361,6 +361,31 @@ show_array_ref (gfc_array_ref * ar)
|
||||
}
|
||||
|
||||
fputc (')', dumpfile);
|
||||
if (ar->codimen == 0)
|
||||
return;
|
||||
|
||||
/* Show coarray part of the reference, if any. */
|
||||
fputc ('[',dumpfile);
|
||||
for (i = ar->dimen; i < ar->dimen + ar->codimen; i++)
|
||||
{
|
||||
if (ar->dimen_type[i] == DIMEN_STAR)
|
||||
fputc('*',dumpfile);
|
||||
else if (ar->dimen_type[i] == DIMEN_THIS_IMAGE)
|
||||
fputs("THIS_IMAGE", dumpfile);
|
||||
else
|
||||
{
|
||||
show_expr (ar->start[i]);
|
||||
if (ar->end[i])
|
||||
{
|
||||
fputc(':', dumpfile);
|
||||
show_expr (ar->end[i]);
|
||||
}
|
||||
}
|
||||
if (i != ar->dimen + ar->codimen - 1)
|
||||
fputs (" , ", dumpfile);
|
||||
|
||||
}
|
||||
fputc (']',dumpfile);
|
||||
}
|
||||
|
||||
|
||||
@ -3635,3 +3660,14 @@ gfc_dump_global_symbols (FILE *f)
|
||||
else
|
||||
gfc_traverse_gsymbol (gfc_gsym_root, show_global_symbol, (void *) f);
|
||||
}
|
||||
|
||||
/* Show an array ref. */
|
||||
|
||||
void debug (gfc_array_ref *ar)
|
||||
{
|
||||
FILE *tmp = dumpfile;
|
||||
dumpfile = stderr;
|
||||
show_array_ref (ar);
|
||||
fputc ('\n', dumpfile);
|
||||
dumpfile = tmp;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user