diff options
author | Dmitry Polukhin <dmitry.polukhin@gmail.com> | 2016-04-06 11:38:59 +0000 |
---|---|---|
committer | Dmitry Polukhin <dmitry.polukhin@gmail.com> | 2016-04-06 11:38:59 +0000 |
commit | 0b0da296e6de09610621467279a99eb290522a88 (patch) | |
tree | 1658d323a4f2382dfdfdb387db998bfde5095e9d /clang/lib/Sema/SemaDecl.cpp | |
parent | b1f7d4d79cbc720bba2c0f82cfe0a0e0c6077896 (diff) | |
download | bcm5719-llvm-0b0da296e6de09610621467279a99eb290522a88.tar.gz bcm5719-llvm-0b0da296e6de09610621467279a99eb290522a88.zip |
[OPENMP] Parsing and Sema support for 'omp declare target' directive
Add parsing, sema analysis for 'declare target' construct for OpenMP 4.0
(4.5 support will be added in separate patch).
The declare target directive specifies that variables, functions (C, C++
and Fortran), and subroutines (Fortran) are mapped to a device. The declare
target directive is a declarative directive. In Clang declare target is
implemented as implicit attribute for the declaration.
The syntax of the declare target directive is as follows:
#pragma omp declare target
declarations-definition-seq
#pragma omp end declare target
Based on patch from Michael Wong http://reviews.llvm.org/D15321
llvm-svn: 265530
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 0d91e976d47..774af59e497 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -5052,6 +5052,9 @@ NamedDecl *Sema::HandleDeclarator(Scope *S, Declarator &D, CurContext->addHiddenDecl(New); } + if (isInOpenMPDeclareTargetContext()) + checkDeclIsAllowedInOpenMPTarget(nullptr, New); + return New; } |