[flang-commits] [flang] [flang][OpenMP] Refactor CountGeneratedNests, NFC (PR #185293)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Mon Mar 9 06:44:33 PDT 2026


================
@@ -363,15 +336,15 @@ void OmpStructureChecker::CheckNestedConstruct(
 
   // Check if a loop-nest-associated construct has only one top-level loop
   // in it.
-  if (std::optional<size_t> numLoops{CountGeneratedNests(body)}) {
+  if (std::optional<int64_t> numLoops{GetNumGeneratedNests(body)}) {
     if (*numLoops == 0) {
       context_.Say(beginSpec.DirName().source,
           "This construct should contain a DO-loop or a loop-nest-generating OpenMP construct"_err_en_US);
     } else {
       auto assoc{llvm::omp::getDirectiveAssociation(beginSpec.DirName().v)};
       if (*numLoops > 1 && assoc == llvm::omp::Association::LoopNest) {
         context_.Say(beginSpec.DirName().source,
-            "This construct applies to a loop nest, but has a loop sequence of length %zu"_err_en_US,
+            "This construct applies to a loop nest, but has a loop sequence of length %ld"_err_en_US,
----------------
kparzysz wrote:

I've changed this to use PRId64 instead, which should expand to the correct format string for the platform.

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


More information about the flang-commits mailing list