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();
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();
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits