aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.h
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2016-08-04 15:35:19 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2016-08-04 15:35:19 +0200
commit0b212d8c86eee4dd2b9b0c4c04ea4dd994e72682 (patch)
tree3c902630f7e7db375d5643b09b8b06cf4c1a409d /gcc/cp/parser.h
parentbbc79c0e9ee0f8a3e6a2e0a4ec104d2b86e093b9 (diff)
downloadgcc-0b212d8c86eee4dd2b9b0c4c04ea4dd994e72682.zip
gcc-0b212d8c86eee4dd2b9b0c4c04ea4dd994e72682.tar.gz
gcc-0b212d8c86eee4dd2b9b0c4c04ea4dd994e72682.tar.bz2
C/C++: Simplify handling of location information for OpenACC routine directives
gcc/c/ * c-parser.c (struct oacc_routine_data): New. (c_parser_declaration_or_fndef, c_parser_oacc_routine): Use it. Simplify code. (c_finish_oacc_routine): Likewise. Don't attach clauses to "omp declare target" attribute. gcc/cp/ * parser.h (struct cp_omp_declare_simd_data): New. (struct cp_parser): Use it for oacc_routine member. * parser.c (cp_ensure_no_oacc_routine, cp_parser_oacc_routine) (cp_parser_late_parsing_oacc_routine, cp_finalize_oacc_routine): Use it. Simplify code. (cp_parser_new): Initialize all members pointing to special parsing data structures. (cp_parser_cilk_simd_fn_vector_attrs): Initialize parser->cilk_simd_fn_info->clauses. (cp_parser_omp_declare_simd): Initialize parser->omp_declare_simd->clauses. (cp_parser_late_parsing_omp_declare_simd): Simplify code. From-SVN: r239127
Diffstat (limited to 'gcc/cp/parser.h')
-rw-r--r--gcc/cp/parser.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h
index 2923378..2d3feb6 100644
--- a/gcc/cp/parser.h
+++ b/gcc/cp/parser.h
@@ -199,7 +199,8 @@ struct GTY (()) cp_parser_context {
};
-/* Control structure for #pragma omp declare simd parsing. */
+/* Helper data structure for parsing #pragma omp declare simd, and Cilk Plus
+ SIMD-enabled functions' vector attribute. */
struct cp_omp_declare_simd_data {
bool error_seen; /* Set if error has been reported. */
bool fndecl_seen; /* Set if one fn decl/definition has been seen already. */
@@ -207,6 +208,10 @@ struct cp_omp_declare_simd_data {
tree clauses;
};
+/* Helper data structure for parsing #pragma acc routine. */
+struct cp_oacc_routine_data : cp_omp_declare_simd_data {
+ location_t loc;
+};
/* The cp_parser structure represents the C++ parser. */
@@ -363,18 +368,16 @@ struct GTY(()) cp_parser {
unsigned num_template_parameter_lists;
/* When parsing #pragma omp declare simd, this is a pointer to a
- data structure with everything needed for parsing the clauses. */
+ helper data structure. */
cp_omp_declare_simd_data * GTY((skip)) omp_declare_simd;
- /* When parsing the vector attribute in Cilk Plus SIMD-enabled function,
- this is a pointer to data structure with everything needed for parsing
- the clauses. The cp_omp_declare_simd_data struct will hold all the
- necessary information, so creating another struct for this is not
- necessary. */
+ /* When parsing Cilk Plus SIMD-enabled functions' vector attributes,
+ this is a pointer to a helper data structure. */
cp_omp_declare_simd_data * GTY((skip)) cilk_simd_fn_info;
- /* Parsing information for #pragma acc routine. */
- cp_omp_declare_simd_data * GTY((skip)) oacc_routine;
+ /* When parsing #pragma acc routine, this is a pointer to a helper data
+ structure. */
+ cp_oacc_routine_data * GTY((skip)) oacc_routine;
/* Nonzero if parsing a parameter list where 'auto' should trigger an implicit
template parameter. */