Skip to content
Snippets Groups Projects
Commit d7d8d9da authored by Paul-Antoine Arras's avatar Paul-Antoine Arras
Browse files

OpenMP: C front-end support for dispatch + adjust_args

This patch adds support to the C front-end to parse the `dispatch` construct and
the `adjust_args` clause. It also includes some common C/C++ bits for pragmas
and attributes.

Additional common C/C++ testcases are in a later patch in the series.

gcc/c-family/ChangeLog:

	* c-attribs.cc (c_common_gnu_attributes): Add attribute for adjust_args
	need_device_ptr.
	* c-omp.cc (c_omp_directives): Uncomment dispatch.
	* c-pragma.cc (omp_pragmas): Add dispatch.
	* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_DISPATCH.
	(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_NOCONTEXT and
	PRAGMA_OMP_CLAUSE_NOVARIANTS.

gcc/c/ChangeLog:

	* c-parser.cc (c_parser_omp_dispatch): New function.
	(c_parser_omp_clause_name): Handle nocontext and novariants clauses.
	(c_parser_omp_clause_novariants): New function.
	(c_parser_omp_clause_nocontext): Likewise.
	(c_parser_omp_all_clauses): Handle nocontext and novariants clauses.
	(c_parser_omp_dispatch_body): New function adapted from
	c_parser_expr_no_commas.
	(OMP_DISPATCH_CLAUSE_MASK): Define.
	(c_parser_omp_dispatch): New function.
	(c_finish_omp_declare_variant): Parse adjust_args.
	(c_parser_omp_construct): Handle PRAGMA_OMP_DISPATCH.
	* c-typeck.cc (c_finish_omp_clauses): Handle OMP_CLAUSE_NOVARIANTS and
	OMP_CLAUSE_NOCONTEXT.

gcc/testsuite/ChangeLog:

	* gcc.dg/gomp/adjust-args-1.c: New test.
	* gcc.dg/gomp/dispatch-1.c: New test.
	* gcc.dg/gomp/dispatch-2.c: New test.
	* gcc.dg/gomp/dispatch-3.c: New test.
	* gcc.dg/gomp/dispatch-4.c: New test.
	* gcc.dg/gomp/dispatch-5.c: New test.
parent 084ea8ad
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment