@@ -3502,6 +3502,21 @@ struct OmpDependenceType {
35023502 WRAPPER_CLASS_BOILERPLATE (OmpDependenceType, Value);
35033503};
35043504
3505+ // Ref: [5.1:205-209], [5.2:166-168]
3506+ //
3507+ // motion-modifier ->
3508+ // PRESENT | // since 5.0, until 5.0
3509+ // mapper | iterator
3510+ // expectation ->
3511+ // PRESENT // since 5.1
3512+ //
3513+ // The PRESENT value was a part of motion-modifier in 5.1, and became a
3514+ // value of expectation in 5.2.
3515+ struct OmpExpectation {
3516+ ENUM_CLASS (Value, Present);
3517+ WRAPPER_CLASS_BOILERPLATE (OmpExpectation, Value);
3518+ };
3519+
35053520// Ref: [5.0:47-49], [5.1:49-51], [5.2:67-69]
35063521//
35073522// iterator-modifier ->
@@ -3519,6 +3534,34 @@ struct OmpLinearModifier {
35193534 WRAPPER_CLASS_BOILERPLATE (OmpLinearModifier, Value);
35203535};
35213536
3537+ // Ref: [5.0:176-180], [5.1:205-210], [5.2:149-150]
3538+ //
3539+ // mapper ->
3540+ // identifier // since 4.5
3541+ struct OmpMapper {
3542+ WRAPPER_CLASS_BOILERPLATE (OmpMapper, Name);
3543+ };
3544+
3545+ // Ref: [4.5:216-219], [5.0:315-324], [5.1:347-355], [5.2:150-158]
3546+ //
3547+ // map-type ->
3548+ // ALLOC | DELETE | FROM | RELEASE | TO | TOFROM // since 4.5
3549+ struct OmpMapType {
3550+ ENUM_CLASS (Value, Alloc, Delete, From, Release, To, Tofrom);
3551+ WRAPPER_CLASS_BOILERPLATE (OmpMapType, Value);
3552+ };
3553+
3554+ // Ref: [4.5:216-219], [5.0:315-324], [5.1:347-355], [5.2:150-158]
3555+ //
3556+ // map-type-modifier ->
3557+ // ALWAYS | // since 4.5
3558+ // CLOSE | // since 5.0
3559+ // PRESENT // since 5.1
3560+ struct OmpMapTypeModifier {
3561+ ENUM_CLASS (Value, Always, Close, Present, Ompx_Hold)
3562+ WRAPPER_CLASS_BOILERPLATE (OmpMapTypeModifier, Value);
3563+ };
3564+
35223565// Ref: [4.5:56-63], [5.0:101-109], [5.1:126-133], [5.2:252-254]
35233566//
35243567// modifier ->
@@ -3546,10 +3589,10 @@ struct OmpOrderModifier {
35463589// Ref: [4.5:201-207], [5.0:293-299], [5.1:325-331], [5.2:124]
35473590//
35483591// reduction-identifier ->
3549- // base-language-identifier | // since 4.5
3550- // - | // since 4.5, until 5.2
3551- // + | * | .AND. | .OR. | .EQV. | .NEQV. | // since 4.5
3552- // MIN | MAX | IAND | IOR | IEOR // since 4.5
3592+ // base-language-identifier | // since 4.5
3593+ // - | // since 4.5, until 5.2
3594+ // + | * | .AND. | .OR. | .EQV. | .NEQV. | // since 4.5
3595+ // MIN | MAX | IAND | IOR | IEOR // since 4.5
35533596struct OmpReductionIdentifier {
35543597 UNION_CLASS_BOILERPLATE (OmpReductionIdentifier);
35553598 std::variant<DefinedOperator, ProcedureDesignator> u;
@@ -3558,7 +3601,7 @@ struct OmpReductionIdentifier {
35583601// Ref: [5.0:300-302], [5.1:332-334], [5.2:134-137]
35593602//
35603603// reduction-modifier ->
3561- // DEFAULT | INSCAN | TASK // since 5.0
3604+ // DEFAULT | INSCAN | TASK // since 5.0
35623605struct OmpReductionModifier {
35633606 ENUM_CLASS (Value, Default, Inscan, Task);
35643607 WRAPPER_CLASS_BOILERPLATE (OmpReductionModifier, Value);
@@ -3578,9 +3621,9 @@ struct OmpTaskDependenceType {
35783621// Ref: [4.5:229-230], [5.0:324-325], [5.1:357-358], [5.2:161-162]
35793622//
35803623// variable-category ->
3581- // SCALAR | // since 4.5
3582- // AGGREGATE | ALLOCATABLE | POINTER | // since 5.0
3583- // ALL // since 5.2
3624+ // SCALAR | // since 4.5
3625+ // AGGREGATE | ALLOCATABLE | POINTER | // since 5.0
3626+ // ALL // since 5.2
35843627struct OmpVariableCategory {
35853628 ENUM_CLASS (Value, Aggregate, All, Allocatable, Pointer, Scalar)
35863629 WRAPPER_CLASS_BOILERPLATE (OmpVariableCategory, Value);
@@ -3723,15 +3766,9 @@ struct OmpDeviceTypeClause {
37233766// motion-modifier ->
37243767// PRESENT | mapper-modifier | iterator-modifier
37253768struct OmpFromClause {
3726- ENUM_CLASS (Expectation, Present);
37273769 TUPLE_CLASS_BOILERPLATE (OmpFromClause);
3728-
3729- // As in the case of MAP, modifiers are parsed as lists, even if they
3730- // are unique. These restrictions will be checked in semantic checks.
3731- std::tuple<std::optional<std::list<Expectation>>,
3732- std::optional<std::list<OmpIterator>>, OmpObjectList,
3733- bool > // were the modifiers comma-separated?
3734- t;
3770+ MODIFIER_BOILERPLATE (OmpExpectation, OmpIterator, OmpMapper);
3771+ std::tuple<MODIFIERS(), OmpObjectList, bool > t;
37353772};
37363773
37373774// OMP 5.2 12.6.1 grainsize-clause -> grainsize ([prescriptiveness :] value)
@@ -3794,31 +3831,19 @@ struct OmpLinearClause {
37943831 std::variant<WithModifier, WithoutModifier> u;
37953832};
37963833
3797- WRAPPER_CLASS (OmpMapperIdentifier, std::optional<Name>);
3798-
3799- // 2.15.5.1 map ->
3800- // MAP ([MAPPER(mapper-identifier)] [[map-type-modifier- list [,]]
3801- // [iterator- modifier [,]] map-type : ]
3802- // variable-name-list)
3803- // map-type-modifier-list -> map-type-modifier [,] [...]
3804- // map-type-modifier -> ALWAYS | CLOSE | PRESENT | OMPX_HOLD
3805- // map-type -> TO | FROM | TOFROM | ALLOC | RELEASE | DELETE
3834+ // Ref: [4.5:216-219], [5.0:315-324], [5.1:347-355], [5.2:150-158]
3835+ //
3836+ // map-clause ->
3837+ // MAP([modifier...:] locator- list) // since 4.5
3838+ // modifier ->
3839+ // map-type-modifier | // since 4.5
3840+ // mapper | // since 5.0
3841+ // iterator | // since 5.1
3842+ // map-type // since 4.5
38063843struct OmpMapClause {
3807- ENUM_CLASS (TypeModifier, Always, Close, Present, Ompx_Hold);
3808- ENUM_CLASS (Type, To, From, Tofrom, Alloc, Release, Delete)
38093844 TUPLE_CLASS_BOILERPLATE (OmpMapClause);
3810-
3811- // All modifiers are parsed into optional lists, even if they are unique.
3812- // The checks for satisfying those constraints are deferred to semantics.
3813- // In OpenMP 5.2 the non-comma syntax has been deprecated: keep the
3814- // information about separator presence to emit a diagnostic if needed.
3815- std::tuple<OmpMapperIdentifier, // Mapper name
3816- std::optional<std::list<TypeModifier>>,
3817- std::optional<std::list<OmpIterator>>, // unique
3818- std::optional<std::list<Type>>, // unique
3819- OmpObjectList,
3820- bool > // were the modifiers comma-separated?
3821- t;
3845+ MODIFIER_BOILERPLATE (OmpMapTypeModifier, OmpMapper, OmpIterator, OmpMapType);
3846+ std::tuple<MODIFIERS(), OmpObjectList, bool > t;
38223847};
38233848
38243849// Ref: [5.0:101-109], [5.1:126-134], [5.2:233-234]
@@ -3869,23 +3894,17 @@ struct OmpScheduleClause {
38693894// Ref: [4.5:107-109], [5.0:176-180], [5.1:205-210], [5.2:167-168]
38703895//
38713896// to-clause (in DECLARE TARGET) ->
3872- // TO(extended-list) | // until 5.1
3897+ // TO(extended-list) | // until 5.1
38733898// to-clause (in TARGET UPDATE) ->
38743899// TO(locator-list) |
3875- // TO(mapper-modifier: locator-list) | // since 5.0
3876- // TO(motion-modifier[,] ...: locator-list) // since 5.1
3877- // motion-modifier ->
3900+ // TO(mapper-modifier: locator-list) | // since 5.0
3901+ // TO(motion-modifier[,] ...: locator-list) // since 5.1
3902+ // motion-modifier ->
38783903// PRESENT | mapper-modifier | iterator-modifier
38793904struct OmpToClause {
3880- using Expectation = OmpFromClause::Expectation;
38813905 TUPLE_CLASS_BOILERPLATE (OmpToClause);
3882-
3883- // As in the case of MAP, modifiers are parsed as lists, even if they
3884- // are unique. These restrictions will be checked in semantic checks.
3885- std::tuple<std::optional<std::list<Expectation>>,
3886- std::optional<std::list<OmpIterator>>, OmpObjectList,
3887- bool > // were the modifiers comma-separated?
3888- t;
3906+ MODIFIER_BOILERPLATE (OmpExpectation, OmpIterator, OmpMapper);
3907+ std::tuple<MODIFIERS(), OmpObjectList, bool > t;
38893908};
38903909
38913910// OMP 5.2 12.6.2 num_tasks-clause -> num_tasks ([prescriptiveness :] value)
@@ -3897,8 +3916,10 @@ struct OmpNumTasksClause {
38973916
38983917// Ref: [5.0:254-255], [5.1:287-288], [5.2:321-322]
38993918//
3900- // update-clause -> UPDATE(dependence-type) // since 5.0, until 5.1
3901- // update-clause -> UPDATE(task-dependence-type) // since 5.2
3919+ // update-clause ->
3920+ // UPDATE(dependence-type) // since 5.0, until 5.1
3921+ // update-clause ->
3922+ // UPDATE(task-dependence-type) // since 5.2
39023923struct OmpUpdateClause {
39033924 UNION_CLASS_BOILERPLATE (OmpUpdateClause);
39043925 std::variant<OmpDependenceType, OmpTaskDependenceType> u;
0 commit comments