[clang] [OpenMP] Patch for Support to loop bind clause : Checking Parent Region (PR #76938)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 4 04:09:25 PST 2024


================
@@ -6213,26 +6226,35 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(
     OpenMPDirectiveKind PrevMappedDirective) {
   StmtResult Res = StmtError();
   OpenMPBindClauseKind BindKind = OMPC_BIND_unknown;
+  llvm::SmallVector<OMPClause *> ClausesWithoutBind;
+  bool UseClausesWithoutBind = false;
+
   if (const OMPBindClause *BC =
           OMPExecutableDirective::getSingleClause<OMPBindClause>(Clauses))
     BindKind = BC->getBindKind();
+
+  // Variable used to note down the DirectiveKind because mapLoopConstruct may
+  // change "Kind" variable, due to mapping of "omp loop" to other directives.
+  OpenMPDirectiveKind DK = Kind;
+  if ((Kind == OMPD_loop) || (PrevMappedDirective == OMPD_loop)) {
----------------
alexey-bataev wrote:

Extra parens

https://github.com/llvm/llvm-project/pull/76938


More information about the cfe-commits mailing list