[PATCH] D64878: [OpenMP] Fix sema check for unified memory case NFC

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 17 12:28:11 PDT 2019


gtbercea created this revision.
gtbercea added a reviewer: ABataev.
Herald added subscribers: cfe-commits, jdoerfert, guansong.
Herald added a project: clang.

This patch fixes a condition introduced in patch D60883 <https://reviews.llvm.org/D60883>.


Repository:
  rC Clang

https://reviews.llvm.org/D64878

Files:
  lib/Sema/SemaOpenMP.cpp


Index: lib/Sema/SemaOpenMP.cpp
===================================================================
--- lib/Sema/SemaOpenMP.cpp
+++ lib/Sema/SemaOpenMP.cpp
@@ -2621,9 +2621,12 @@
       // Skip internally declared static variables.
       llvm::Optional<OMPDeclareTargetDeclAttr::MapTypeTy> Res =
           OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(VD);
+      bool IsUsingUnifiedMemory =
+          Stack->hasRequiresDeclWithClause<OMPUnifiedSharedMemoryClause>();
       if (VD->hasGlobalStorage() && CS && !CS->capturesVariable(VD) &&
-          (Stack->hasRequiresDeclWithClause<OMPUnifiedSharedMemoryClause>() ||
-           !Res || *Res != OMPDeclareTargetDeclAttr::MT_Link))
+          ((!IsUsingUnifiedMemory &&
+            (!Res || *Res != OMPDeclareTargetDeclAttr::MT_Link)) ||
+           (IsUsingUnifiedMemory && !Res)))
         return;
 
       SourceLocation ELoc = E->getExprLoc();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64878.210388.patch
Type: text/x-patch
Size: 910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190717/9343916c/attachment.bin>


More information about the cfe-commits mailing list