@@ -7582,7 +7582,8 @@ class OMPToClause final : public OMPMappableExprListClause<OMPToClause>,
75827582
75837583 // / Motion-modifiers for the 'to' clause.
75847584 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7585- OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown};
7585+ OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7586+ OMPC_MOTION_MODIFIER_unknown};
75867587
75877588 // / Location of motion-modifiers for the 'to' clause.
75887589 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
@@ -7654,6 +7655,9 @@ class OMPToClause final : public OMPMappableExprListClause<OMPToClause>,
76547655 MotionModifiersLoc[I] = TLoc;
76557656 }
76567657
7658+ void setIteratorModifier (Expr *IteratorModifier) {
7659+ getTrailingObjects<Expr *>()[2 * varlist_size ()] = IteratorModifier;
7660+ }
76577661 // / Set colon location.
76587662 void setColonLoc (SourceLocation Loc) { ColonLoc = Loc; }
76597663
@@ -7662,7 +7666,7 @@ class OMPToClause final : public OMPMappableExprListClause<OMPToClause>,
76627666 size_t numTrailingObjects (OverloadToken<Expr *>) const {
76637667 // There are varlist_size() of expressions, and varlist_size() of
76647668 // user-defined mappers.
7665- return 2 * varlist_size ();
7669+ return 2 * varlist_size () + 1 ;
76667670 }
76677671 size_t numTrailingObjects (OverloadToken<ValueDecl *>) const {
76687672 return getUniqueDeclarationsNum ();
@@ -7688,15 +7692,14 @@ class OMPToClause final : public OMPMappableExprListClause<OMPToClause>,
76887692 // / \param UDMQualifierLoc C++ nested name specifier for the associated
76897693 // / user-defined mapper.
76907694 // / \param MapperId The identifier of associated user-defined mapper.
7691- static OMPToClause *Create (const ASTContext &C, const OMPVarListLocTy &Locs,
7692- ArrayRef<Expr *> Vars,
7693- ArrayRef<ValueDecl *> Declarations,
7694- MappableExprComponentListsRef ComponentLists,
7695- ArrayRef<Expr *> UDMapperRefs,
7696- ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7697- ArrayRef<SourceLocation> MotionModifiersLoc,
7698- NestedNameSpecifierLoc UDMQualifierLoc,
7699- DeclarationNameInfo MapperId);
7695+ static OMPToClause *
7696+ Create (const ASTContext &C, const OMPVarListLocTy &Locs,
7697+ ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7698+ MappableExprComponentListsRef ComponentLists,
7699+ ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
7700+ ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7701+ ArrayRef<SourceLocation> MotionModifiersLoc,
7702+ NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
77007703
77017704 // / Creates an empty clause with the place for \a NumVars variables.
77027705 // /
@@ -7717,7 +7720,9 @@ class OMPToClause final : public OMPMappableExprListClause<OMPToClause>,
77177720 " Requested modifier exceeds the total number of modifiers." );
77187721 return MotionModifiers[Cnt];
77197722 }
7720-
7723+ Expr *getIteratorModifier () const {
7724+ return getTrailingObjects<Expr *>()[2 * varlist_size ()];
7725+ }
77217726 // / Fetches the motion-modifier location at 'Cnt' index of array of modifiers'
77227727 // / locations.
77237728 // /
@@ -7782,7 +7787,8 @@ class OMPFromClause final
77827787
77837788 // / Motion-modifiers for the 'from' clause.
77847789 OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7785- OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown};
7790+ OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7791+ OMPC_MOTION_MODIFIER_unknown};
77867792
77877793 // / Location of motion-modifiers for the 'from' clause.
77887794 SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
@@ -7843,7 +7849,9 @@ class OMPFromClause final
78437849 " Unexpected index to store motion modifier, exceeds array size." );
78447850 MotionModifiers[I] = T;
78457851 }
7846-
7852+ void setIteratorModifier (Expr *IteratorModifier) {
7853+ getTrailingObjects<Expr *>()[2 * varlist_size ()] = IteratorModifier;
7854+ }
78477855 // / Set location for the motion-modifier.
78487856 // /
78497857 // / \param I index for motion-modifier location.
@@ -7862,7 +7870,7 @@ class OMPFromClause final
78627870 size_t numTrailingObjects (OverloadToken<Expr *>) const {
78637871 // There are varlist_size() of expressions, and varlist_size() of
78647872 // user-defined mappers.
7865- return 2 * varlist_size ();
7873+ return 2 * varlist_size () + 1 ;
78667874 }
78677875 size_t numTrailingObjects (OverloadToken<ValueDecl *>) const {
78687876 return getUniqueDeclarationsNum ();
@@ -7892,7 +7900,7 @@ class OMPFromClause final
78927900 Create (const ASTContext &C, const OMPVarListLocTy &Locs,
78937901 ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
78947902 MappableExprComponentListsRef ComponentLists,
7895- ArrayRef<Expr *> UDMapperRefs,
7903+ ArrayRef<Expr *> UDMapperRefs, Expr *IteratorExpr,
78967904 ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
78977905 ArrayRef<SourceLocation> MotionModifiersLoc,
78987906 NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
@@ -7916,7 +7924,9 @@ class OMPFromClause final
79167924 " Requested modifier exceeds the total number of modifiers." );
79177925 return MotionModifiers[Cnt];
79187926 }
7919-
7927+ Expr *getIteratorModifier () const {
7928+ return getTrailingObjects<Expr *>()[2 * varlist_size ()];
7929+ }
79207930 // / Fetches the motion-modifier location at 'Cnt' index of array of modifiers'
79217931 // / locations.
79227932 // /
0 commit comments