diff options
author | Michael Kruse <llvm@meinersbur.de> | 2019-02-01 20:25:04 +0000 |
---|---|---|
committer | Michael Kruse <llvm@meinersbur.de> | 2019-02-01 20:25:04 +0000 |
commit | 251e1488e195a0ab618e503fe5b2bc8ff18d1724 (patch) | |
tree | fb857506e530be8dff680a7f283eaad431bdf545 /clang/lib/Sema/SemaDecl.cpp | |
parent | 6b653fc70ffdc3ec685a435b42c45611e21d407c (diff) | |
download | bcm5719-llvm-251e1488e195a0ab618e503fe5b2bc8ff18d1724.tar.gz bcm5719-llvm-251e1488e195a0ab618e503fe5b2bc8ff18d1724.zip |
[OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive.
This patch implements parsing and sema for "omp declare mapper"
directive. User defined mapper, i.e., declare mapper directive, is a new
feature in OpenMP 5.0. It is introduced to extend existing map clauses
for the purpose of simplifying the copy of complex data structures
between host and device (i.e., deep copy). An example is shown below:
struct S { int len; int *d; };
#pragma omp declare mapper(struct S s) map(s, s.d[0:s.len]) // Memory region that d points to is also mapped using this mapper.
Contributed-by: Lingda Li <lildmh@gmail.com>
Differential Revision: https://reviews.llvm.org/D56326
llvm-svn: 352906
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 136162ad0fa..5b6fd880ca8 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -6192,7 +6192,8 @@ static bool isIncompleteDeclExternC(Sema &S, const T *D) { static bool shouldConsiderLinkage(const VarDecl *VD) { const DeclContext *DC = VD->getDeclContext()->getRedeclContext(); - if (DC->isFunctionOrMethod() || isa<OMPDeclareReductionDecl>(DC)) + if (DC->isFunctionOrMethod() || isa<OMPDeclareReductionDecl>(DC) || + isa<OMPDeclareMapperDecl>(DC)) return VD->hasExternalStorage(); if (DC->isFileContext()) return true; @@ -6204,7 +6205,7 @@ static bool shouldConsiderLinkage(const VarDecl *VD) { static bool shouldConsiderLinkage(const FunctionDecl *FD) { const DeclContext *DC = FD->getDeclContext()->getRedeclContext(); if (DC->isFileContext() || DC->isFunctionOrMethod() || - isa<OMPDeclareReductionDecl>(DC)) + isa<OMPDeclareReductionDecl>(DC) || isa<OMPDeclareMapperDecl>(DC)) return true; if (DC->isRecord()) return false; |