[llvm-branch-commits] [flang] [flang][OpenMP] Reject END DO on construct that crosses label-DO (PR #169714)

Tom Eccles via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Nov 27 03:20:13 PST 2025


================
@@ -141,8 +144,27 @@ class CanonicalizationOfDoLoops {
         stack.pop_back();
       } while (!stack.empty() && stack.back().label == currentLabel);
       i = --next;
+      return true;
+    } else {
+      return false;
     }
   }
+
+  void MarkOpenMPConstruct(OpenMPConstruct &omp) {
----------------
tblah wrote:

nit: this can currently only mark as CrossesLabelDo and it does that unconditionally - which doesn't really fit the name. How about having an argument for the flag which should be set? (in this case, always CrossesLabelDo). I think that would make the calling code a bit easier to read as well.

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


More information about the llvm-branch-commits mailing list