[all-commits] [llvm/llvm-project] 14840a: [flang][OpenMP] Check that IF clause applies to at...

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Wed Jun 24 03:42:01 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 14840af5d694f40dbc8b1733330da2db4000335c
      https://github.com/llvm/llvm-project/commit/14840af5d694f40dbc8b1733330da2db4000335c
  Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
  Date:   2026-06-24 (Wed, 24 Jun 2026)

  Changed paths:
    M flang/lib/Semantics/check-omp-structure.cpp
    M flang/lib/Semantics/check-omp-structure.h
    M flang/test/Semantics/OpenMP/device-constructs.f90
    A flang/test/Semantics/OpenMP/if-clause-45-suggestion.f90
    M flang/test/Semantics/OpenMP/if-clause-45.f90
    A flang/test/Semantics/OpenMP/if-clause-50-suggestion.f90
    M flang/test/Semantics/OpenMP/if-clause-50.f90
    A flang/test/Semantics/OpenMP/if-clause-60.f90
    M flang/test/Semantics/OpenMP/if-clause.f90
    M llvm/include/llvm/Frontend/OpenMP/OMP.td

  Log Message:
  -----------
  [flang][OpenMP] Check that IF clause applies to at most one leaf (#205164)

This also allows placing the IF clause in the "allowedClauses" set for
all directives, instead of having it in "allowedOnceClauses" for some
directives and in "allowedClauses" for others.

The emitted diagnostic will show which constituent has multiple IF
clauses applying to it:
```
if.f90:4:35: error: At most one IF clause can apply to each directive constituent
    !$omp & if(target teams: x > 0) if(teams distribute: y > 0)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
if.f90:4:11: Previous IF clause applying to the TEAMS constituent
    !$omp & if(target teams: x > 0) if(teams distribute: y > 0)
            ^^^^^^^^^^^^^^^^^^^^^^^
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list