[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:25 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:
So far as I can tell the standard does not actually require this. If I remember correctly there was a big discussion in one of the community calls about the ALIGNED clause and the decision taken was that we should not generate errors for non-power of 2 alignment. I think ALIGN should do the same as ALIGNED.
https://github.com/llvm/llvm-project/pull/164261
More information about the flang-commits
mailing list