[clang] [OpenMP][Clang] Force use of `num_teams` and `thread_limit` for bare kernel (PR #68373)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 08:27:27 PST 2023


================
@@ -14633,6 +14633,26 @@ StmtResult Sema::ActOnOpenMPTargetTeamsDirective(ArrayRef<OMPClause *> Clauses,
   }
   setFunctionHasBranchProtectedScope();
 
+  bool HasBareClause = false;
+  bool HasThreadLimitClause = false;
+  bool HasNumTeamsClause = false;
+  OMPClause *BareClause = nullptr;
+
+  for (auto *C : Clauses) {
+    if (isa<OMPXBareClause>(C)) {
+      BareClause = C;
+      HasBareClause = true;
----------------
shiltian wrote:

It is not very necessarily needed, but I found it look nicer to check three boolean variables instead of two as well as a pointer. Just code preference. Nothing technical.

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


More information about the cfe-commits mailing list