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/SemaExpr.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/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index de9ebe77190..cfd58983dfc 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -13814,6 +13814,9 @@ void Sema::MarkVariableReferenced(SourceLocation Loc, VarDecl *Var) { static void MarkExprReferenced(Sema &SemaRef, SourceLocation Loc, Decl *D, Expr *E, bool MightBeOdrUse) { + if (SemaRef.isInOpenMPDeclareTargetContext()) + SemaRef.checkDeclIsAllowedInOpenMPTarget(E, D); + if (VarDecl *Var = dyn_cast<VarDecl>(D)) { DoMarkVarDeclReferenced(SemaRef, Loc, Var, E); return; |