aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaOpenMP.cpp
diff options
context:
space:
mode:
authorJennifer Yu <jennifer.yu@intel.com>2023-03-09 08:14:56 -0800
committerJennifer Yu <jennifer.yu@intel.com>2023-03-09 10:59:59 -0800
commit8da99b44b6a5a2c9033e38828858cbadad425204 (patch)
tree0b8785917e408cef5e2dfa137313db84975361aa /clang/lib/Sema/SemaOpenMP.cpp
parentc5b060900e985ac1d5b80b957d9067c6d6959095 (diff)
downloadllvm-8da99b44b6a5a2c9033e38828858cbadad425204.zip
llvm-8da99b44b6a5a2c9033e38828858cbadad425204.tar.gz
llvm-8da99b44b6a5a2c9033e38828858cbadad425204.tar.bz2
Revert "Revert "Add map info for dereference pointer.""
This reverts commit 8cf85a0cadb033fed3d96aa5283deb4bfbbaf2c8. This is add back change of "Add map info for dereference pointer." In addition turn off test run on amdgpu, since I don't know the way to reprodue the problem.
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index b87732a..e193fa3 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -2203,11 +2203,14 @@ bool Sema::isOpenMPCapturedByRef(const ValueDecl *D, unsigned Level,
++EI;
if (EI == EE)
return false;
-
- if (isa<ArraySubscriptExpr>(EI->getAssociatedExpression()) ||
- isa<OMPArraySectionExpr>(EI->getAssociatedExpression()) ||
+ auto Last = std::prev(EE);
+ const auto *UO =
+ dyn_cast<UnaryOperator>(Last->getAssociatedExpression());
+ if ((UO && UO->getOpcode() == UO_Deref) ||
+ isa<ArraySubscriptExpr>(Last->getAssociatedExpression()) ||
+ isa<OMPArraySectionExpr>(Last->getAssociatedExpression()) ||
isa<MemberExpr>(EI->getAssociatedExpression()) ||
- isa<OMPArrayShapingExpr>(EI->getAssociatedExpression())) {
+ isa<OMPArrayShapingExpr>(Last->getAssociatedExpression())) {
IsVariableAssociatedWithSection = true;
// There is nothing more we need to know about this variable.
return true;