]> granicus.if.org Git - clang/commitdiff
[OPENMP]Generalization of handling of declare target attribute.
authorAlexey Bataev <a.bataev@hotmail.com>
Thu, 22 Aug 2019 16:48:26 +0000 (16:48 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Thu, 22 Aug 2019 16:48:26 +0000 (16:48 +0000)
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

lib/Sema/SemaDecl.cpp
lib/Sema/SemaOpenMP.cpp

index b8cefac2f905be8e0b8d7485edba29fd3c6e7706..f6064011be640fa350a042d275617ebd3d3965d2 100644 (file)
@@ -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
index 49f43a8675ffa5447673580d1fc09a63e190ab5e..16956831c8ce3d4a3b13f76a3860e0a59ed1a04c 100644 (file)
@@ -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);
 }