]> granicus.if.org Git - clang/commit
[OpenMP 5.0] Parsing/sema support for from clause with mapper modifier.
authorMichael Kruse <llvm@meinersbur.de>
Mon, 25 Feb 2019 20:34:15 +0000 (20:34 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Mon, 25 Feb 2019 20:34:15 +0000 (20:34 +0000)
commit01e162c2965d114aa4e21c91b6341454210ad8fb
tree8914dcbd768bc12f699a64b4fa85f8d7282106dd
parent3e24c20c7799f2f51b34589b9e8d2dbe49537bb7
[OpenMP 5.0] Parsing/sema support for from clause with mapper modifier.

This patch implements the parsing and sema support for the OpenMP
'from'-clause with potential user-defined mappers attached.
User-defined mappers are a new feature in OpenMP 5.0. A 'from'-clause
can have an explicit or implicit associated mapper, which instructs the
compiler to generate and use customized mapping functions. An example is
shown below:

    struct S { int len; int *d; };
    #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len])
    struct S ss;
    #pragma omp target update from(mapper(id): ss) // use the mapper with name 'id' to map ss from device

Contributed-by: Lingda Li <lildmh@gmail.com>
Differential Revision: https://reviews.llvm.org/D58638

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354817 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/clang/AST/OpenMPClause.h
include/clang/Basic/OpenMPKinds.def
include/clang/Basic/OpenMPKinds.h
include/clang/Sema/Sema.h
lib/AST/OpenMPClause.cpp
lib/Basic/OpenMPKinds.cpp
lib/Parse/ParseOpenMP.cpp
lib/Sema/SemaOpenMP.cpp
lib/Sema/TreeTransform.h
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
test/OpenMP/declare_mapper_ast_print.c
test/OpenMP/declare_mapper_ast_print.cpp
test/OpenMP/declare_mapper_codegen.cpp
test/OpenMP/declare_mapper_messages.c
test/OpenMP/declare_mapper_messages.cpp