File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -6270,16 +6270,21 @@ bool SemaOpenMP::mapLoopConstruct(
6270
6270
if (BindKind == OMPC_BIND_unknown) {
6271
6271
// Setting the enclosing teams or parallel construct for the loop
6272
6272
// directive without bind clause.
6273
+ // [5.0:129:25-28] If the bind clause is not present on the construct and
6274
+ // the loop construct is closely nested inside a teams or parallel
6275
+ // construct, the binding region is the corresponding teams or parallel
6276
+ // region. If none of those conditions hold, the binding region is not
6277
+ // defined.
6273
6278
BindKind = OMPC_BIND_thread; // Default bind(thread) if binding is unknown
6279
+ ArrayRef<OpenMPDirectiveKind> ParentLeafs =
6280
+ getLeafConstructsOrSelf(ParentDirective);
6274
6281
6275
6282
if (ParentDirective == OMPD_unknown) {
6276
6283
Diag(DSAStack->getDefaultDSALocation(),
6277
6284
diag::err_omp_bind_required_on_loop);
6278
- } else if (ParentDirective == OMPD_parallel ||
6279
- ParentDirective == OMPD_target_parallel) {
6285
+ } else if (ParentLeafs.back() == OMPD_parallel) {
6280
6286
BindKind = OMPC_BIND_parallel;
6281
- } else if (ParentDirective == OMPD_teams ||
6282
- ParentDirective == OMPD_target_teams) {
6287
+ } else if (ParentLeafs.back() == OMPD_teams) {
6283
6288
BindKind = OMPC_BIND_teams;
6284
6289
}
6285
6290
} else {
You can’t perform that action at this time.
0 commit comments