[all-commits] [llvm/llvm-project] e5f3eb: [flang][OpenMP] Check DEFAULT(NONE) on metadirecti...

Chi-Chun, Chen via All-commits all-commits at lists.llvm.org
Thu Jul 16 20:46:32 PDT 2026


  Branch: refs/heads/users/cchen/flang-metadirective-loop-default-none
  Home:   https://github.com/llvm/llvm-project
  Commit: e5f3ebe2e8a21877d8b91c4690ffd24c6f16ca04
      https://github.com/llvm/llvm-project/commit/e5f3ebe2e8a21877d8b91c4690ffd24c6f16ca04
  Author: chichunchen <chichunchen844 at gmail.com>
  Date:   2026-07-16 (Thu, 16 Jul 2026)

  Changed paths:
    M flang/lib/Semantics/check-omp-structure.h
    M flang/lib/Semantics/check-omp-variant.cpp
    A flang/test/Semantics/OpenMP/metadirective-default-none.f90

  Log Message:
  -----------
  [flang][OpenMP] Check DEFAULT(NONE) on metadirective loop variants

Standalone metadirectives and their associated loops are separate parse-tree
nodes. For example:

```fortran
!$omp metadirective &
!$omp& when(implementation={vendor(llvm)}: &
!$omp& parallel do default(none) shared(n, a)) default(nothing)
do i = 1, n
  a(i) = x
end do
```

Unlike an ordinary PARALLEL DO, the loop is not nested under the directive:

```text
METADIRECTIVE
`-- WHEN
    `-- PARALLEL DO DEFAULT(NONE) SHARED(n, a)

DO
`-- a(i) = x
```

Name resolution therefore leaves the variant context before visiting the loop
and does not diagnose the missing data-sharing attribute for `x`.

After associating a metadirective with its loop, validate DEFAULT(NONE) for
each potentially selectable loop variant. Preserve the existing rules for
predetermined and explicit data-sharing attributes, static locals, nested
constructs, specification expressions, and statically inapplicable variants.

Add semantic tests for variant selection and data-sharing behavior.



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