@@ -3686,21 +3686,51 @@ struct OmpAllocateClause {
36863686 std::tuple<MODIFIERS(), OmpObjectList> t;
36873687};
36883688
3689- // OMP 5.0 2.4 atomic-default-mem-order-clause ->
3690- // ATOMIC_DEFAULT_MEM_ORDER (SEQ_CST | ACQ_REL |
3691- // RELAXED)
3689+ // Ref: [5.0:60-63], [5.1:83-86], [5.2:210-213]
3690+ //
3691+ // atomic-default-mem-order-clause ->
3692+ // ATOMIC_DEFAULT_MEM_ORDER(memory-order) // since 5.0
3693+ // memory-order ->
3694+ // SEQ_CST | ACQ_REL | RELAXED | // since 5.0
3695+ // ACQUIRE | RELEASE // since 5.2
36923696struct OmpAtomicDefaultMemOrderClause {
3693- WRAPPER_CLASS_BOILERPLATE (
3694- OmpAtomicDefaultMemOrderClause, common::OmpAtomicDefaultMemOrderType);
3697+ using MemoryOrder = common::OmpAtomicDefaultMemOrderType;
3698+ WRAPPER_CLASS_BOILERPLATE (OmpAtomicDefaultMemOrderClause, MemoryOrder);
3699+ };
3700+
3701+ // Ref: [5.0:128-131], [5.1:151-154], [5.2:258-259]
3702+ //
3703+ // bind-clause ->
3704+ // BIND(binding) // since 5.0
3705+ // binding ->
3706+ // TEAMS | PARALLEL | THREAD // since 5.0
3707+ struct OmpBindClause {
3708+ ENUM_CLASS (Binding, Parallel, Teams, Thread)
3709+ WRAPPER_CLASS_BOILERPLATE (OmpBindClause, Binding);
36953710};
36963711
3697- // 2.15.3.1 default-clause -> DEFAULT (PRIVATE | FIRSTPRIVATE | SHARED | NONE)
3712+ // Ref: [4.5:46-50], [5.0:74-78], [5.1:92-96], [5.2:109]
3713+ //
3714+ // default-clause ->
3715+ // DEFAULT(data-sharing-attribute) // since 4.5
3716+ // data-sharing-attribute ->
3717+ // SHARED | NONE | // since 4.5
3718+ // PRIVATE | FIRSTPRIVATE // since 5.0
36983719struct OmpDefaultClause {
3699- ENUM_CLASS (Type , Private, Firstprivate, Shared, None)
3700- WRAPPER_CLASS_BOILERPLATE (OmpDefaultClause, Type );
3720+ ENUM_CLASS (DataSharingAttribute , Private, Firstprivate, Shared, None)
3721+ WRAPPER_CLASS_BOILERPLATE (OmpDefaultClause, DataSharingAttribute );
37013722};
37023723
3703- // 2.15.5.2 defaultmap -> DEFAULTMAP (implicit-behavior[:variable-category])
3724+ // Ref: [4.5:103-107], [5.0:324-325], [5.1:357-358], [5.2:161-162]
3725+ //
3726+ // defaultmap-clause ->
3727+ // DEFAULTMAP(implicit-behavior
3728+ // [: variable-category]) // since 5.0
3729+ // implicit-behavior ->
3730+ // TOFROM | // since 4.5
3731+ // ALLOC | TO | FROM | FIRSTPRIVATE | NONE |
3732+ // DEFAULT | // since 5.0
3733+ // PRESENT // since 5.1
37043734struct OmpDefaultmapClause {
37053735 TUPLE_CLASS_BOILERPLATE (OmpDefaultmapClause);
37063736 ENUM_CLASS (
@@ -3709,23 +3739,35 @@ struct OmpDefaultmapClause {
37093739 std::tuple<ImplicitBehavior, MODIFIERS()> t;
37103740};
37113741
3712- // 2.13.9 iteration-offset -> +/- non-negative-constant
3742+ // Ref: [4.5:169-172], [5.0:255-259], [5.1:288-292], [5.2:91-93]
3743+ //
3744+ // iteration-offset ->
3745+ // +|- non-negative-constant // since 4.5
37133746struct OmpIterationOffset {
37143747 TUPLE_CLASS_BOILERPLATE (OmpIterationOffset);
37153748 std::tuple<DefinedOperator, ScalarIntConstantExpr> t;
37163749};
37173750
3718- // 2.13.9 iteration -> induction-variable [iteration-offset]
3751+ // Ref: [4.5:169-172], [5.0:255-259], [5.1:288-292], [5.2:91-93]
3752+ //
3753+ // iteration ->
3754+ // induction-variable [iteration-offset] // since 4.5
37193755struct OmpIteration {
37203756 TUPLE_CLASS_BOILERPLATE (OmpIteration);
37213757 std::tuple<Name, std::optional<OmpIterationOffset>> t;
37223758};
37233759
3760+ // Ref: [4.5:169-172], [5.0:255-259], [5.1:288-292], [5.2:91-93]
3761+ //
3762+ // iteration-vector ->
3763+ // [iteration...] // since 4.5
37243764WRAPPER_CLASS (OmpIterationVector, std::list<OmpIteration>);
37253765
37263766// Extract this into a separate structure (instead of having it directly in
37273767// OmpDoacrossClause), so that the context in TYPE_CONTEXT_PARSER can be set
37283768// separately for OmpDependClause and OmpDoacrossClause.
3769+ //
3770+ // See: depend-clause, doacross-clause
37293771struct OmpDoacross {
37303772 OmpDependenceType::Value GetDepType () const ;
37313773
@@ -3735,15 +3777,15 @@ struct OmpDoacross {
37353777 std::variant<Sink, Source> u;
37363778};
37373779
3738- // Ref: [4.5:169-170 ], [5.0:255-256 ], [5.1:288-289 ], [5.2:323-324 ]
3780+ // Ref: [4.5:169-172 ], [5.0:255-259 ], [5.1:288-292 ], [5.2:323-326 ]
37393781//
37403782// depend-clause ->
3741- // DEPEND(SOURCE) | // since 4.5, until 5.1
3742- // DEPEND(SINK: iteration-vector) | // since 4.5, until 5.1
3783+ // DEPEND(SOURCE) | // since 4.5, until 5.1
3784+ // DEPEND(SINK: iteration-vector) | // since 4.5, until 5.1
37433785// DEPEND([depend-modifier,]
3744- // task-dependence-type: locator-list) // since 4.5
3786+ // task-dependence-type: locator-list) // since 4.5
37453787//
3746- // depend-modifier -> iterator-modifier // since 5.0
3788+ // depend-modifier -> iterator-modifier // since 5.0
37473789struct OmpDependClause {
37483790 UNION_CLASS_BOILERPLATE (OmpDependClause);
37493791 struct TaskDep {
@@ -3755,6 +3797,10 @@ struct OmpDependClause {
37553797 std::variant<TaskDep, OmpDoacross> u;
37563798};
37573799
3800+ // Ref: [5.2:326-328]
3801+ //
3802+ // doacross-clause ->
3803+ // DOACROSS(dependence-type: iteration-vector) // since 5.2
37583804WRAPPER_CLASS (OmpDoacrossClause, OmpDoacross);
37593805
37603806// Ref: [5.0:254-255], [5.1:287-288], [5.2:73]
@@ -3764,25 +3810,41 @@ WRAPPER_CLASS(OmpDoacrossClause, OmpDoacross);
37643810// DESTROY(variable) // since 5.2
37653811WRAPPER_CLASS (OmpDestroyClause, OmpObject);
37663812
3767- // device([ device-modifier :] scalar-integer-expression)
3813+ // Ref: [5.0:135-140], [5.1:161-166], [5.2:265-266]
3814+ //
3815+ // detach-clause ->
3816+ // DETACH(event-handle) // since 5.0
3817+ struct OmpDetachClause {
3818+ WRAPPER_CLASS_BOILERPLATE (OmpDetachClause, OmpObject);
3819+ };
3820+
3821+ // Ref: [4.5:103-107], [5.0:170-176], [5.1:197-205], [5.2:276-277]
3822+ //
3823+ // device-clause ->
3824+ // DEVICE(scalar-integer-expression) | // since 4.5
3825+ // DEVICE([device-modifier:]
3826+ // scalar-integer-expression) // since 5.0
37683827struct OmpDeviceClause {
37693828 TUPLE_CLASS_BOILERPLATE (OmpDeviceClause);
37703829 ENUM_CLASS (DeviceModifier, Ancestor, Device_Num)
37713830 std::tuple<std::optional<DeviceModifier>, ScalarIntExpr> t;
37723831};
37733832
3774- // device_type(any | host | nohost)
3833+ // Ref: [5.0:180-185], [5.1:210-216], [5.2:275]
3834+ //
3835+ // device-type-clause ->
3836+ // DEVICE_TYPE(ANY | HOST | NOHOST) // since 5.0
37753837struct OmpDeviceTypeClause {
3776- ENUM_CLASS (Type , Any, Host, Nohost)
3777- WRAPPER_CLASS_BOILERPLATE (OmpDeviceTypeClause, Type );
3838+ ENUM_CLASS (DeviceTypeDescription , Any, Host, Nohost)
3839+ WRAPPER_CLASS_BOILERPLATE (OmpDeviceTypeClause, DeviceTypeDescription );
37783840};
37793841
37803842// Ref: [4.5:107-109], [5.0:176-180], [5.1:205-210], [5.2:167-168]
37813843//
37823844// from-clause ->
37833845// FROM(locator-list) |
3784- // FROM(mapper-modifier: locator-list) | // since 5.0
3785- // FROM(motion-modifier[,] ...: locator-list) // since 5.1
3846+ // FROM(mapper-modifier: locator-list) | // since 5.0
3847+ // FROM(motion-modifier[,] ...: locator-list) // since 5.1
37863848// motion-modifier ->
37873849// PRESENT | mapper-modifier | iterator-modifier
37883850struct OmpFromClause {
@@ -3806,11 +3868,6 @@ struct OmpIfClause {
38063868 std::tuple<std::optional<DirectiveNameModifier>, ScalarLogicalExpr> t;
38073869};
38083870
3809- // OpenMPv5.2 12.5.2 detach-clause -> DETACH (event-handle)
3810- struct OmpDetachClause {
3811- WRAPPER_CLASS_BOILERPLATE (OmpDetachClause, OmpObject);
3812- };
3813-
38143871// OMP 5.0 2.19.5.6 in_reduction-clause -> IN_REDUCTION (reduction-identifier:
38153872// variable-name-list)
38163873struct OmpInReductionClause {
@@ -3878,10 +3935,16 @@ struct OmpOrderClause {
38783935 std::tuple<MODIFIERS(), Ordering> t;
38793936};
38803937
3881- // 2.5 proc-bind-clause -> PROC_BIND (MASTER | CLOSE | SPREAD)
3938+ // Ref: [4.5:46-50], [5.0:74-78], [5.1:92-96], [5.2:229-230]
3939+ //
3940+ // proc-bind-clause ->
3941+ // PROC_BIND(affinity-policy) // since 4.5
3942+ // affinity-policy ->
3943+ // CLOSE | PRIMARY | SPREAD | // since 4.5
3944+ // MASTER // since 4.5, until 5.2
38823945struct OmpProcBindClause {
3883- ENUM_CLASS (Type , Close, Master, Spread, Primary)
3884- WRAPPER_CLASS_BOILERPLATE (OmpProcBindClause, Type );
3946+ ENUM_CLASS (AffinityPolicy , Close, Master, Spread, Primary)
3947+ WRAPPER_CLASS_BOILERPLATE (OmpProcBindClause, AffinityPolicy );
38853948};
38863949
38873950// Ref: [4.5:201-207], [5.0:300-302], [5.1:332-334], [5.2:134-137]
@@ -3945,13 +4008,6 @@ struct OmpUpdateClause {
39454008 std::variant<OmpDependenceType, OmpTaskDependenceType> u;
39464009};
39474010
3948- // OMP 5.2 11.7.1 bind-clause ->
3949- // BIND( PARALLEL | TEAMS | THREAD )
3950- struct OmpBindClause {
3951- ENUM_CLASS (Type, Parallel, Teams, Thread)
3952- WRAPPER_CLASS_BOILERPLATE (OmpBindClause, Type);
3953- };
3954-
39554011// OpenMP Clauses
39564012struct OmpClause {
39574013 UNION_CLASS_BOILERPLATE (OmpClause);
0 commit comments