public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gomp4] minor cfe backports
@ 2015-10-28 22:04 Cesar Philippidis
  0 siblings, 0 replies; only message in thread
From: Cesar Philippidis @ 2015-10-28 22:04 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

I've applied this patch which backports a change in the way that seq and
auto are parsed in the c front end from trunk to gomp4.

Next up, I'm preparing a patch to remove *_omp_positive_int_clause from
the c and c++ front ends in gomp4. That function is used to parse
num_threads, num_gangs, num_workers and vector_length in gomp4. But
support for those clauses are already present in trunk. I'll post more
details with the patch later.

Cesar

[-- Attachment #2: cfe_oacc_simple.diff --]
[-- Type: text/x-patch, Size: 1613 bytes --]

2015-10-28  Cesar Philippidis  <cesar@codesourcery.com>

	* gcc/c/c-parser.c (c_parser_oacc_simple_clause): New
	function.
	(c_parser_oacc_all_clauses): Use it instead of
	c_parser_omp_simple_clause.

diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index a1465bf..e4a0aca 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -11365,7 +11365,25 @@ c_parser_oacc_shape_clause (c_parser *parser, omp_clause_code kind,
 
  cleanup_error:
   c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, 0);
-  return list;  return c;
+  return list;
+}
+
+/* OpenACC:
+   auto
+   independent
+   nohost
+   seq */
+
+static tree
+c_parser_oacc_simple_clause (c_parser *parser, enum omp_clause_code code,
+			     tree list)
+{
+  check_no_duplicate_clause (list, code, omp_clause_code_name[code]);
+
+  tree c = build_omp_clause (c_parser_peek_token (parser)->location, code);
+  OMP_CLAUSE_CHAIN (c) = list;
+
+  return c;
 }
 
 /* OpenACC:
@@ -12724,7 +12742,7 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask,
 	  c_name = "async";
 	  break;
 	case PRAGMA_OACC_CLAUSE_AUTO:
-	  clauses = c_parser_omp_simple_clause (parser, OMP_CLAUSE_AUTO,
+	  clauses = c_parser_oacc_simple_clause (parser, OMP_CLAUSE_AUTO,
 						clauses);
 	  c_name = "auto";
 	  break;
@@ -12848,7 +12866,7 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask,
 	  c_name = "reduction";
 	  break;
 	case PRAGMA_OACC_CLAUSE_SEQ:
-	  clauses = c_parser_omp_simple_clause (parser, OMP_CLAUSE_SEQ,
+	  clauses = c_parser_oacc_simple_clause (parser, OMP_CLAUSE_SEQ,
 						clauses);
 	  c_name = "seq";
 	  break;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-28 21:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-28 22:04 [gomp4] minor cfe backports Cesar Philippidis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).