[PATCH] D144634: [Clang][OpenMP] Support for Code Generation of loop bind clause

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 11 06:18:58 PDT 2023


ABataev added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9838
+def err_omp_loop_reduction_clause : Error<
+  "reduction clause not allowed with '#pragma omp loop bind(teams)'">;
 def warn_break_binds_to_switch : Warning<
----------------
'reduction'


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:6105
+bool Sema::mapLoopConstruct(
+    llvm::SmallVector<OMPClause *, 8> *ClausesWithoutBind,
+    ArrayRef<OMPClause *> Clauses, OpenMPBindClauseKind BindKind,
----------------
Why ClausesWithoutBind passing by pointer? Use `llvm::SmallVectorImpl<OMPClause *> &ClausesWithoutBind` instead


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:6107
+    ArrayRef<OMPClause *> Clauses, OpenMPBindClauseKind BindKind,
+    OpenMPDirectiveKind *Kind) {
+
----------------
Same, pass by reference


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:14088-14089
   setFunctionHasBranchProtectedScope();
-  return OMPDistributeDirective::Create(Context, StartLoc, EndLoc,
-                                        NestedLoopCount, Clauses, AStmt, B);
+  return OMPDistributeDirective::Create(
+      Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
 }
----------------
Restore formatting


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144634/new/

https://reviews.llvm.org/D144634



More information about the cfe-commits mailing list