@@ -302,8 +302,7 @@ template <class T> class OMPVarListClause : public OMPClause {
302302 void setVarRefs (ArrayRef<Expr *> VL) {
303303 assert (VL.size () == NumVars &&
304304 " Number of variables is not the same as the preallocated buffer" );
305- std::copy (VL.begin (), VL.end (),
306- static_cast <T *>(this )->template getTrailingObjects <Expr *>());
305+ llvm::copy (VL, getVarRefs ().begin ());
307306 }
308307
309308public:
@@ -388,9 +387,7 @@ template <class T> class OMPDirectiveListClause : public OMPClause {
388387 assert (
389388 DK.size () == NumKinds &&
390389 " Number of directive kinds is not the same as the preallocated buffer" );
391- std::copy (DK.begin (), DK.end (),
392- static_cast <T *>(this )
393- ->template getTrailingObjects <OpenMPDirectiveKind>());
390+ std::copy (DK.begin (), DK.end (), getDirectiveKinds ().begin ());
394391 }
395392
396393 SourceLocation getLParenLoc () { return LParenLoc; }
@@ -980,20 +977,14 @@ class OMPSizesClause final
980977
981978 // / Returns the tile size expressions.
982979 MutableArrayRef<Expr *> getSizesRefs () {
983- return static_cast <OMPSizesClause *>(this )
984- ->template getTrailingObjects <Expr *>(NumSizes);
985- }
986- ArrayRef<Expr *> getSizesRefs () const {
987- return static_cast <const OMPSizesClause *>(this )
988- ->template getTrailingObjects <Expr *>(NumSizes);
980+ return getTrailingObjects (NumSizes);
989981 }
982+ ArrayRef<Expr *> getSizesRefs () const { return getTrailingObjects (NumSizes); }
990983
991984 // / Sets the tile size expressions.
992985 void setSizesRefs (ArrayRef<Expr *> VL) {
993986 assert (VL.size () == NumSizes);
994- std::copy (VL.begin (), VL.end (),
995- static_cast <OMPSizesClause *>(this )
996- ->template getTrailingObjects <Expr *>());
987+ llvm::copy (VL, getSizesRefs ().begin ());
997988 }
998989
999990 child_range children () {
@@ -1043,8 +1034,7 @@ class OMPPermutationClause final
10431034 // / Sets the permutation index expressions.
10441035 void setArgRefs (ArrayRef<Expr *> VL) {
10451036 assert (VL.size () == NumLoops && " Expecting one expression per loop" );
1046- llvm::copy (VL, static_cast <OMPPermutationClause *>(this )
1047- ->template getTrailingObjects <Expr *>());
1037+ llvm::copy (VL, getTrailingObjects ());
10481038 }
10491039
10501040 // / Build an empty clause.
@@ -1083,14 +1073,8 @@ class OMPPermutationClause final
10831073
10841074 // / Returns the permutation index expressions.
10851075 // /@{
1086- MutableArrayRef<Expr *> getArgsRefs () {
1087- return static_cast <OMPPermutationClause *>(this )
1088- ->template getTrailingObjects <Expr *>(NumLoops);
1089- }
1090- ArrayRef<Expr *> getArgsRefs () const {
1091- return static_cast <const OMPPermutationClause *>(this )
1092- ->template getTrailingObjects <Expr *>(NumLoops);
1093- }
1076+ MutableArrayRef<Expr *> getArgsRefs () { return getTrailingObjects (NumLoops); }
1077+ ArrayRef<Expr *> getArgsRefs () const { return getTrailingObjects (NumLoops); }
10941078 // /@}
10951079
10961080 child_range children () {
@@ -9239,9 +9223,7 @@ class OMPAffinityClause final
92399223 SourceLocation(), N) {}
92409224
92419225 // / Sets the affinity modifier for the clause, if any.
9242- void setModifier (Expr *E) {
9243- getTrailingObjects<Expr *>()[varlist_size ()] = E;
9244- }
9226+ void setModifier (Expr *E) { getTrailingObjects ()[varlist_size ()] = E; }
92459227
92469228 // / Sets the location of ':' symbol.
92479229 void setColonLoc (SourceLocation Loc) { ColonLoc = Loc; }
@@ -9268,10 +9250,8 @@ class OMPAffinityClause final
92689250 static OMPAffinityClause *CreateEmpty (const ASTContext &C, unsigned N);
92699251
92709252 // / Gets affinity modifier.
9271- Expr *getModifier () { return getTrailingObjects<Expr *>()[varlist_size ()]; }
9272- Expr *getModifier () const {
9273- return getTrailingObjects<Expr *>()[varlist_size ()];
9274- }
9253+ Expr *getModifier () { return getTrailingObjects ()[varlist_size ()]; }
9254+ Expr *getModifier () const { return getTrailingObjects ()[varlist_size ()]; }
92759255
92769256 // / Gets the location of ':' symbol.
92779257 SourceLocation getColonLoc () const { return ColonLoc; }
0 commit comments