@@ -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,34 @@ struct OmpLinearModifier {
3519
3534
WRAPPER_CLASS_BOILERPLATE (OmpLinearModifier, Value);
3520
3535
};
3521
3536
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
+
3522
3565
// Ref: [4.5:56-63], [5.0:101-109], [5.1:126-133], [5.2:252-254]
3523
3566
//
3524
3567
// modifier ->
@@ -3546,10 +3589,10 @@ struct OmpOrderModifier {
3546
3589
// Ref: [4.5:201-207], [5.0:293-299], [5.1:325-331], [5.2:124]
3547
3590
//
3548
3591
// 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
3553
3596
struct OmpReductionIdentifier {
3554
3597
UNION_CLASS_BOILERPLATE (OmpReductionIdentifier);
3555
3598
std::variant<DefinedOperator, ProcedureDesignator> u;
@@ -3558,7 +3601,7 @@ struct OmpReductionIdentifier {
3558
3601
// Ref: [5.0:300-302], [5.1:332-334], [5.2:134-137]
3559
3602
//
3560
3603
// reduction-modifier ->
3561
- // DEFAULT | INSCAN | TASK // since 5.0
3604
+ // DEFAULT | INSCAN | TASK // since 5.0
3562
3605
struct OmpReductionModifier {
3563
3606
ENUM_CLASS (Value, Default, Inscan, Task);
3564
3607
WRAPPER_CLASS_BOILERPLATE (OmpReductionModifier, Value);
@@ -3578,9 +3621,9 @@ struct OmpTaskDependenceType {
3578
3621
// Ref: [4.5:229-230], [5.0:324-325], [5.1:357-358], [5.2:161-162]
3579
3622
//
3580
3623
// 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
3584
3627
struct OmpVariableCategory {
3585
3628
ENUM_CLASS (Value, Aggregate, All, Allocatable, Pointer, Scalar)
3586
3629
WRAPPER_CLASS_BOILERPLATE (OmpVariableCategory, Value);
@@ -3723,15 +3766,9 @@ struct OmpDeviceTypeClause {
3723
3766
// motion-modifier ->
3724
3767
// PRESENT | mapper-modifier | iterator-modifier
3725
3768
struct OmpFromClause {
3726
- ENUM_CLASS (Expectation, Present);
3727
3769
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;
3735
3772
};
3736
3773
3737
3774
// OMP 5.2 12.6.1 grainsize-clause -> grainsize ([prescriptiveness :] value)
@@ -3794,31 +3831,19 @@ struct OmpLinearClause {
3794
3831
std::variant<WithModifier, WithoutModifier> u;
3795
3832
};
3796
3833
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
3806
3843
struct OmpMapClause {
3807
- ENUM_CLASS (TypeModifier, Always, Close, Present, Ompx_Hold);
3808
- ENUM_CLASS (Type, To, From, Tofrom, Alloc, Release, Delete)
3809
3844
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;
3822
3847
};
3823
3848
3824
3849
// Ref: [5.0:101-109], [5.1:126-134], [5.2:233-234]
@@ -3869,23 +3894,17 @@ struct OmpScheduleClause {
3869
3894
// Ref: [4.5:107-109], [5.0:176-180], [5.1:205-210], [5.2:167-168]
3870
3895
//
3871
3896
// to-clause (in DECLARE TARGET) ->
3872
- // TO(extended-list) | // until 5.1
3897
+ // TO(extended-list) | // until 5.1
3873
3898
// to-clause (in TARGET UPDATE) ->
3874
3899
// 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 ->
3878
3903
// PRESENT | mapper-modifier | iterator-modifier
3879
3904
struct OmpToClause {
3880
- using Expectation = OmpFromClause::Expectation;
3881
3905
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;
3889
3908
};
3890
3909
3891
3910
// OMP 5.2 12.6.2 num_tasks-clause -> num_tasks ([prescriptiveness :] value)
@@ -3897,8 +3916,10 @@ struct OmpNumTasksClause {
3897
3916
3898
3917
// Ref: [5.0:254-255], [5.1:287-288], [5.2:321-322]
3899
3918
//
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
3902
3923
struct OmpUpdateClause {
3903
3924
UNION_CLASS_BOILERPLATE (OmpUpdateClause);
3904
3925
std::variant<OmpDependenceType, OmpTaskDependenceType> u;
0 commit comments