From: Alexey Bataev Date: Thu, 22 Aug 2019 16:48:26 +0000 (+0000) Subject: [OPENMP]Generalization of handling of declare target attribute. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=76c0d5a9da9a3b9d2d096de937d14ff4e0d68439;p=clang [OPENMP]Generalization of handling of declare target attribute. Used OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration instead of direct checking of the OMPDeclareTargetDeclAttr attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369668 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index b8cefac2f9..f6064011be 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6799,7 +6799,7 @@ NamedDecl *Sema::ActOnVariableDeclarator( if (EmitTLSUnsupportedError && ((getLangOpts().CUDA && DeclAttrsMatchCUDAMode(getLangOpts(), NewVD)) || (getLangOpts().OpenMPIsDevice && - NewVD->hasAttr()))) + 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/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index 49f43a8675..16956831c8 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/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() || + return OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(VD) || checkTypeMappable(SL, SR, SemaRef, Stack, VD->getType(), /*FullCheck=*/false); }