summaryrefslogtreecommitdiff
path: root/gcc/tree-pretty-print.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-06 20:39:46 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-06 20:39:46 +0000
commite97da9acca05b56be99bfd9abd8b83e5db5268fb (patch)
treefcab715a6c79d738a81d753254714e02889ad105 /gcc/tree-pretty-print.c
parent76d6e5e429f5ca1ba89341e4fd3cbd5f4a6f055f (diff)
downloadgcc-e97da9acca05b56be99bfd9abd8b83e5db5268fb.tar.gz
2008-06-06 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r136492 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@136504 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r--gcc/tree-pretty-print.c100
1 files changed, 78 insertions, 22 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 811c195e126..2f7de8f1c7d 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -334,19 +334,22 @@ dump_omp_clause (pretty_printer *buffer, tree clause, int spc, int flags)
pp_string (buffer, "default(");
switch (OMP_CLAUSE_DEFAULT_KIND (clause))
{
- case OMP_CLAUSE_DEFAULT_UNSPECIFIED:
- break;
- case OMP_CLAUSE_DEFAULT_SHARED:
- pp_string (buffer, "shared");
- break;
- case OMP_CLAUSE_DEFAULT_NONE:
- pp_string (buffer, "none");
- break;
- case OMP_CLAUSE_DEFAULT_PRIVATE:
- pp_string (buffer, "private");
- break;
- default:
- gcc_unreachable ();
+ case OMP_CLAUSE_DEFAULT_UNSPECIFIED:
+ break;
+ case OMP_CLAUSE_DEFAULT_SHARED:
+ pp_string (buffer, "shared");
+ break;
+ case OMP_CLAUSE_DEFAULT_NONE:
+ pp_string (buffer, "none");
+ break;
+ case OMP_CLAUSE_DEFAULT_PRIVATE:
+ pp_string (buffer, "private");
+ break;
+ case OMP_CLAUSE_DEFAULT_FIRSTPRIVATE:
+ pp_string (buffer, "firstprivate");
+ break;
+ default:
+ gcc_unreachable ();
}
pp_character (buffer, ')');
break;
@@ -367,6 +370,9 @@ dump_omp_clause (pretty_printer *buffer, tree clause, int spc, int flags)
case OMP_CLAUSE_SCHEDULE_RUNTIME:
pp_string (buffer, "runtime");
break;
+ case OMP_CLAUSE_SCHEDULE_AUTO:
+ pp_string (buffer, "auto");
+ break;
default:
gcc_unreachable ();
}
@@ -380,6 +386,18 @@ dump_omp_clause (pretty_printer *buffer, tree clause, int spc, int flags)
pp_character (buffer, ')');
break;
+ case OMP_CLAUSE_UNTIED:
+ pp_string (buffer, "untied");
+ break;
+
+ case OMP_CLAUSE_COLLAPSE:
+ pp_string (buffer, "collapse(");
+ dump_generic_node (buffer,
+ OMP_CLAUSE_COLLAPSE_EXPR (clause),
+ spc, flags, false);
+ pp_character (buffer, ')');
+ break;
+
default:
/* Should never happen. */
dump_generic_node (buffer, clause, spc, flags, false);
@@ -1863,12 +1881,41 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
is_expr = false;
break;
+ case OMP_TASK:
+ pp_string (buffer, "#pragma omp task");
+ dump_omp_clauses (buffer, OMP_TASK_CLAUSES (node), spc, flags);
+ if (OMP_TASK_FN (node))
+ {
+ pp_string (buffer, " [child fn: ");
+ dump_generic_node (buffer, OMP_TASK_FN (node), spc, flags, false);
+
+ pp_string (buffer, " (");
+
+ if (OMP_TASK_DATA_ARG (node))
+ dump_generic_node (buffer, OMP_TASK_DATA_ARG (node), spc, flags,
+ false);
+ else
+ pp_string (buffer, "???");
+
+ pp_character (buffer, ')');
+ if (OMP_TASK_COPYFN (node))
+ {
+ pp_string (buffer, ", copy fn: ");
+ dump_generic_node (buffer, OMP_TASK_COPYFN (node), spc,
+ flags, false);
+ }
+ pp_character (buffer, ']');
+ }
+ goto dump_omp_body;
+
case OMP_FOR:
pp_string (buffer, "#pragma omp for");
dump_omp_clauses (buffer, OMP_FOR_CLAUSES (node), spc, flags);
if (!(flags & TDF_SLIM))
{
+ int i;
+
if (OMP_FOR_PRE_BODY (node))
{
newline_and_indent (buffer, spc + 2);
@@ -1878,14 +1925,22 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
dump_generic_node (buffer, OMP_FOR_PRE_BODY (node),
spc, flags, false);
}
- newline_and_indent (buffer, spc);
- pp_string (buffer, "for (");
- dump_generic_node (buffer, OMP_FOR_INIT (node), spc, flags, false);
- pp_string (buffer, "; ");
- dump_generic_node (buffer, OMP_FOR_COND (node), spc, flags, false);
- pp_string (buffer, "; ");
- dump_generic_node (buffer, OMP_FOR_INCR (node), spc, flags, false);
- pp_string (buffer, ")");
+ spc -= 2;
+ for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (node)); i++)
+ {
+ spc += 2;
+ newline_and_indent (buffer, spc);
+ pp_string (buffer, "for (");
+ dump_generic_node (buffer, TREE_VEC_ELT (OMP_FOR_INIT (node), i),
+ spc, flags, false);
+ pp_string (buffer, "; ");
+ dump_generic_node (buffer, TREE_VEC_ELT (OMP_FOR_COND (node), i),
+ spc, flags, false);
+ pp_string (buffer, "; ");
+ dump_generic_node (buffer, TREE_VEC_ELT (OMP_FOR_INCR (node), i),
+ spc, flags, false);
+ pp_string (buffer, ")");
+ }
if (OMP_FOR_BODY (node))
{
newline_and_indent (buffer, spc + 2);
@@ -1896,6 +1951,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
newline_and_indent (buffer, spc + 2);
pp_character (buffer, '}');
}
+ spc -= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node)) - 2;
if (OMP_FOR_PRE_BODY (node))
{
spc -= 4;
@@ -2253,7 +2309,7 @@ print_declaration (pretty_printer *buffer, tree t, int spc, int flags)
pp_character (buffer, ')');
}
- /* The initial value of a function serves to determine wether the function
+ /* The initial value of a function serves to determine whether the function
is declared or defined. So the following does not apply to function
nodes. */
if (TREE_CODE (t) != FUNCTION_DECL)