diff options
author | bviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-23 15:21:42 +0000 |
---|---|---|
committer | bviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-23 15:21:42 +0000 |
commit | 7e005ab573fa4584cddff7f91e5adccf4a966fc2 (patch) | |
tree | 090a19da06b7855d39561e04b7b038b353fb2a9e /gcc/cp/parser.h | |
parent | 0bfd8599413a37760b1690d459ff0923cb12881c (diff) | |
download | gcc-7e005ab573fa4584cddff7f91e5adccf4a966fc2.tar.gz |
Added support for Cilk Plus SIMD-enabled functions for C++.
gcc/c/c-parser.c
2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
* c-parser.c (c_finish_omp_declare_simd): Made "cilk simd function"
attribute an attribute without value.
gcc/cp/ChangeLog
2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
* parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
see if there is an attribute after function decl. If so, then
parse them now.
(cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
enabled function late parsing.
(cp_parser_gnu_attribute_list): Parse all the tokens for the vector
attribute for a SIMD-enabled function.
(cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
the function is used by SIMD-enabled function (indicated by NULL
pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
(cp_parser_cilk_simd_vectorlength): Modified this function to handle
vectorlength clause in SIMD-enabled function and #pragma SIMD's
vectorlength clause. Added a new bool parameter to differentiate
between the two.
(cp_parser_cilk_simd_fn_vector_attrs): New function.
(is_cilkplus_vector_p): Likewise.
(cp_parser_late_parsing_elem_fn_info): Likewise.
(cp_parser_omp_clause_name): Added a check for "mask", "nomask"
and "vectorlength" clauses when Cilk Plus is enabled.
(cp_parser_omp_clause_linear): Added a new parameter of type bool
and emit a sorry message when step size is a parameter.
* parser.h (cp_parser::cilk_simd_fn_info): New field.
* decl.c (grokfndecl): Added flag_enable_cilkplus along with
flag_openmp.
* pt.c (apply_late_template_attributes): Likewise.
testsuite/ChangeLog
2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
* g++.dg/cilk-plus/cilk-plus.exp: Called the C/C++ common tests for
SIMD enabled function.
* g++.dg/cilk-plus/ef_test.C: New test.
* c-c++-common/cilk-plus/ef_error3.c: Made certain messages C specific
and added C++ ones.
* c-c++-common/cilk-plus/vlength_errors.c: Added new dg-error tags
to differenciate C error messages from C++ ones.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206975 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/parser.h')
-rw-r--r-- | gcc/cp/parser.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h index 484a8cd5538..d558c607f4d 100644 --- a/gcc/cp/parser.h +++ b/gcc/cp/parser.h @@ -362,6 +362,13 @@ typedef struct GTY(()) cp_parser { data structure with everything needed for parsing the clauses. */ 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. */ + cp_omp_declare_simd_data * GTY((skip)) cilk_simd_fn_info; + /* Nonzero if parsing a parameter list where 'auto' should trigger an implicit template parameter. */ bool auto_is_implicit_function_template_parm_p; |