]> gcc.gnu.org Git - gcc.git/commit
Target mapping C++ members inside member functions
authorChung-Lin Tang <cltang@codesourcery.com>
Thu, 21 Jan 2021 15:04:26 +0000 (23:04 +0800)
committerChung-Lin Tang <cltang@codesourcery.com>
Thu, 21 Jan 2021 15:04:26 +0000 (23:04 +0800)
commitaadfc984391c8f28464d448b9bc936344e53e92a
tree34ede48555d7fe393e788b425907fac1b45f4bf8
parent808bdf1bb291f34943d330ebed53d5fba99e3fda
Target mapping C++ members inside member functions

This is a merge of:
https://gcc.gnu.org/pipermail/gcc-patches/2020-December/562467.html

This patch fixes some problems with target mapping when inside
C++ member functions:

1. Allow deref '->' in map clauses.
2. Allow this[X] in map clauses.
3. Create map(this->member) from map(member), when encountering
   member's FIELD_DECL.

This may possibly reverted/updated when a final patch is approved
for mainline.

gcc/cp/ChangeLog:
* parser.c (cp_parser_omp_clause_map): Adjust call to
cp_parser_omp_var_list_no_open to set 'allow_deref' argument to true.
* semantics.c (handle_omp_array_sections_1): Add handling to create
'this->member' from 'member' FIELD_DECL.
(finish_omp_clauses): Likewise. Adjust to allow 'this[]' in OpenMP
map clauses.

gcc/testsuite/ChangeLog:
* g++.dg/gomp/target-3.C: New test.
* g++.dg/gomp/this-2.C: Adjust testcase.
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/testsuite/g++.dg/gomp/target-3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/gomp/this-2.C
This page took 0.066638 seconds and 6 git commands to generate.