[OpenMP 5.0] Parsing/sema support for to clause with mapper modifier.
authorMichael Kruse <llvm@meinersbur.de>
Fri, 22 Feb 2019 22:29:42 +0000 (22:29 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Fri, 22 Feb 2019 22:29:42 +0000 (22:29 +0000)
commit01f670df8f3717a66a37169d1d3c93d724bd60cf
tree5cf69bd161d21d1f3f061671ccec2018e90435bd
parent8fffa1dfa3bddf44b73a6f622eafa752347202f5
[OpenMP 5.0] Parsing/sema support for to clause with mapper modifier.

This patch implements the parsing and sema support for OpenMP to clause
with potential user-defined mappers attached. User defined mapper is a
new feature in OpenMP 5.0. A to/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 to(mapper(id): ss) // use the mapper with name 'id' to map ss to device

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

llvm-svn: 354698
18 files changed:
clang/include/clang/AST/OpenMPClause.h
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Basic/OpenMPKinds.def
clang/include/clang/Basic/OpenMPKinds.h
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/Sema.h
clang/lib/AST/OpenMPClause.cpp
clang/lib/Basic/OpenMPKinds.cpp
clang/lib/Parse/ParseOpenMP.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/lib/Sema/TreeTransform.h
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/OpenMP/declare_mapper_ast_print.c
clang/test/OpenMP/declare_mapper_ast_print.cpp
clang/test/OpenMP/declare_mapper_codegen.cpp
clang/test/OpenMP/declare_mapper_messages.c
clang/test/OpenMP/declare_mapper_messages.cpp