[PATCH] D100055: Fix missing generate capture expression for novariants's condition
Jennifer Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 7 11:36:50 PDT 2021
jyu2 created this revision.
jyu2 added reviewers: ABataev, mikerice.
jyu2 requested review of this revision.
Herald added a project: clang.
This is fix missing capture expression for novariants's condition
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D100055
Files:
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/dispatch_ast_print.cpp
Index: clang/test/OpenMP/dispatch_ast_print.cpp
===================================================================
--- clang/test/OpenMP/dispatch_ast_print.cpp
+++ clang/test/OpenMP/dispatch_ast_print.cpp
@@ -56,6 +56,9 @@
//DUMP: OMPDependClause
//DUMP: OMPNowaitClause
//DUMP: OMPNovariantsClause
+ //DUMP: DeclRefExpr {{.*}} 'bool' lvalue OMPCapturedExpr
+ //DUMP: OMPNocontextClause
+ //DUMP: DeclRefExpr {{.*}} 'bool' lvalue OMPCapturedExpr
#pragma omp dispatch depend(in:var) nowait novariants(aaa > 5) nocontext(bbb > 5)
foo(aaa, &bbb);
@@ -66,6 +69,9 @@
//DUMP: OMPDeviceClause
//DUMP: OMPIs_device_ptrClause
//DUMP: OMPNovariantsClause
+ //DUMP: DeclRefExpr {{.*}} 'bool' lvalue OMPCapturedExpr
+ //DUMP: OMPNocontextClause
+ //DUMP: DeclRefExpr {{.*}} 'bool' lvalue OMPCapturedExpr
#pragma omp dispatch device(dev) is_device_ptr(dp) novariants(dev > 10) nocontext(dev > 5)
foo(aaa, dp);
Index: clang/lib/Sema/SemaOpenMP.cpp
===================================================================
--- clang/lib/Sema/SemaOpenMP.cpp
+++ clang/lib/Sema/SemaOpenMP.cpp
@@ -14905,6 +14905,7 @@
if (CaptureRegion != OMPD_unknown && !CurContext->isDependentContext()) {
ValExpr = MakeFullExpr(ValExpr).get();
llvm::MapVector<const Expr *, DeclRefExpr *> Captures;
+ ValExpr = tryBuildCapture(*this, ValExpr, Captures).get();
HelperValStmt = buildPreInits(Context, Captures);
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100055.335882.patch
Type: text/x-patch
Size: 1457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210407/a973b396/attachment.bin>
More information about the llvm-commits
mailing list