[all-commits] [llvm/llvm-project] cf25fb: [flang][OpenMP] Add structure checks for DECLARE V...

Abid Qadeer via All-commits all-commits at lists.llvm.org
Tue Jun 2 08:58:07 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cf25fb1e0809aaf4dbb13f2b837d47e329f595b8
      https://github.com/llvm/llvm-project/commit/cf25fb1e0809aaf4dbb13f2b837d47e329f595b8
  Author: Abid Qadeer <haqadeer at amd.com>
  Date:   2026-06-02 (Tue, 02 Jun 2026)

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

  Log Message:
  -----------
  [flang][OpenMP] Add structure checks for DECLARE VARIANT (#198799)

This PR adds declare-variant structure checking. Following checks are
added:

- Validate [base:]variant arguments (including implicit base for
single-name form).
- Require exactly one MATCH clause; reject a second MATCH on the same
directive.
- Reject duplicate (base, variant) across multiple declare variant
directives.
- Reject clauses not allowed on declare variant.
- Apply shared context-selector checks to MATCH (reuse metadirective
logic).
- Require constant user conditions in MATCH for declare variant (dynamic
selectors deferred).

Refactor metadirective support:

- Extract CheckContextSelectorSpecification for reuse.
- Reject SCORE on trait sets that do not allow it (also affects
metadirective).

Co-authored-by: Cursor <cursoragent at cursor.com>



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