aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-pretty-print.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-08-10 12:18:25 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-08-10 12:18:25 +0200
commit77eb117f588686e6fb018d103fc3d1899be9b008 (patch)
tree9a022bfea1239471ef385682ffd6de3991c16408 /gcc/tree-pretty-print.c
parent5b7ed762347ea9e82a3982b57975747de0943eb4 (diff)
downloadgcc-77eb117f588686e6fb018d103fc3d1899be9b008.zip
gcc-77eb117f588686e6fb018d103fc3d1899be9b008.tar.gz
gcc-77eb117f588686e6fb018d103fc3d1899be9b008.tar.bz2
tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_DEVICE_TYPE.
* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_DEVICE_TYPE. (enum omp_clause_device_type_kind): New enum. (struct tree_omp_clause): Add subcode.device_type_kind. * tree.h (OMP_CLAUSE_DEVICE_TYPE_KIND): Define. * tree.c (omp_clause_num_ops, omp_clause_code_name): Add entries for device_type clause. (walk_tree_1): Handle OMP_CLAUSE_DEVICE_TYPE. * tree-pretty-print.c (dump_omp_clause): Likewise. c-family/ * c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE. c/ * c-parser.c (c_parser_omp_clause_name): Parse device_type. (c_parser_omp_clause_device_type): New function. (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE. (OMP_DECLARE_TARGET_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE. (c_parser_omp_declare_target): Handle device_type clauses. Remove diagnostics for declare target with clauses nested in clause-less declare target declaration-definition-seq. * c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE. cp/ * parser.c (cp_parser_omp_clause_name): Parse device_type. (cp_parser_omp_clause_device_type): New function. (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE. (OMP_DECLARE_TARGET_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE. (cp_parser_omp_declare_target): Handle device_type clauses. Remove diagnostics for declare target with clauses nested in clause-less declare target declaration-definition-seq. * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE. testsuite/ * c-c++-common/gomp/declare-target-2.c: Don't expect error for declare target with clauses in between declare target without clauses and end declare target. * c-c++-common/gomp/declare-target-4.c: New test. From-SVN: r274252
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r--gcc/tree-pretty-print.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 8091a0a..53b3f55 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -951,6 +951,25 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
pp_right_paren (pp);
break;
+ case OMP_CLAUSE_DEVICE_TYPE:
+ pp_string (pp, "device_type(");
+ switch (OMP_CLAUSE_DEVICE_TYPE_KIND (clause))
+ {
+ case OMP_CLAUSE_DEVICE_TYPE_HOST:
+ pp_string (pp, "host");
+ break;
+ case OMP_CLAUSE_DEVICE_TYPE_NOHOST:
+ pp_string (pp, "nohost");
+ break;
+ case OMP_CLAUSE_DEVICE_TYPE_ANY:
+ pp_string (pp, "any");
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ pp_right_paren (pp);
+ break;
+
case OMP_CLAUSE_SAFELEN:
pp_string (pp, "safelen(");
dump_generic_node (pp, OMP_CLAUSE_SAFELEN_EXPR (clause),