13
13
14
14
#ifndef LLVM_CLANG_AST_OPENACCCLAUSE_H
15
15
#define LLVM_CLANG_AST_OPENACCCLAUSE_H
16
+
16
17
#include " clang/AST/ASTContext.h"
17
18
#include " clang/AST/StmtIterator.h"
18
19
#include " clang/Basic/OpenACCKinds.h"
20
+ #include " llvm/ADT/STLExtras.h"
19
21
20
22
#include < utility>
21
23
#include < variant>
@@ -291,8 +293,7 @@ class OpenACCDeviceTypeClause final
291
293
" Only a single asterisk version is permitted, and must be the "
292
294
" only one" );
293
295
294
- std::uninitialized_copy (Archs.begin (), Archs.end (),
295
- getTrailingObjects<DeviceTypeArgument>());
296
+ llvm::uninitialized_copy (Archs, getTrailingObjects<DeviceTypeArgument>());
296
297
}
297
298
298
299
public:
@@ -537,10 +538,9 @@ class OpenACCWaitClause final
537
538
QueuesLoc (QueuesLoc) {
538
539
// The first element of the trailing storage is always the devnum expr,
539
540
// 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 );
544
544
setExprs (
545
545
MutableArrayRef (getTrailingObjects<Expr *>(), QueueIdExprs.size () + 1 ));
546
546
}
@@ -579,8 +579,7 @@ class OpenACCNumGangsClause final
579
579
ArrayRef<Expr *> IntExprs, SourceLocation EndLoc)
580
580
: OpenACCClauseWithExprs(OpenACCClauseKind::NumGangs, BeginLoc, LParenLoc,
581
581
EndLoc) {
582
- std::uninitialized_copy (IntExprs.begin (), IntExprs.end (),
583
- getTrailingObjects<Expr *>());
582
+ llvm::uninitialized_copy (IntExprs, getTrailingObjects<Expr *>());
584
583
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), IntExprs.size ()));
585
584
}
586
585
@@ -609,8 +608,7 @@ class OpenACCTileClause final
609
608
ArrayRef<Expr *> SizeExprs, SourceLocation EndLoc)
610
609
: OpenACCClauseWithExprs(OpenACCClauseKind::Tile, BeginLoc, LParenLoc,
611
610
EndLoc) {
612
- std::uninitialized_copy (SizeExprs.begin (), SizeExprs.end (),
613
- getTrailingObjects<Expr *>());
611
+ llvm::uninitialized_copy (SizeExprs, getTrailingObjects<Expr *>());
614
612
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), SizeExprs.size ()));
615
613
}
616
614
@@ -848,8 +846,7 @@ class OpenACCPrivateClause final
848
846
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
849
847
: OpenACCClauseWithVarList(OpenACCClauseKind::Private, BeginLoc,
850
848
LParenLoc, EndLoc) {
851
- std::uninitialized_copy (VarList.begin (), VarList.end (),
852
- getTrailingObjects<Expr *>());
849
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
853
850
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
854
851
}
855
852
@@ -871,8 +868,7 @@ class OpenACCFirstPrivateClause final
871
868
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
872
869
: OpenACCClauseWithVarList(OpenACCClauseKind::FirstPrivate, BeginLoc,
873
870
LParenLoc, EndLoc) {
874
- std::uninitialized_copy (VarList.begin (), VarList.end (),
875
- getTrailingObjects<Expr *>());
871
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
876
872
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
877
873
}
878
874
@@ -894,8 +890,7 @@ class OpenACCDevicePtrClause final
894
890
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
895
891
: OpenACCClauseWithVarList(OpenACCClauseKind::DevicePtr, BeginLoc,
896
892
LParenLoc, EndLoc) {
897
- std::uninitialized_copy (VarList.begin (), VarList.end (),
898
- getTrailingObjects<Expr *>());
893
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
899
894
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
900
895
}
901
896
@@ -917,8 +912,7 @@ class OpenACCAttachClause final
917
912
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
918
913
: OpenACCClauseWithVarList(OpenACCClauseKind::Attach, BeginLoc, LParenLoc,
919
914
EndLoc) {
920
- std::uninitialized_copy (VarList.begin (), VarList.end (),
921
- getTrailingObjects<Expr *>());
915
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
922
916
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
923
917
}
924
918
@@ -940,8 +934,7 @@ class OpenACCDetachClause final
940
934
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
941
935
: OpenACCClauseWithVarList(OpenACCClauseKind::Detach, BeginLoc, LParenLoc,
942
936
EndLoc) {
943
- std::uninitialized_copy (VarList.begin (), VarList.end (),
944
- getTrailingObjects<Expr *>());
937
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
945
938
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
946
939
}
947
940
@@ -963,8 +956,7 @@ class OpenACCDeleteClause final
963
956
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
964
957
: OpenACCClauseWithVarList(OpenACCClauseKind::Delete, BeginLoc, LParenLoc,
965
958
EndLoc) {
966
- std::uninitialized_copy (VarList.begin (), VarList.end (),
967
- getTrailingObjects<Expr *>());
959
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
968
960
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
969
961
}
970
962
@@ -986,8 +978,7 @@ class OpenACCUseDeviceClause final
986
978
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
987
979
: OpenACCClauseWithVarList(OpenACCClauseKind::UseDevice, BeginLoc,
988
980
LParenLoc, EndLoc) {
989
- std::uninitialized_copy (VarList.begin (), VarList.end (),
990
- getTrailingObjects<Expr *>());
981
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
991
982
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
992
983
}
993
984
@@ -1009,8 +1000,7 @@ class OpenACCNoCreateClause final
1009
1000
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
1010
1001
: OpenACCClauseWithVarList(OpenACCClauseKind::NoCreate, BeginLoc,
1011
1002
LParenLoc, EndLoc) {
1012
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1013
- getTrailingObjects<Expr *>());
1003
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1014
1004
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1015
1005
}
1016
1006
@@ -1032,8 +1022,7 @@ class OpenACCPresentClause final
1032
1022
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
1033
1023
: OpenACCClauseWithVarList(OpenACCClauseKind::Present, BeginLoc,
1034
1024
LParenLoc, EndLoc) {
1035
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1036
- getTrailingObjects<Expr *>());
1025
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1037
1026
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1038
1027
}
1039
1028
@@ -1054,8 +1043,7 @@ class OpenACCHostClause final
1054
1043
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
1055
1044
: OpenACCClauseWithVarList(OpenACCClauseKind::Host, BeginLoc, LParenLoc,
1056
1045
EndLoc) {
1057
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1058
- getTrailingObjects<Expr *>());
1046
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1059
1047
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1060
1048
}
1061
1049
@@ -1078,8 +1066,7 @@ class OpenACCDeviceClause final
1078
1066
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
1079
1067
: OpenACCClauseWithVarList(OpenACCClauseKind::Device, BeginLoc, LParenLoc,
1080
1068
EndLoc) {
1081
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1082
- getTrailingObjects<Expr *>());
1069
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1083
1070
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1084
1071
}
1085
1072
@@ -1107,8 +1094,7 @@ class OpenACCCopyClause final
1107
1094
Spelling == OpenACCClauseKind::PCopy ||
1108
1095
Spelling == OpenACCClauseKind::PresentOrCopy) &&
1109
1096
" Invalid clause kind for copy-clause" );
1110
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1111
- getTrailingObjects<Expr *>());
1097
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1112
1098
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1113
1099
}
1114
1100
@@ -1142,8 +1128,7 @@ class OpenACCCopyInClause final
1142
1128
Spelling == OpenACCClauseKind::PCopyIn ||
1143
1129
Spelling == OpenACCClauseKind::PresentOrCopyIn) &&
1144
1130
" Invalid clause kind for copyin-clause" );
1145
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1146
- getTrailingObjects<Expr *>());
1131
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1147
1132
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1148
1133
}
1149
1134
@@ -1176,8 +1161,7 @@ class OpenACCCopyOutClause final
1176
1161
Spelling == OpenACCClauseKind::PCopyOut ||
1177
1162
Spelling == OpenACCClauseKind::PresentOrCopyOut) &&
1178
1163
" Invalid clause kind for copyout-clause" );
1179
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1180
- getTrailingObjects<Expr *>());
1164
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1181
1165
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1182
1166
}
1183
1167
@@ -1210,8 +1194,7 @@ class OpenACCCreateClause final
1210
1194
Spelling == OpenACCClauseKind::PCreate ||
1211
1195
Spelling == OpenACCClauseKind::PresentOrCreate) &&
1212
1196
" Invalid clause kind for create-clause" );
1213
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1214
- getTrailingObjects<Expr *>());
1197
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1215
1198
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1216
1199
}
1217
1200
@@ -1241,8 +1224,7 @@ class OpenACCReductionClause final
1241
1224
: OpenACCClauseWithVarList(OpenACCClauseKind::Reduction, BeginLoc,
1242
1225
LParenLoc, EndLoc),
1243
1226
Op (Operator) {
1244
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1245
- getTrailingObjects<Expr *>());
1227
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1246
1228
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1247
1229
}
1248
1230
@@ -1268,8 +1250,7 @@ class OpenACCLinkClause final
1268
1250
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
1269
1251
: OpenACCClauseWithVarList(OpenACCClauseKind::Link, BeginLoc, LParenLoc,
1270
1252
EndLoc) {
1271
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1272
- getTrailingObjects<Expr *>());
1253
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1273
1254
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1274
1255
}
1275
1256
@@ -1293,8 +1274,7 @@ class OpenACCDeviceResidentClause final
1293
1274
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
1294
1275
: OpenACCClauseWithVarList(OpenACCClauseKind::DeviceResident, BeginLoc,
1295
1276
LParenLoc, EndLoc) {
1296
- std::uninitialized_copy (VarList.begin (), VarList.end (),
1297
- getTrailingObjects<Expr *>());
1277
+ llvm::uninitialized_copy (VarList, getTrailingObjects<Expr *>());
1298
1278
setExprs (MutableArrayRef (getTrailingObjects<Expr *>(), VarList.size ()));
1299
1279
}
1300
1280
0 commit comments