[flang-commits] [flang] [Flang][OpenMP] Add semantic support for Loop Sequences and OpenMP loop fuse (PR #161213)
Krzysztof Parzyszek via flang-commits
flang-commits at lists.llvm.org
Tue Oct 28 10:13:26 PDT 2025
================
@@ -452,6 +456,65 @@ void OmpStructureChecker::CheckDistLinear(
}
}
+void OmpStructureChecker::CheckLooprangeBounds(
+ const parser::OpenMPLoopConstruct &x) {
+ const parser::OmpClauseList &clauseList = x.BeginDir().Clauses();
+ if (!clauseList.v.empty()) {
+ for (auto &clause : clauseList.v) {
+ if (const auto *lrClause{
+ std::get_if<parser::OmpClause::Looprange>(&clause.u)}) {
+ if (const auto first{GetIntValue(std::get<0>((lrClause->v).t))}) {
+ if (const auto count{GetIntValue(std::get<1>((lrClause->v).t))}) {
+ auto &loopConsList =
+ std::get<std::list<parser::NestedConstruct>>(x.t);
+ if (*first > 0 && *count > 0 &&
+ loopConsList.size() < (unsigned)(*first + *count - 1)) {
+ context_.Say(clause.source,
+ "The loop range indicated in the %s clause"
+ " must not be out of the bounds of the Loop Sequence"
+ " following the construct."_err_en_US,
----------------
kparzysz wrote:
Please put the entire text in a single line. This is to make grepping for messages easier.
https://github.com/llvm/llvm-project/pull/161213
More information about the flang-commits
mailing list