[OpenMP][NFC] Refactor code for interop parts of 'init' and 'append_args' clauses
authorMike Rice <michael.p.rice@intel.com>
Thu, 18 Aug 2022 18:54:52 +0000 (11:54 -0700)
committerMike Rice <michael.p.rice@intel.com>
Fri, 19 Aug 2022 00:13:30 +0000 (17:13 -0700)
commit89167e3c5b008b44f1fa8a222652e7bdc62cfa8a
tree6df00e1fee466dd4cdd09a16d1840fde87a5faff
parent71f0ec242f348e7d22988cf6ef1a5185b53df70b
[OpenMP][NFC] Refactor code for interop parts of 'init' and 'append_args' clauses

The 'init' clause allows an interop-modifier of prefer_type(list) and
and interop-types 'target' and 'targetsync'.

The 'append_args' clause uses an append-op that also includes
interop-types ('target' and 'targetsync') and will allow
a prefer_type list in the next OpenMP version.

This change adds a helper struct OMPInteropInfo and uses it in the parsing
of both the 'init' and 'append_args' clauses.

One OMPInteropInfo object represents the info in a single 'init' clause.
Since 'append_args' allows a variable number of interop items it will
require an array of OMPInteropInfo objects once that is supported.

Differential Revision: https://reviews.llvm.org/D132171
clang/include/clang/AST/OpenMPClause.h
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/Sema.h
clang/lib/AST/OpenMPClause.cpp
clang/lib/Parse/ParseOpenMP.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/lib/Sema/TreeTransform.h