[all-commits] [llvm/llvm-project] 03cbe4: [flang][OpenMP] Rework LINEAR clause (#119278)

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Thu Dec 12 10:19:56 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 03cbe42627c7a7940b47cc1a2cda0120bc9c6d5e
      https://github.com/llvm/llvm-project/commit/03cbe42627c7a7940b47cc1a2cda0120bc9c6d5e
  Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
  Date:   2024-12-12 (Thu, 12 Dec 2024)

  Changed paths:
    M flang/examples/FeatureList/FeatureList.cpp
    M flang/include/flang/Parser/dump-parse-tree.h
    M flang/include/flang/Parser/parse-tree-visitor.h
    M flang/include/flang/Parser/parse-tree.h
    M flang/include/flang/Semantics/openmp-modifiers.h
    M flang/lib/Lower/OpenMP/Clauses.cpp
    M flang/lib/Parser/openmp-parsers.cpp
    M flang/lib/Parser/unparse.cpp
    M flang/lib/Semantics/check-omp-structure.cpp
    M flang/lib/Semantics/openmp-modifiers.cpp
    M flang/lib/Semantics/resolve-directives.cpp
    A flang/test/Parser/OpenMP/linear-clause.f90
    M flang/test/Semantics/OpenMP/clause-validity01.f90
    M flang/test/Semantics/OpenMP/linear-clause01.f90
    A flang/test/Semantics/OpenMP/linear-clause02.f90
    M flang/test/Semantics/OpenMP/linear-iter.f90
    M llvm/include/llvm/Frontend/OpenMP/ClauseT.h
    M llvm/unittests/Frontend/OpenMPDecompositionTest.cpp

  Log Message:
  -----------
  [flang][OpenMP] Rework LINEAR clause (#119278)

The OmpLinearClause class was a variant of two classes, one for when the
linear modifier was present, and one for when it was absent. These two
classes did not follow the conventions for parse tree nodes, (i.e.
tuple/wrapper/union formats), which necessitated specialization of the
parse tree visitor.

The new form of OmpLinearClause is the standard tuple with a list of
modifiers and an object list. The specialization of parse tree visitor
for it has been removed.
Parsing and unparsing of the new form bears additional complexity due to
syntactical differences between OpenMP 5.2 and prior versions: in OpenMP
5.2 the argument list is post-modified, while in the prior versions, the
step modifier was a post-modifier while the linear modifier had an
unusual syntax of `modifier(list)`.

With this change the LINEAR clause is no different from any other
clauses in terms of its structure and use of modifiers. Modifier
validation and all other checks work the same as with other clauses.



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