https://github.com/kparzysz updated https://github.com/llvm/llvm-project/pull/97446
>From 316d5a11bd7f6afb99cd7d25baf43ec2679561dc Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek <krzysztof.parzys...@amd.com> Date: Mon, 1 Jul 2024 15:18:07 -0500 Subject: [PATCH 1/3] [clang][OpenMP] Use leaf constructs in `mapLoopConstruct` This removes mentions of specific combined directives. Also, add a quote from the OpenMP spec to explain the code dealing with the `bind` clause. --- clang/lib/Sema/SemaOpenMP.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 86666f064f35d..ca7e8acd1c15a 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -6270,16 +6270,20 @@ bool SemaOpenMP::mapLoopConstruct( if (BindKind == OMPC_BIND_unknown) { // Setting the enclosing teams or parallel construct for the loop // directive without bind clause. + // [5.0:129:25-28] If the bind clause is not present on the construct and + // the loop construct is closely nested inside a teams or parallel + // construct, the binding region is the corresponding teams or parallel + // region. If none of those conditions hold, the binding region is not + // defined. BindKind = OMPC_BIND_thread; // Default bind(thread) if binding is unknown + auto ParentLeafs = getLeafConstructsOrSelf(ParentDirective); if (ParentDirective == OMPD_unknown) { Diag(DSAStack->getDefaultDSALocation(), diag::err_omp_bind_required_on_loop); - } else if (ParentDirective == OMPD_parallel || - ParentDirective == OMPD_target_parallel) { + } else if (ParentLeafs.back() == OMPD_parallel) { BindKind = OMPC_BIND_parallel; - } else if (ParentDirective == OMPD_teams || - ParentDirective == OMPD_target_teams) { + } else if (ParentLeafs.back() == OMPD_teams) { BindKind = OMPC_BIND_teams; } } else { >From c238054d3dbb3a9c5d6d737e3f8f10f3f67f4548 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek <krzysztof.parzys...@amd.com> Date: Tue, 2 Jul 2024 15:01:25 -0500 Subject: [PATCH 2/3] Expand auto --- clang/lib/Sema/SemaOpenMP.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index ca7e8acd1c15a..5fde4f67b4fd9 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -6276,7 +6276,8 @@ bool SemaOpenMP::mapLoopConstruct( // region. If none of those conditions hold, the binding region is not // defined. BindKind = OMPC_BIND_thread; // Default bind(thread) if binding is unknown - auto ParentLeafs = getLeafConstructsOrSelf(ParentDirective); + ArrayRef<OpenMPDirectiveKind> ParentLeafs = + getLeafConstructsOrSelf(ParentDirective); if (ParentDirective == OMPD_unknown) { Diag(DSAStack->getDefaultDSALocation(), >From 46968d273147c430df86feb91c830a1aa63e094e Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek <krzysztof.parzys...@amd.com> Date: Tue, 2 Jul 2024 15:03:40 -0500 Subject: [PATCH 3/3] Restart build _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits