1313
1414#ifndef LLVM_CLANG_AST_OPENACCCLAUSE_H
1515#define LLVM_CLANG_AST_OPENACCCLAUSE_H
16+
1617#include " clang/AST/ASTContext.h"
1718#include " clang/AST/StmtIterator.h"
1819#include " clang/Basic/OpenACCKinds.h"
20+ #include " llvm/ADT/STLExtras.h"
1921
2022#include < utility>
2123#include < variant>
@@ -291,8 +293,7 @@ class OpenACCDeviceTypeClause final
291293 " Only a single asterisk version is permitted, and must be the "
292294 " only one" );
293295
294- std::uninitialized_copy (Archs.begin (), Archs.end (),
295- getTrailingObjects<DeviceTypeArgument>());
296+ llvm::uninitialized_copy (Archs, getTrailingObjects<DeviceTypeArgument>());
296297 }
297298
298299public:
@@ -537,10 +538,9 @@ class OpenACCWaitClause final
537538 QueuesLoc (QueuesLoc) {
538539 // The first element of the trailing storage is always the devnum expr,
539540 // whether it is used or not.
540- std::uninitialized_copy (&DevNumExpr, &DevNumExpr + 1 ,
541- getTrailingObjects<Expr *>());
542- std::uninitialized_copy (QueueIdExprs.begin (), QueueIdExprs.end (),
543- getTrailingObjects<Expr *>() + 1 );
541+ auto *Exprs = getTrailingObjects<Expr *>();
542+ llvm::uninitialized_copy (ArrayRef (DevNumExpr), Exprs);
543+ llvm::uninitialized_copy (QueueIdExprs, Exprs + 1 );
544544 setExprs (
545545 MutableArrayRef (getTrailingObjects<Expr *>(), QueueIdExprs.size () + 1 ));
546546 }
@@ -579,8 +579,7 @@ class OpenACCNumGangsClause final
579579 ArrayRef<Expr *> IntExprs, SourceLocation EndLoc)
580580 : OpenACCClauseWithExprs(OpenACCClauseKind::NumGangs, BeginLoc, LParenLoc,
581581 EndLoc) {
582- std::uninitialized_copy (IntExprs.begin (), IntExprs.end (),
583- getTrailingObjects<Expr *>());
582+ llvm::uninitialized_copy (IntExprs, getTrailingObjects<Expr *>());
584583 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), IntExprs.size ()));
585584 }
586585
@@ -609,8 +608,7 @@ class OpenACCTileClause final
609608 ArrayRef<Expr *> SizeExprs, SourceLocation EndLoc)
610609 : OpenACCClauseWithExprs(OpenACCClauseKind::Tile, BeginLoc, LParenLoc,
611610 EndLoc) {
612- std::uninitialized_copy (SizeExprs.begin (), SizeExprs.end (),
613- getTrailingObjects<Expr *>());
611+ llvm::uninitialized_copy (SizeExprs, getTrailingObjects<Expr *>());
614612 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), SizeExprs.size ()));
615613 }
616614
@@ -848,8 +846,7 @@ class OpenACCPrivateClause final
848846 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
849847 : OpenACCClauseWithVarList(OpenACCClauseKind::Private, BeginLoc,
850848 LParenLoc, EndLoc) {
851- std::uninitialized_copy (VarList.begin (), VarList.end (),
852- getTrailingObjects<Expr *>());
849+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
853850 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
854851 }
855852
@@ -871,8 +868,7 @@ class OpenACCFirstPrivateClause final
871868 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
872869 : OpenACCClauseWithVarList(OpenACCClauseKind::FirstPrivate, BeginLoc,
873870 LParenLoc, EndLoc) {
874- std::uninitialized_copy (VarList.begin (), VarList.end (),
875- getTrailingObjects<Expr *>());
871+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
876872 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
877873 }
878874
@@ -894,8 +890,7 @@ class OpenACCDevicePtrClause final
894890 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
895891 : OpenACCClauseWithVarList(OpenACCClauseKind::DevicePtr, BeginLoc,
896892 LParenLoc, EndLoc) {
897- std::uninitialized_copy (VarList.begin (), VarList.end (),
898- getTrailingObjects<Expr *>());
893+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
899894 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
900895 }
901896
@@ -917,8 +912,7 @@ class OpenACCAttachClause final
917912 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
918913 : OpenACCClauseWithVarList(OpenACCClauseKind::Attach, BeginLoc, LParenLoc,
919914 EndLoc) {
920- std::uninitialized_copy (VarList.begin (), VarList.end (),
921- getTrailingObjects<Expr *>());
915+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
922916 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
923917 }
924918
@@ -940,8 +934,7 @@ class OpenACCDetachClause final
940934 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
941935 : OpenACCClauseWithVarList(OpenACCClauseKind::Detach, BeginLoc, LParenLoc,
942936 EndLoc) {
943- std::uninitialized_copy (VarList.begin (), VarList.end (),
944- getTrailingObjects<Expr *>());
937+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
945938 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
946939 }
947940
@@ -963,8 +956,7 @@ class OpenACCDeleteClause final
963956 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
964957 : OpenACCClauseWithVarList(OpenACCClauseKind::Delete, BeginLoc, LParenLoc,
965958 EndLoc) {
966- std::uninitialized_copy (VarList.begin (), VarList.end (),
967- getTrailingObjects<Expr *>());
959+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
968960 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
969961 }
970962
@@ -986,8 +978,7 @@ class OpenACCUseDeviceClause final
986978 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
987979 : OpenACCClauseWithVarList(OpenACCClauseKind::UseDevice, BeginLoc,
988980 LParenLoc, EndLoc) {
989- std::uninitialized_copy (VarList.begin (), VarList.end (),
990- getTrailingObjects<Expr *>());
981+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
991982 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
992983 }
993984
@@ -1009,8 +1000,7 @@ class OpenACCNoCreateClause final
10091000 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
10101001 : OpenACCClauseWithVarList(OpenACCClauseKind::NoCreate, BeginLoc,
10111002 LParenLoc, EndLoc) {
1012- std::uninitialized_copy (VarList.begin (), VarList.end (),
1013- getTrailingObjects<Expr *>());
1003+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
10141004 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
10151005 }
10161006
@@ -1032,8 +1022,7 @@ class OpenACCPresentClause final
10321022 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
10331023 : OpenACCClauseWithVarList(OpenACCClauseKind::Present, BeginLoc,
10341024 LParenLoc, EndLoc) {
1035- std::uninitialized_copy (VarList.begin (), VarList.end (),
1036- getTrailingObjects<Expr *>());
1025+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
10371026 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
10381027 }
10391028
@@ -1054,8 +1043,7 @@ class OpenACCHostClause final
10541043 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
10551044 : OpenACCClauseWithVarList(OpenACCClauseKind::Host, BeginLoc, LParenLoc,
10561045 EndLoc) {
1057- std::uninitialized_copy (VarList.begin (), VarList.end (),
1058- getTrailingObjects<Expr *>());
1046+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
10591047 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
10601048 }
10611049
@@ -1078,8 +1066,7 @@ class OpenACCDeviceClause final
10781066 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
10791067 : OpenACCClauseWithVarList(OpenACCClauseKind::Device, BeginLoc, LParenLoc,
10801068 EndLoc) {
1081- std::uninitialized_copy (VarList.begin (), VarList.end (),
1082- getTrailingObjects<Expr *>());
1069+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
10831070 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
10841071 }
10851072
@@ -1107,8 +1094,7 @@ class OpenACCCopyClause final
11071094 Spelling == OpenACCClauseKind::PCopy ||
11081095 Spelling == OpenACCClauseKind::PresentOrCopy) &&
11091096 " Invalid clause kind for copy-clause" );
1110- std::uninitialized_copy (VarList.begin (), VarList.end (),
1111- getTrailingObjects<Expr *>());
1097+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
11121098 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
11131099 }
11141100
@@ -1142,8 +1128,7 @@ class OpenACCCopyInClause final
11421128 Spelling == OpenACCClauseKind::PCopyIn ||
11431129 Spelling == OpenACCClauseKind::PresentOrCopyIn) &&
11441130 " Invalid clause kind for copyin-clause" );
1145- std::uninitialized_copy (VarList.begin (), VarList.end (),
1146- getTrailingObjects<Expr *>());
1131+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
11471132 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
11481133 }
11491134
@@ -1176,8 +1161,7 @@ class OpenACCCopyOutClause final
11761161 Spelling == OpenACCClauseKind::PCopyOut ||
11771162 Spelling == OpenACCClauseKind::PresentOrCopyOut) &&
11781163 " Invalid clause kind for copyout-clause" );
1179- std::uninitialized_copy (VarList.begin (), VarList.end (),
1180- getTrailingObjects<Expr *>());
1164+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
11811165 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
11821166 }
11831167
@@ -1210,8 +1194,7 @@ class OpenACCCreateClause final
12101194 Spelling == OpenACCClauseKind::PCreate ||
12111195 Spelling == OpenACCClauseKind::PresentOrCreate) &&
12121196 " Invalid clause kind for create-clause" );
1213- std::uninitialized_copy (VarList.begin (), VarList.end (),
1214- getTrailingObjects<Expr *>());
1197+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
12151198 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
12161199 }
12171200
@@ -1241,8 +1224,7 @@ class OpenACCReductionClause final
12411224 : OpenACCClauseWithVarList(OpenACCClauseKind::Reduction, BeginLoc,
12421225 LParenLoc, EndLoc),
12431226 Op (Operator) {
1244- std::uninitialized_copy (VarList.begin (), VarList.end (),
1245- getTrailingObjects<Expr *>());
1227+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
12461228 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
12471229 }
12481230
@@ -1268,8 +1250,7 @@ class OpenACCLinkClause final
12681250 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
12691251 : OpenACCClauseWithVarList(OpenACCClauseKind::Link, BeginLoc, LParenLoc,
12701252 EndLoc) {
1271- std::uninitialized_copy (VarList.begin (), VarList.end (),
1272- getTrailingObjects<Expr *>());
1253+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
12731254 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
12741255 }
12751256
@@ -1293,8 +1274,7 @@ class OpenACCDeviceResidentClause final
12931274 ArrayRef<Expr *> VarList, SourceLocation EndLoc)
12941275 : OpenACCClauseWithVarList(OpenACCClauseKind::DeviceResident, BeginLoc,
12951276 LParenLoc, EndLoc) {
1296- std::uninitialized_copy (VarList.begin (), VarList.end (),
1297- getTrailingObjects<Expr *>());
1277+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
12981278 setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
12991279 }
13001280
0 commit comments