[flang-commits] [flang] [flang][OpenMP] Move check of ALIGN clause to visitor function (PR #164261)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Tue Oct 21 03:56:35 PDT 2025


================
@@ -3898,6 +3882,19 @@ void OmpStructureChecker::CheckIsLoopIvPartOfClause(
   }
 }
 
+void OmpStructureChecker::Enter(const parser::OmpClause::Align &x) {
+  CheckAllowedClause(llvm::omp::Clause::OMPC_align);
+  if (const auto &v{GetIntValue(x.v.v)}) {
+    if (*v <= 0) {
+      context_.Say(GetContext().clauseSource,
+          "The alignment should be positive"_err_en_US);
+    } else if (!llvm::isPowerOf2_64(*v)) {
+      context_.Say(GetContext().clauseSource,
+          "The alignment should be a power of 2"_err_en_US);
----------------
tblah wrote:

See https://github.com/llvm/llvm-project/pull/150612#issuecomment-3164771076

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


More information about the flang-commits mailing list