@@ -3502,6 +3502,21 @@ struct OmpDependenceType {
3502
3502
WRAPPER_CLASS_BOILERPLATE (OmpDependenceType, Value);
3503
3503
};
3504
3504
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
+
3505
3520
// Ref: [5.0:47-49], [5.1:49-51], [5.2:67-69]
3506
3521
//
3507
3522
// iterator-modifier ->
@@ -3519,6 +3534,24 @@ struct OmpLinearModifier {
3519
3534
WRAPPER_CLASS_BOILERPLATE (OmpLinearModifier, Value);
3520
3535
};
3521
3536
3537
+ // [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
+ struct OmpMapType {
3546
+ ENUM_CLASS (Value, Alloc, Delete, From, Release, To, Tofrom);
3547
+ WRAPPER_CLASS_BOILERPLATE (OmpMapType, Value);
3548
+ };
3549
+
3550
+ struct OmpMapTypeModifier {
3551
+ ENUM_CLASS (Value, Always, Close, Present, Ompx_Hold)
3552
+ WRAPPER_CLASS_BOILERPLATE (OmpMapTypeModifier, Value);
3553
+ };
3554
+
3522
3555
// Ref: [4.5:56-63], [5.0:101-109], [5.1:126-133], [5.2:252-254]
3523
3556
//
3524
3557
// modifier ->
@@ -3723,15 +3756,9 @@ struct OmpDeviceTypeClause {
3723
3756
// motion-modifier ->
3724
3757
// PRESENT | mapper-modifier | iterator-modifier
3725
3758
struct OmpFromClause {
3726
- ENUM_CLASS (Expectation, Present);
3727
3759
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;
3760
+ MODIFIER_BOILERPLATE (OmpExpectation, OmpIterator, OmpMapper);
3761
+ std::tuple<MODIFIERS(), OmpObjectList, bool > t;
3735
3762
};
3736
3763
3737
3764
// OMP 5.2 12.6.1 grainsize-clause -> grainsize ([prescriptiveness :] value)
@@ -3794,8 +3821,6 @@ struct OmpLinearClause {
3794
3821
std::variant<WithModifier, WithoutModifier> u;
3795
3822
};
3796
3823
3797
- WRAPPER_CLASS (OmpMapperIdentifier, std::optional<Name>);
3798
-
3799
3824
// 2.15.5.1 map ->
3800
3825
// MAP ([MAPPER(mapper-identifier)] [[map-type-modifier-list [,]]
3801
3826
// [iterator-modifier [,]] map-type : ]
@@ -3804,21 +3829,9 @@ WRAPPER_CLASS(OmpMapperIdentifier, std::optional<Name>);
3804
3829
// map-type-modifier -> ALWAYS | CLOSE | PRESENT | OMPX_HOLD
3805
3830
// map-type -> TO | FROM | TOFROM | ALLOC | RELEASE | DELETE
3806
3831
struct OmpMapClause {
3807
- ENUM_CLASS (TypeModifier, Always, Close, Present, Ompx_Hold);
3808
- ENUM_CLASS (Type, To, From, Tofrom, Alloc, Release, Delete)
3809
3832
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;
3833
+ MODIFIER_BOILERPLATE (OmpMapTypeModifier, OmpMapper, OmpIterator, OmpMapType);
3834
+ std::tuple<MODIFIERS(), OmpObjectList, bool > t;
3822
3835
};
3823
3836
3824
3837
// Ref: [5.0:101-109], [5.1:126-134], [5.2:233-234]
@@ -3877,15 +3890,9 @@ struct OmpScheduleClause {
3877
3890
// motion-modifier ->
3878
3891
// PRESENT | mapper-modifier | iterator-modifier
3879
3892
struct OmpToClause {
3880
- using Expectation = OmpFromClause::Expectation;
3881
3893
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;
3894
+ MODIFIER_BOILERPLATE (OmpExpectation, OmpIterator, OmpMapper);
3895
+ std::tuple<MODIFIERS(), OmpObjectList, bool > t;
3889
3896
};
3890
3897
3891
3898
// OMP 5.2 12.6.2 num_tasks-clause -> num_tasks ([prescriptiveness :] value)
0 commit comments