diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2021-06-11 15:37:33 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2021-06-12 00:06:01 +0200 |
commit | 2973090c4c62105cbb61bfc6f83be903e3c46c71 (patch) | |
tree | 497117a016b456c3b565ac6ab1fc2b256b6be322 /gcc/tree-pretty-print.c | |
parent | b0d73a66ae3962fa83309527d85613d72a6aa43d (diff) | |
download | gcc-2973090c4c62105cbb61bfc6f83be903e3c46c71.zip gcc-2973090c4c62105cbb61bfc6f83be903e3c46c71.tar.gz gcc-2973090c4c62105cbb61bfc6f83be903e3c46c71.tar.bz2 |
For 'OMP_CLAUSE' in 'dump_generic_node', dump the whole OMP clause chain
... instead of just the first clause.
gcc/
* tree-pretty-print.h (dump_omp_clauses): Add 'bool = true'
default argument.
* tree-pretty-print.c (dump_omp_clauses): Update.
(dump_generic_node) <OMP_CLAUSE>: Use it.
gcc/testsuite/
* gcc.dg/gomp/simd-clones-2.c: Enhance.
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r-- | gcc/tree-pretty-print.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index d8a4f55..bcbe669 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -442,8 +442,9 @@ dump_omp_iterators (pretty_printer *pp, tree iter, int spc, dump_flags_t flags) } -/* Dump OpenMP clause CLAUSE. PP, CLAUSE, SPC and FLAGS are as in - dump_generic_node. */ +/* Dump OMP clause CLAUSE, without following OMP_CLAUSE_CHAIN. + + PP, CLAUSE, SPC and FLAGS are as in dump_generic_node. */ static void dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags) @@ -1315,23 +1316,22 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags) } -/* Dump the list of OpenMP clauses. PP, SPC and FLAGS are as in - dump_generic_node. */ +/* Dump chain of OMP clauses. + + PP, SPC and FLAGS are as in dump_generic_node. */ void -dump_omp_clauses (pretty_printer *pp, tree clause, int spc, dump_flags_t flags) +dump_omp_clauses (pretty_printer *pp, tree clause, int spc, dump_flags_t flags, + bool leading_space) { - if (clause == NULL) - return; - - pp_space (pp); - while (1) + while (clause) { + if (leading_space) + pp_space (pp); dump_omp_clause (pp, clause, spc, flags); + leading_space = true; + clause = OMP_CLAUSE_CHAIN (clause); - if (clause == NULL) - return; - pp_space (pp); } } @@ -3641,7 +3641,10 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags, goto dump_omp_body; case OMP_CLAUSE: - dump_omp_clause (pp, node, spc, flags); + /* If we come here, we're dumping something that's not an OMP construct, + for example, OMP clauses attached to a function's '__attribute__'. + Dump the whole OMP clause chain. */ + dump_omp_clauses (pp, node, spc, flags, false); is_expr = false; break; |