This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gomp] Fix tree dump with #pragma omp single nowait


Hi!

I have noticed #pragma omp single nowait is printed as
#pragma omp singlenowait
(note missing space), on the other side say for
#pragma omp sections
we print an extra space at the end.
Fixed thusly, ok for gomp?

2005-11-09  Jakub Jelinek  <jakub@redhat.com>

	* tree-pretty-print.c (dump_omp_clauses): Add pp_space call if
	clause is not NULL.
	(dump_generic_node) <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't
	print space after directive name.

--- gcc/tree-pretty-print.c.jj	2005-10-31 23:36:11.000000000 +0100
+++ gcc/tree-pretty-print.c	2005-11-09 13:36:20.000000000 +0100
@@ -252,6 +252,7 @@ dump_omp_clauses (pretty_printer *buffer
   if (clause == NULL)
     return;
 
+  pp_space (buffer);
   while (1)
     {
       switch (TREE_CODE (clause))
@@ -1660,7 +1661,7 @@ dump_generic_node (pretty_printer *buffe
       break;
 
     case OMP_PARALLEL:
-      pp_string (buffer, "#pragma omp parallel ");
+      pp_string (buffer, "#pragma omp parallel");
       dump_omp_clauses (buffer, OMP_PARALLEL_CLAUSES (node), spc, flags);
     dump_omp_body:
       newline_and_indent (buffer, spc + 2);
@@ -1673,7 +1674,7 @@ dump_generic_node (pretty_printer *buffe
       break;
 
     case OMP_FOR:
-      pp_string (buffer, "#pragma omp for ");
+      pp_string (buffer, "#pragma omp for");
       dump_omp_clauses (buffer, OMP_FOR_CLAUSES (node), spc, flags);
       if (OMP_FOR_PRE_BODY (node))
 	{
@@ -1708,7 +1709,7 @@ dump_generic_node (pretty_printer *buffe
       break;
 
     case OMP_SECTIONS:
-      pp_string (buffer, "#pragma omp sections ");
+      pp_string (buffer, "#pragma omp sections");
       dump_omp_clauses (buffer, OMP_SECTIONS_CLAUSES (node), spc, flags);
       goto dump_omp_body;
 


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]