diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-08-22 16:48:26 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-08-22 16:48:26 +0000 |
| commit | ebcfc9eaed5dcc7eec40a916c6d12de8515494a0 (patch) | |
| tree | 0d031740eec77cf9c2f3fb3a9b7850af28f2ce5d /clang | |
| parent | 41f89c348421c27387ba5063b4fb418a53abfea9 (diff) | |
| download | bcm5719-llvm-ebcfc9eaed5dcc7eec40a916c6d12de8515494a0.tar.gz bcm5719-llvm-ebcfc9eaed5dcc7eec40a916c6d12de8515494a0.zip | |
[OPENMP]Generalization of handling of declare target attribute.
Used OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration instead of
direct checking of the OMPDeclareTargetDeclAttr attribute.
llvm-svn: 369668
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index b8cefac2f90..f6064011be6 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -6799,7 +6799,7 @@ NamedDecl *Sema::ActOnVariableDeclarator( if (EmitTLSUnsupportedError && ((getLangOpts().CUDA && DeclAttrsMatchCUDAMode(getLangOpts(), NewVD)) || (getLangOpts().OpenMPIsDevice && - NewVD->hasAttr<OMPDeclareTargetDeclAttr>()))) + OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(NewVD)))) Diag(D.getDeclSpec().getThreadStorageClassSpecLoc(), diag::err_thread_unsupported); // CUDA B.2.5: "__shared__ and __constant__ variables have implied static diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 49f43a8675f..16956831c8c 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -15418,7 +15418,7 @@ static void checkDeclInTargetContext(SourceLocation SL, SourceRange SR, static bool checkValueDeclInTarget(SourceLocation SL, SourceRange SR, Sema &SemaRef, DSAStackTy *Stack, ValueDecl *VD) { - return VD->hasAttr<OMPDeclareTargetDeclAttr>() || + return OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(VD) || checkTypeMappable(SL, SR, SemaRef, Stack, VD->getType(), /*FullCheck=*/false); } |

