This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gomp4] minor cfe backports
- From: Cesar Philippidis <cesar at codesourcery dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 28 Oct 2015 14:58:16 -0700
- Subject: [gomp4] minor cfe backports
- Authentication-results: sourceware.org; auth=none
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
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;