[flang-commits] [flang] [llvm] [flang][OpenMP]Add support for fail clause (PR #118683)
Mats Petersson via flang-commits
flang-commits at lists.llvm.org
Thu Dec 5 03:45:56 PST 2024
================
@@ -2486,17 +2486,28 @@ void OmpStructureChecker::CheckAtomicMemoryOrderClause(
const parser::OmpAtomicClauseList *leftHandClauseList,
const parser::OmpAtomicClauseList *rightHandClauseList) {
int numMemoryOrderClause = 0;
+ int numFailClause = 0;
auto checkForValidMemoryOrderClause =
[&](const parser::OmpAtomicClauseList *clauseList) {
for (const auto &clause : clauseList->v) {
- if (std::get_if<Fortran::parser::OmpMemoryOrderClause>(&clause.u)) {
- numMemoryOrderClause++;
- if (numMemoryOrderClause > 1) {
+ if (std::get_if<parser::OmpFailClause>(&clause.u)) {
+ numFailClause++;
+ if (numFailClause > 1) {
context_.Say(clause.source,
- "More than one memory order clause not allowed on "
+ "More than one fail clause not allowed on "
----------------
Leporacanthicus wrote:
Good catch on all three parts. This was a bit of a "copy-paste" thing, so I just followed what was already there for memory order, but of course, memory order isn't a "keyword" the same way that FAIL is. The split strings is annoying me quite often, so thanks for pointing that out - again, copying what was already there (poor excuse, but it's the best I've got!)
https://github.com/llvm/llvm-project/pull/118683
More information about the flang-commits
mailing list