;
27 caseOpenACCClauseKind::Default:
28 switch(DirectiveKind) {
29 caseOpenACCDirectiveKind::Parallel:
30 caseOpenACCDirectiveKind::Serial:
31 caseOpenACCDirectiveKind::Kernels:
32 caseOpenACCDirectiveKind::ParallelLoop:
33 caseOpenACCDirectiveKind::SerialLoop:
34 caseOpenACCDirectiveKind::KernelsLoop:
35 caseOpenACCDirectiveKind::Data:
40 caseOpenACCClauseKind::If:
41 switch(DirectiveKind) {
42 caseOpenACCDirectiveKind::Parallel:
43 caseOpenACCDirectiveKind::Serial:
44 caseOpenACCDirectiveKind::Kernels:
45 caseOpenACCDirectiveKind::Data:
46 caseOpenACCDirectiveKind::EnterData:
47 caseOpenACCDirectiveKind::ExitData:
48 caseOpenACCDirectiveKind::HostData:
49 caseOpenACCDirectiveKind::Init:
50 caseOpenACCDirectiveKind::Shutdown:
51 caseOpenACCDirectiveKind::Set:
52 caseOpenACCDirectiveKind::Update:
53 caseOpenACCDirectiveKind::Wait:
54 caseOpenACCDirectiveKind::ParallelLoop:
55 caseOpenACCDirectiveKind::SerialLoop:
56 caseOpenACCDirectiveKind::KernelsLoop:
61 caseOpenACCClauseKind::Self:
62 switch(DirectiveKind) {
63 caseOpenACCDirectiveKind::Parallel:
64 caseOpenACCDirectiveKind::Serial:
65 caseOpenACCDirectiveKind::Kernels:
66 caseOpenACCDirectiveKind::Update:
67 caseOpenACCDirectiveKind::ParallelLoop:
68 caseOpenACCDirectiveKind::SerialLoop:
69 caseOpenACCDirectiveKind::KernelsLoop:
74 caseOpenACCClauseKind::NumGangs:
75 caseOpenACCClauseKind::NumWorkers:
76 caseOpenACCClauseKind::VectorLength:
77 switch(DirectiveKind) {
78 caseOpenACCDirectiveKind::Parallel:
79 caseOpenACCDirectiveKind::Kernels:
80 caseOpenACCDirectiveKind::ParallelLoop:
81 caseOpenACCDirectiveKind::KernelsLoop:
86 caseOpenACCClauseKind::FirstPrivate:
87 switch(DirectiveKind) {
88 caseOpenACCDirectiveKind::Parallel:
89 caseOpenACCDirectiveKind::Serial:
90 caseOpenACCDirectiveKind::ParallelLoop:
91 caseOpenACCDirectiveKind::SerialLoop:
96 caseOpenACCClauseKind::Private:
97 switch(DirectiveKind) {
98 caseOpenACCDirectiveKind::Parallel:
99 caseOpenACCDirectiveKind::Serial:
100 caseOpenACCDirectiveKind::Loop:
101 caseOpenACCDirectiveKind::ParallelLoop:
102 caseOpenACCDirectiveKind::SerialLoop:
103 caseOpenACCDirectiveKind::KernelsLoop:
108 caseOpenACCClauseKind::NoCreate:
109 switch(DirectiveKind) {
110 caseOpenACCDirectiveKind::Parallel:
111 caseOpenACCDirectiveKind::Serial:
112 caseOpenACCDirectiveKind::Kernels:
113 caseOpenACCDirectiveKind::Data:
114 caseOpenACCDirectiveKind::ParallelLoop:
115 caseOpenACCDirectiveKind::SerialLoop:
116 caseOpenACCDirectiveKind::KernelsLoop:
121 caseOpenACCClauseKind::Present:
122 switch(DirectiveKind) {
123 caseOpenACCDirectiveKind::Parallel:
124 caseOpenACCDirectiveKind::Serial:
125 caseOpenACCDirectiveKind::Kernels:
126 caseOpenACCDirectiveKind::Data:
127 caseOpenACCDirectiveKind::Declare:
128 caseOpenACCDirectiveKind::ParallelLoop:
129 caseOpenACCDirectiveKind::SerialLoop:
130 caseOpenACCDirectiveKind::KernelsLoop:
136 caseOpenACCClauseKind::Copy:
137 caseOpenACCClauseKind::PCopy:
138 caseOpenACCClauseKind::PresentOrCopy:
139 switch(DirectiveKind) {
140 caseOpenACCDirectiveKind::Parallel:
141 caseOpenACCDirectiveKind::Serial:
142 caseOpenACCDirectiveKind::Kernels:
143 caseOpenACCDirectiveKind::Data:
144 caseOpenACCDirectiveKind::Declare:
145 caseOpenACCDirectiveKind::ParallelLoop:
146 caseOpenACCDirectiveKind::SerialLoop:
147 caseOpenACCDirectiveKind::KernelsLoop:
152 caseOpenACCClauseKind::CopyIn:
153 caseOpenACCClauseKind::PCopyIn:
154 caseOpenACCClauseKind::PresentOrCopyIn:
155 switch(DirectiveKind) {
156 caseOpenACCDirectiveKind::Parallel:
157 caseOpenACCDirectiveKind::Serial:
158 caseOpenACCDirectiveKind::Kernels:
159 caseOpenACCDirectiveKind::Data:
160 caseOpenACCDirectiveKind::EnterData:
161 caseOpenACCDirectiveKind::Declare:
162 caseOpenACCDirectiveKind::ParallelLoop:
163 caseOpenACCDirectiveKind::SerialLoop:
164 caseOpenACCDirectiveKind::KernelsLoop:
169 caseOpenACCClauseKind::CopyOut:
170 caseOpenACCClauseKind::PCopyOut:
171 caseOpenACCClauseKind::PresentOrCopyOut:
172 switch(DirectiveKind) {
173 caseOpenACCDirectiveKind::Parallel:
174 caseOpenACCDirectiveKind::Serial:
175 caseOpenACCDirectiveKind::Kernels:
176 caseOpenACCDirectiveKind::Data:
177 caseOpenACCDirectiveKind::ExitData:
178 caseOpenACCDirectiveKind::Declare:
179 caseOpenACCDirectiveKind::ParallelLoop:
180 caseOpenACCDirectiveKind::SerialLoop:
181 caseOpenACCDirectiveKind::KernelsLoop:
186 caseOpenACCClauseKind::Create:
187 caseOpenACCClauseKind::PCreate:
188 caseOpenACCClauseKind::PresentOrCreate:
189 switch(DirectiveKind) {
190 caseOpenACCDirectiveKind::Parallel:
191 caseOpenACCDirectiveKind::Serial:
192 caseOpenACCDirectiveKind::Kernels:
193 caseOpenACCDirectiveKind::Data:
194 caseOpenACCDirectiveKind::EnterData:
195 caseOpenACCDirectiveKind::ParallelLoop:
196 caseOpenACCDirectiveKind::SerialLoop:
197 caseOpenACCDirectiveKind::KernelsLoop:
203 caseOpenACCClauseKind::Attach:
204 switch(DirectiveKind) {
205 caseOpenACCDirectiveKind::Parallel:
206 caseOpenACCDirectiveKind::Serial:
207 caseOpenACCDirectiveKind::Kernels:
208 caseOpenACCDirectiveKind::Data:
209 caseOpenACCDirectiveKind::EnterData:
210 caseOpenACCDirectiveKind::ParallelLoop:
211 caseOpenACCDirectiveKind::SerialLoop:
212 caseOpenACCDirectiveKind::KernelsLoop:
217 caseOpenACCClauseKind::DevicePtr:
218 switch(DirectiveKind) {
219 caseOpenACCDirectiveKind::Parallel:
220 caseOpenACCDirectiveKind::Serial:
221 caseOpenACCDirectiveKind::Kernels:
222 caseOpenACCDirectiveKind::Data:
223 caseOpenACCDirectiveKind::Declare:
224 caseOpenACCDirectiveKind::ParallelLoop:
225 caseOpenACCDirectiveKind::SerialLoop:
226 caseOpenACCDirectiveKind::KernelsLoop:
231 caseOpenACCClauseKind::Async:
232 switch(DirectiveKind) {
233 caseOpenACCDirectiveKind::Parallel:
234 caseOpenACCDirectiveKind::Serial:
235 caseOpenACCDirectiveKind::Kernels:
236 caseOpenACCDirectiveKind::Data:
237 caseOpenACCDirectiveKind::EnterData:
238 caseOpenACCDirectiveKind::ExitData:
239 caseOpenACCDirectiveKind::Set:
240 caseOpenACCDirectiveKind::Update:
241 caseOpenACCDirectiveKind::Wait:
242 caseOpenACCDirectiveKind::ParallelLoop:
243 caseOpenACCDirectiveKind::SerialLoop:
244 caseOpenACCDirectiveKind::KernelsLoop:
249 caseOpenACCClauseKind::Wait:
250 switch(DirectiveKind) {
251 caseOpenACCDirectiveKind::Parallel:
252 caseOpenACCDirectiveKind::Serial:
253 caseOpenACCDirectiveKind::Kernels:
254 caseOpenACCDirectiveKind::Data:
255 caseOpenACCDirectiveKind::EnterData:
256 caseOpenACCDirectiveKind::ExitData:
257 caseOpenACCDirectiveKind::Update:
258 caseOpenACCDirectiveKind::ParallelLoop:
259 caseOpenACCDirectiveKind::SerialLoop:
260 caseOpenACCDirectiveKind::KernelsLoop:
266 caseOpenACCClauseKind::Seq:
267 switch(DirectiveKind) {
268 caseOpenACCDirectiveKind::Loop:
269 caseOpenACCDirectiveKind::Routine:
270 caseOpenACCDirectiveKind::ParallelLoop:
271 caseOpenACCDirectiveKind::SerialLoop:
272 caseOpenACCDirectiveKind::KernelsLoop:
278 caseOpenACCClauseKind::Independent:
279 caseOpenACCClauseKind::Auto:
280 switch(DirectiveKind) {
281 caseOpenACCDirectiveKind::Loop:
282 caseOpenACCDirectiveKind::ParallelLoop:
283 caseOpenACCDirectiveKind::SerialLoop:
284 caseOpenACCDirectiveKind::KernelsLoop:
290 caseOpenACCClauseKind::Reduction:
291 switch(DirectiveKind) {
292 caseOpenACCDirectiveKind::Parallel:
293 caseOpenACCDirectiveKind::Serial:
294 caseOpenACCDirectiveKind::Loop:
295 caseOpenACCDirectiveKind::ParallelLoop:
296 caseOpenACCDirectiveKind::SerialLoop:
297 caseOpenACCDirectiveKind::KernelsLoop:
303 caseOpenACCClauseKind::DeviceType:
304 caseOpenACCClauseKind::DType:
305 switch(DirectiveKind) {
306 caseOpenACCDirectiveKind::Parallel:
307 caseOpenACCDirectiveKind::Serial:
308 caseOpenACCDirectiveKind::Kernels:
309 caseOpenACCDirectiveKind::Data:
310 caseOpenACCDirectiveKind::Init:
311 caseOpenACCDirectiveKind::Shutdown:
312 caseOpenACCDirectiveKind::Set:
313 caseOpenACCDirectiveKind::Update:
314 caseOpenACCDirectiveKind::Loop:
315 caseOpenACCDirectiveKind::Routine:
316 caseOpenACCDirectiveKind::ParallelLoop:
317 caseOpenACCDirectiveKind::SerialLoop:
318 caseOpenACCDirectiveKind::KernelsLoop:
324 caseOpenACCClauseKind::Collapse: {
325 switch(DirectiveKind) {
326 caseOpenACCDirectiveKind::Loop:
327 caseOpenACCDirectiveKind::ParallelLoop:
328 caseOpenACCDirectiveKind::SerialLoop:
329 caseOpenACCDirectiveKind::KernelsLoop:
335 caseOpenACCClauseKind::Tile: {
336 switch(DirectiveKind) {
337 caseOpenACCDirectiveKind::Loop:
338 caseOpenACCDirectiveKind::ParallelLoop:
339 caseOpenACCDirectiveKind::SerialLoop:
340 caseOpenACCDirectiveKind::KernelsLoop:
347 caseOpenACCClauseKind::Gang: {
348 switch(DirectiveKind) {
349 caseOpenACCDirectiveKind::Loop:
350 caseOpenACCDirectiveKind::ParallelLoop:
351 caseOpenACCDirectiveKind::SerialLoop:
352 caseOpenACCDirectiveKind::KernelsLoop:
353 caseOpenACCDirectiveKind::Routine:
358 caseOpenACCClauseKind::Worker: {
359 switch(DirectiveKind) {
360 caseOpenACCDirectiveKind::Loop:
361 caseOpenACCDirectiveKind::ParallelLoop:
362 caseOpenACCDirectiveKind::SerialLoop:
363 caseOpenACCDirectiveKind::KernelsLoop:
364 caseOpenACCDirectiveKind::Routine:
370 caseOpenACCClauseKind::Vector: {
371 switch(DirectiveKind) {
372 caseOpenACCDirectiveKind::Loop:
373 caseOpenACCDirectiveKind::ParallelLoop:
374 caseOpenACCDirectiveKind::SerialLoop:
375 caseOpenACCDirectiveKind::KernelsLoop:
376 caseOpenACCDirectiveKind::Routine:
382 caseOpenACCClauseKind::Finalize: {
383 switch(DirectiveKind) {
384 caseOpenACCDirectiveKind::ExitData:
390 caseOpenACCClauseKind::IfPresent: {
391 switch(DirectiveKind) {
392 caseOpenACCDirectiveKind::HostData:
393 caseOpenACCDirectiveKind::Update:
399 caseOpenACCClauseKind::Delete: {
400 switch(DirectiveKind) {
401 caseOpenACCDirectiveKind::ExitData:
408 caseOpenACCClauseKind::Detach: {
409 switch(DirectiveKind) {
410 caseOpenACCDirectiveKind::ExitData:
417 caseOpenACCClauseKind::DeviceNum: {
418 switch(DirectiveKind) {
419 caseOpenACCDirectiveKind::Init:
420 caseOpenACCDirectiveKind::Shutdown:
421 caseOpenACCDirectiveKind::Set:
428 caseOpenACCClauseKind::UseDevice: {
429 switch(DirectiveKind) {
430 caseOpenACCDirectiveKind::HostData:
436 caseOpenACCClauseKind::DefaultAsync: {
437 switch(DirectiveKind) {
438 caseOpenACCDirectiveKind::Set:
444 caseOpenACCClauseKind::Device: {
445 switch(DirectiveKind) {
446 caseOpenACCDirectiveKind::Update:
452 caseOpenACCClauseKind::Host: {
453 switch(DirectiveKind) {
454 caseOpenACCDirectiveKind::Update:
466llvm_unreachable(
"Invalid clause kind");
469boolcheckAlreadyHasClauseOfKind(
472 const auto*Itr = llvm::find_if(ExistingClauses, [&](
const OpenACCClause*
C) {
475 if(Itr != ExistingClauses.end()) {
476S.
Diag(Clause.
getBeginLoc(), diag::err_acc_duplicate_clause_disallowed)
478S.
Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
483boolcheckValidAfterDeviceType(
488 if(NewClause.getDirectiveKind() == OpenACCDirectiveKind::Routine)
498 if(NewClause.
getClauseKind() == OpenACCClauseKind::DType ||
499NewClause.
getClauseKind() == OpenACCClauseKind::DeviceType)
507 caseOpenACCClauseKind::Async:
508 caseOpenACCClauseKind::Wait:
509 caseOpenACCClauseKind::NumGangs:
510 caseOpenACCClauseKind::NumWorkers:
511 caseOpenACCClauseKind::VectorLength:
516}
else if(NewClause.getDirectiveKind() == OpenACCDirectiveKind::Loop) {
521 caseOpenACCClauseKind::Collapse:
522 caseOpenACCClauseKind::Gang:
523 caseOpenACCClauseKind::Worker:
524 caseOpenACCClauseKind::Vector:
525 caseOpenACCClauseKind::Seq:
526 caseOpenACCClauseKind::Independent:
527 caseOpenACCClauseKind::Auto:
528 caseOpenACCClauseKind::Tile:
536 caseOpenACCClauseKind::Async:
537 caseOpenACCClauseKind::Wait:
538 caseOpenACCClauseKind::NumGangs:
539 caseOpenACCClauseKind::NumWorkers:
540 caseOpenACCClauseKind::VectorLength:
541 caseOpenACCClauseKind::Collapse:
542 caseOpenACCClauseKind::Gang:
543 caseOpenACCClauseKind::Worker:
544 caseOpenACCClauseKind::Vector:
545 caseOpenACCClauseKind::Seq:
546 caseOpenACCClauseKind::Independent:
547 caseOpenACCClauseKind::Auto:
548 caseOpenACCClauseKind::Tile:
553}
else if(NewClause.getDirectiveKind() == OpenACCDirectiveKind::Data) {
557 caseOpenACCClauseKind::Async:
558 caseOpenACCClauseKind::Wait:
563}
else if(NewClause.getDirectiveKind() == OpenACCDirectiveKind::Set ||
564NewClause.getDirectiveKind() == OpenACCDirectiveKind::Init ||
565NewClause.getDirectiveKind() == OpenACCDirectiveKind::Shutdown) {
568}
else if(NewClause.getDirectiveKind() == OpenACCDirectiveKind::Update) {
572 caseOpenACCClauseKind::Async:
573 caseOpenACCClauseKind::Wait:
579S.
Diag(NewClause.
getBeginLoc(), diag::err_acc_clause_after_device_type)
581<< NewClause.getDirectiveKind();
582S.
Diag(DeviceTypeClause.
getBeginLoc(), diag::note_acc_previous_clause_here);
591 returnDK != OpenACCDirectiveKind::Declare &&
592DK != OpenACCDirectiveKind::Routine;
595classSemaOpenACCClauseVisitor {
599 boolNotImplemented =
false;
602NotImplemented =
true;
611llvm::find_if(ExistingClauses, llvm::IsaPred<OpenACCSeqClause>);
613 if(Itr != ExistingClauses.end()) {
614SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_clause_cannot_combine)
617SemaRef.
Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
627: SemaRef(S), Ctx(S.getASTContext()), ExistingClauses(ExistingClauses) {}
631 booldiagNotImplemented() {
returnNotImplemented; }
635#define VISIT_CLAUSE(CLAUSE_NAME) \ 636 case OpenACCClauseKind::CLAUSE_NAME: \ 637 return Visit##CLAUSE_NAME##Clause(Clause); 638#define CLAUSE_ALIAS(ALIAS, CLAUSE_NAME, DEPRECATED) \ 639 case OpenACCClauseKind::ALIAS: \ 641 SemaRef.Diag(Clause.getBeginLoc(), diag::warn_acc_deprecated_alias_name) \ 642 << Clause.getClauseKind() << OpenACCClauseKind::CLAUSE_NAME; \ 643 return Visit##CLAUSE_NAME##Clause(Clause); 644#include "clang/Basic/OpenACCClauses.def" 646 returnisNotImplemented();
648llvm_unreachable(
"Invalid clause kind");
651#define VISIT_CLAUSE(CLAUSE_NAME) \ 652 OpenACCClause *Visit##CLAUSE_NAME##Clause( \ 653 SemaOpenACC::OpenACCParsedClause &Clause); 654#include "clang/Basic/OpenACCClauses.def" 667 if(checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
683 if(checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
695NewSizeExprs.push_back(Res.
get());
713checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
723llvm::find_if(ExistingClauses, llvm::IsaPred<OpenACCSelfClause>);
724 if(Itr != ExistingClauses.end()) {
725SemaRef.
Diag(Clause.
getBeginLoc(), diag::warn_acc_if_self_conflict);
726SemaRef.
Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
740 if(checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
751llvm::find_if(ExistingClauses, llvm::IsaPred<OpenACCIfClause>);
752 if(Itr != ExistingClauses.end()) {
753SemaRef.
Diag(Clause.
getBeginLoc(), diag::warn_acc_if_self_conflict);
754SemaRef.
Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
766 if(checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
773SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_num_gangs_num_args)
784SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_num_gangs_num_args)
793 auto*GangClauseItr =
794llvm::find_if(ExistingClauses, llvm::IsaPred<OpenACCGangClause>);
795 auto*ReductionClauseItr =
796llvm::find_if(ExistingClauses, llvm::IsaPred<OpenACCReductionClause>);
798 if(GangClauseItr != ExistingClauses.end() &&
799ReductionClauseItr != ExistingClauses.end()) {
801diag::err_acc_gang_reduction_numgangs_conflict)
802<< OpenACCClauseKind::Reduction << OpenACCClauseKind::Gang
804SemaRef.
Diag((*ReductionClauseItr)->getBeginLoc(),
805diag::note_acc_previous_clause_here);
806SemaRef.
Diag((*GangClauseItr)->getBeginLoc(),
807diag::note_acc_previous_clause_here);
819llvm::find_if(ExistingClauses, llvm::IsaPred<OpenACCReductionClause>);
821 if(
Parallel!= ExistingClauses.end()) {
823diag::err_acc_reduction_num_gangs_conflict)
826SemaRef.
Diag((*Parallel)->getBeginLoc(),
827diag::note_acc_previous_clause_here);
836 autoGangClauses = llvm::make_filter_range(
837ExistingClauses, llvm::IsaPred<OpenACCGangClause>);
839 for(
auto*GC : GangClauses) {
840 if(cast<OpenACCGangClause>(GC)->hasExprOfKind(OpenACCGangKind::Num)) {
842diag::err_acc_num_arg_conflict_reverse)
843<< OpenACCClauseKind::NumGangs << OpenACCClauseKind::Gang
845SemaRef.
Diag(GC->getBeginLoc(), diag::note_acc_previous_clause_here);
856OpenACCClause*SemaOpenACCClauseVisitor::VisitNumWorkersClause(
861 if(checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
868 autoWorkerClauses = llvm::make_filter_range(
869ExistingClauses, llvm::IsaPred<OpenACCWorkerClause>);
871 for(
auto*WC : WorkerClauses) {
872 if(cast<OpenACCWorkerClause>(WC)->hasIntExpr()) {
874diag::err_acc_num_arg_conflict_reverse)
875<< OpenACCClauseKind::NumWorkers << OpenACCClauseKind::Worker
877SemaRef.
Diag(WC->getBeginLoc(), diag::note_acc_previous_clause_here);
884 "Invalid number of expressions for NumWorkers");
890OpenACCClause*SemaOpenACCClauseVisitor::VisitVectorLengthClause(
895 if(checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
902 autoVectorClauses = llvm::make_filter_range(
903ExistingClauses, llvm::IsaPred<OpenACCVectorClause>);
905 for(
auto*VC : VectorClauses) {
906 if(cast<OpenACCVectorClause>(VC)->hasIntExpr()) {
908diag::err_acc_num_arg_conflict_reverse)
909<< OpenACCClauseKind::VectorLength << OpenACCClauseKind::Vector
911SemaRef.
Diag(VC->getBeginLoc(), diag::note_acc_previous_clause_here);
918 "Invalid number of expressions for NumWorkers");
929 if(checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
933 "Invalid number of expressions for Async");
940OpenACCClause*SemaOpenACCClauseVisitor::VisitDeviceNumClause(
945 returnisNotImplemented();
950checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
954 "Invalid number of expressions for device_num");
960OpenACCClause*SemaOpenACCClauseVisitor::VisitDefaultAsyncClause(
964 if(checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
968 "Invalid number of expressions for default_async");
985OpenACCClause*SemaOpenACCClauseVisitor::VisitFirstPrivateClause(
1014 returnisNotImplemented();
1053 returnisNotImplemented();
1070 returnisNotImplemented();
1087 returnisNotImplemented();
1113llvm::erase_if(VarList, [&](
Expr*
E) {
1128llvm::erase_if(VarList, [&](
Expr*
E) {
1148OpenACCClause*SemaOpenACCClauseVisitor::VisitUseDeviceClause(
1157OpenACCClause*SemaOpenACCClauseVisitor::VisitDevicePtrClause(
1164 returnisNotImplemented();
1169llvm::erase_if(VarList, [&](
Expr*
E) {
1187OpenACCClause*SemaOpenACCClauseVisitor::VisitDeviceTypeClause(
1191 returnisNotImplemented();
1196checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
1213llvm::find_if(ExistingClauses,
1214llvm::IsaPred<OpenACCIndependentClause, OpenACCSeqClause>);
1215 if(Itr != ExistingClauses.end()) {
1216SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_loop_spec_conflict)
1218SemaRef.
Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
1226OpenACCClause*SemaOpenACCClauseVisitor::VisitIndependentClause(
1230 const auto*Itr = llvm::find_if(
1231ExistingClauses, llvm::IsaPred<OpenACCAutoClause, OpenACCSeqClause>);
1232 if(Itr != ExistingClauses.end()) {
1233SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_loop_spec_conflict)
1235SemaRef.
Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
1244 if(isa<OpenACCAsteriskSizeExpr>(
E))
1246 returnS.ActOnIntExpr(OpenACCDirectiveKind::Invalid, OpenACCClauseKind::Gang,
1251 returnDK == OpenACCDirectiveKind::Loop &&
1252AssocKind == OpenACCDirectiveKind::Invalid;
1256 returnDK == OpenACCDirectiveKind::Loop &&
1257AssocKind != OpenACCDirectiveKind::Invalid;
1264<< GK << CK << IsOrphanLoop(DK, AssocKind) << DK
1265<< HasAssocKind(DK, AssocKind) << AssocKind;
1272<< TagKind << CK << IsOrphanLoop(DK, AssocKind) << DK
1273<< HasAssocKind(DK, AssocKind) << AssocKind;
1281 caseOpenACCGangKind::Static:
1282 returnCheckGangStaticExpr(S,
E);
1283 caseOpenACCGangKind::Num:
1287 returnDiagIntArgInvalid(S,
E, GK, OpenACCClauseKind::Gang, DK, AssocKind);
1288 caseOpenACCGangKind::Dim: {
1296S.ActOnIntExpr(OpenACCDirectiveKind::Invalid, OpenACCClauseKind::Gang,
1305std::optional<llvm::APSInt> ICE =
1308 if(!ICE || *ICE <= 0 || ICE > 3) {
1310<< ICE.has_value() << ICE.value_or(llvm::APSInt{}).getExtValue();
1318llvm_unreachable(
"Unknown gang kind in gang parallel check");
1330 caseOpenACCGangKind::Dim:
1331 returnDiagIntArgInvalid(S,
E, GK, OpenACCClauseKind::Gang, DK, AssocKind);
1332 caseOpenACCGangKind::Num: {
1344: S.getActiveComputeConstructInfo().Clauses;
1347llvm::find_if(Collection, llvm::IsaPred<OpenACCNumGangsClause>);
1349 if(Itr != Collection.end()) {
1351<<
"num"<< OpenACCClauseKind::Gang << DK
1352<< HasAssocKind(DK, AssocKind) << AssocKind
1353<< OpenACCClauseKind::NumGangs;
1355S.
Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
1360 caseOpenACCGangKind::Static:
1361 returnCheckGangStaticExpr(S,
E);
1363llvm_unreachable(
"Unknown gang kind in gang kernels check");
1372 caseOpenACCGangKind::Dim:
1373 caseOpenACCGangKind::Num:
1374 returnDiagIntArgInvalid(S,
E, GK, OpenACCClauseKind::Gang, DK, AssocKind);
1375 caseOpenACCGangKind::Static:
1376 returnCheckGangStaticExpr(S,
E);
1378llvm_unreachable(
"Unknown gang kind in gang serial check");
1383 if(DiagIfSeqClause(Clause))
1390 returnisNotImplemented();
1397 caseOpenACCDirectiveKind::Invalid:
1398 caseOpenACCDirectiveKind::Parallel:
1401 caseOpenACCDirectiveKind::Serial:
1404DiagIntArgInvalid(SemaRef, IntExpr,
"length", OpenACCClauseKind::Vector,
1409 caseOpenACCDirectiveKind::Kernels: {
1412llvm::IsaPred<OpenACCVectorLengthClause>);
1414SemaRef.
Diag(IntExpr->
getBeginLoc(), diag::err_acc_num_arg_conflict)
1415<<
"length"<< OpenACCClauseKind::Vector
1420<< OpenACCClauseKind::VectorLength;
1421SemaRef.
Diag((*Itr)->getBeginLoc(),
1422diag::note_acc_previous_clause_here);
1429llvm_unreachable(
"Non compute construct in active compute construct");
1433DiagIntArgInvalid(SemaRef, IntExpr,
"length", OpenACCClauseKind::Vector,
1438OpenACCDirectiveKind::KernelsLoop) {
1439 const auto*Itr = llvm::find_if(
1440ExistingClauses, llvm::IsaPred<OpenACCVectorLengthClause>);
1441 if(Itr != ExistingClauses.end()) {
1442SemaRef.
Diag(IntExpr->
getBeginLoc(), diag::err_acc_num_arg_conflict)
1443<<
"length"<< OpenACCClauseKind::Vector
1448<< OpenACCClauseKind::VectorLength;
1449SemaRef.
Diag((*Itr)->getBeginLoc(),
1450diag::note_acc_previous_clause_here);
1465SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_clause_in_clause_region)
1466<< OpenACCClauseKind::Vector << OpenACCClauseKind::Vector
1469diag::note_acc_previous_clause_here);
1481 if(DiagIfSeqClause(Clause))
1488 returnisNotImplemented();
1496 caseOpenACCDirectiveKind::Invalid:
1497 caseOpenACCDirectiveKind::ParallelLoop:
1498 caseOpenACCDirectiveKind::SerialLoop:
1499 caseOpenACCDirectiveKind::Parallel:
1500 caseOpenACCDirectiveKind::Serial:
1501DiagIntArgInvalid(SemaRef, IntExpr, OpenACCGangKind::Num,
1506 caseOpenACCDirectiveKind::KernelsLoop:
1507 caseOpenACCDirectiveKind::Kernels: {
1510llvm::IsaPred<OpenACCNumWorkersClause>);
1512SemaRef.
Diag(IntExpr->
getBeginLoc(), diag::err_acc_num_arg_conflict)
1517<< OpenACCClauseKind::NumWorkers;
1518SemaRef.
Diag((*Itr)->getBeginLoc(),
1519diag::note_acc_previous_clause_here);
1526llvm_unreachable(
"Non compute construct in active compute construct");
1531DiagIntArgInvalid(SemaRef, IntExpr, OpenACCGangKind::Num,
1537 "Unknown combined directive kind?");
1538 const auto*Itr = llvm::find_if(ExistingClauses,
1539llvm::IsaPred<OpenACCNumWorkersClause>);
1540 if(Itr != ExistingClauses.end()) {
1541SemaRef.
Diag(IntExpr->
getBeginLoc(), diag::err_acc_num_arg_conflict)
1546<< OpenACCClauseKind::NumWorkers;
1547SemaRef.
Diag((*Itr)->getBeginLoc(),
1548diag::note_acc_previous_clause_here);
1563SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_clause_in_clause_region)
1564<< OpenACCClauseKind::Worker << OpenACCClauseKind::Worker
1567diag::note_acc_previous_clause_here);
1577SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_clause_in_clause_region)
1578<< OpenACCClauseKind::Worker << OpenACCClauseKind::Vector
1581diag::note_acc_previous_clause_here);
1593 if(DiagIfSeqClause(Clause))
1600 returnisNotImplemented();
1607OpenACCDirectiveKind::Invalid) ||
1610 autoActiveComputeConstructContainer =
1614 auto*NumGangsClauseItr = llvm::find_if(
1615ActiveComputeConstructContainer, llvm::IsaPred<OpenACCNumGangsClause>);
1617 if(NumGangsClauseItr != ActiveComputeConstructContainer.end() &&
1618cast<OpenACCNumGangsClause>(*NumGangsClauseItr)->getIntExprs().size() >
1620 auto*ReductionClauseItr =
1621llvm::find_if(ExistingClauses, llvm::IsaPred<OpenACCReductionClause>);
1623 if(ReductionClauseItr != ExistingClauses.end()) {
1625diag::err_acc_gang_reduction_numgangs_conflict)
1626<< OpenACCClauseKind::Gang << OpenACCClauseKind::Reduction
1629SemaRef.
Diag((*ReductionClauseItr)->getBeginLoc(),
1630diag::note_acc_previous_clause_here);
1631SemaRef.
Diag((*NumGangsClauseItr)->getBeginLoc(),
1632diag::note_acc_previous_clause_here);
1645 for(
unsignedI = 0; I < Clause.
getIntExprs().size(); ++I) {
1656 if(ExistingElemLoc[
static_cast<unsigned>(GK)].isValid()) {
1658<<
static_cast<unsigned>(GK);
1659SemaRef.
Diag(ExistingElemLoc[
static_cast<unsigned>(GK)],
1660diag::note_acc_previous_expr_here);
1664ExistingElemLoc[
static_cast<unsigned>(GK)] = ER.
get()->
getBeginLoc();
1665GangKinds.push_back(GK);
1666IntExprs.push_back(ER.
get());
1677SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_clause_in_clause_region)
1678<< OpenACCClauseKind::Gang << OpenACCClauseKind::Gang
1682diag::note_acc_previous_clause_here);
1692SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_clause_in_clause_region)
1693<< OpenACCClauseKind::Gang << OpenACCClauseKind::Worker
1696diag::note_acc_previous_clause_here);
1706SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_clause_in_clause_region)
1707<< OpenACCClauseKind::Gang << OpenACCClauseKind::Vector
1710diag::note_acc_previous_clause_here);
1717GangKinds, IntExprs, Clause.
getEndLoc());
1720OpenACCClause*SemaOpenACCClauseVisitor::VisitFinalizeClause(
1728OpenACCClause*SemaOpenACCClauseVisitor::VisitIfPresentClause(
1742 returnisNotImplemented();
1747llvm::find_if(ExistingClauses,
1748llvm::IsaPred<OpenACCAutoClause, OpenACCIndependentClause>);
1749 if(Itr != ExistingClauses.end()) {
1750SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_loop_spec_conflict)
1752SemaRef.
Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
1759Itr = llvm::find_if(ExistingClauses,
1763 if(Itr != ExistingClauses.end()) {
1764SemaRef.
Diag(Clause.
getBeginLoc(), diag::err_acc_clause_cannot_combine)
1767SemaRef.
Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
1775OpenACCClause*SemaOpenACCClauseVisitor::VisitReductionClause(
1782OpenACCDirectiveKind::Invalid) ||
1785 autoActiveComputeConstructContainer =
1789 auto*NumGangsClauseItr = llvm::find_if(
1790ActiveComputeConstructContainer, llvm::IsaPred<OpenACCNumGangsClause>);
1792 if(NumGangsClauseItr != ActiveComputeConstructContainer.end() &&
1793cast<OpenACCNumGangsClause>(*NumGangsClauseItr)->getIntExprs().size() >
1795 auto*GangClauseItr =
1796llvm::find_if(ExistingClauses, llvm::IsaPred<OpenACCGangClause>);
1798 if(GangClauseItr != ExistingClauses.end()) {
1800diag::err_acc_gang_reduction_numgangs_conflict)
1801<< OpenACCClauseKind::Reduction << OpenACCClauseKind::Gang
1804SemaRef.
Diag((*GangClauseItr)->getBeginLoc(),
1805diag::note_acc_previous_clause_here);
1806SemaRef.
Diag((*NumGangsClauseItr)->getBeginLoc(),
1807diag::note_acc_previous_clause_here);
1835 autoNumGangsClauses = llvm::make_filter_range(
1836ExistingClauses, llvm::IsaPred<OpenACCNumGangsClause>);
1838 for(
auto*NGC : NumGangsClauses) {
1840cast<OpenACCNumGangsClause>(NGC)->getIntExprs().size();
1844diag::err_acc_reduction_num_gangs_conflict)
1847SemaRef.
Diag(NGC->getBeginLoc(), diag::note_acc_previous_clause_here);
1860ValidVars.push_back(Res.
get());
1869OpenACCClause*SemaOpenACCClauseVisitor::VisitCollapseClause(
1876 if(checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
1891boolareVarsEqual(
Expr*VarExpr1,
Expr*VarExpr2) {
1903 if(isa<ArraySectionExpr>(VarExpr1)) {
1904 auto*Expr2AS = dyn_cast<ArraySectionExpr>(VarExpr2);
1908 auto*Expr1AS = cast<ArraySectionExpr>(VarExpr1);
1910 if(!areVarsEqual(Expr1AS->getBase(), Expr2AS->getBase()))
1918 if(isa<ArraySubscriptExpr>(VarExpr1)) {
1919 auto*Expr2AS = dyn_cast<ArraySubscriptExpr>(VarExpr2);
1923 auto*Expr1AS = cast<ArraySubscriptExpr>(VarExpr1);
1925 if(!areVarsEqual(Expr1AS->getBase(), Expr2AS->getBase()))
1935 if(isa<DeclRefExpr>(VarExpr1)) {
1936 auto*Expr2DRE = dyn_cast<DeclRefExpr>(VarExpr2);
1940 auto*Expr1DRE = cast<DeclRefExpr>(VarExpr1);
1942 returnExpr1DRE->getDecl()->getMostRecentDecl() ==
1943Expr2DRE->getDecl()->getMostRecentDecl();
1946llvm_unreachable(
"Unknown variable type encountered");
1964 if(
const auto*DevTypeClause =
1965llvm::find_if(ExistingClauses,
1967 returnisa<OpenACCDeviceTypeClause>(
C);
1969DevTypeClause != ExistingClauses.end()) {
1970 if(checkValidAfterDeviceType(
1971*
this, *cast<OpenACCDeviceTypeClause>(*DevTypeClause), Clause))
1975SemaOpenACCClauseVisitor Visitor{*
this, ExistingClauses};
1978 "Created wrong clause?");
1980 if(Visitor.diagNotImplemented())
2000 autoTypeIsValid = [](
QualTypeTy) {
2001 returnTy->isDependentType() || Ty->isScalarType();
2004 if(isa<ArraySectionExpr>(VarExpr)) {
2005 Expr*ASExpr = VarExpr;
2009 if(!TypeIsValid(EltTy)) {
2015 if(!RD->isStruct() && !RD->isClass()) {
2016 Diag(VarExpr->
getExprLoc(), diag::err_acc_reduction_composite_type)
2021 if(!RD->isCompleteDefinition()) {
2022 Diag(VarExpr->
getExprLoc(), diag::err_acc_reduction_composite_type)
2026 if(
const auto*CXXRD = dyn_cast<CXXRecordDecl>(RD);
2027CXXRD && !CXXRD->isAggregate()) {
2028 Diag(VarExpr->
getExprLoc(), diag::err_acc_reduction_composite_type)
2034 if(!TypeIsValid(FD->getType())) {
2036diag::err_acc_reduction_composite_member_type);
2037 Diag(FD->getLocation(), diag::note_acc_reduction_composite_member_loc);
2041}
else if(!TypeIsValid(VarExpr->
getType())) {
2052 if(RClause->getReductionOp() == ReductionOp)
2055 for(
Expr*OldVarExpr : RClause->getVarList()) {
2056 if(OldVarExpr->isInstantiationDependent())
2059 if(areVarsEqual(VarExpr, OldVarExpr)) {
2061<< ReductionOp << RClause->getReductionOp();
2062 Diag(OldVarExpr->getExprLoc(), diag::note_acc_previous_clause_here);
2078 "size argument non integer?");
2082isa<OpenACCAsteriskSizeExpr>(SizeExpr))
2085std::optional<llvm::APSInt> ICE =
2090 if(!ICE || *ICE <= 0) {
2092<< ICE.has_value() << ICE.value_or(llvm::APSInt{}).getExtValue();
2106 "Loop argument non integer?");
2112std::optional<llvm::APSInt> ICE =
2118 if(!ICE || *ICE <= 0) {
2120<< ICE.has_value() << ICE.value_or(llvm::APSInt{}).getExtValue();
2138 returnCheckGangParallelExpr(*
this, DK, ActiveComputeConstructInfo.Kind, GK,
2141 returnCheckGangSerialExpr(*
this, DK, ActiveComputeConstructInfo.Kind, GK,
2144 returnCheckGangKernelsExpr(*
this, ExistingClauses, DK,
2145ActiveComputeConstructInfo.Kind, GK,
E);
2147 switch(ActiveComputeConstructInfo.Kind) {
2151 returnCheckGangParallelExpr(*
this, DK, ActiveComputeConstructInfo.Kind,
2155 returnCheckGangSerialExpr(*
this, DK, ActiveComputeConstructInfo.Kind, GK,
2159 returnCheckGangKernelsExpr(*
this, ExistingClauses, DK,
2160ActiveComputeConstructInfo.Kind, GK,
E);
2162llvm_unreachable(
"Non compute construct in active compute construct?");
2167llvm_unreachable(
"Invalid directive kind for a Gang clause");
2169llvm_unreachable(
"Compute construct directive not handled?");
2181 const auto*ReductionItr =
2182llvm::find_if(ExistingClauses, llvm::IsaPred<OpenACCReductionClause>);
2184 if(ReductionItr != ExistingClauses.end()) {
2185 const autoGangZip = llvm::zip_equal(GangKinds, IntExprs);
2186 const autoGangItr = llvm::find_if(GangZip, [](
const auto&Tuple) {
2190 if(GangItr != GangZip.end()) {
2191 const Expr*DimExpr = std::get<1>(*GangItr);
2195 "Improperly formed gang argument");
2196 if(
const auto*DimVal = dyn_cast<ConstantExpr>(DimExpr);
2197DimVal && DimVal->getResultAsAPSInt() > 1) {
2198 Diag(DimVal->getBeginLoc(), diag::err_acc_gang_reduction_conflict)
2200 Diag((*ReductionItr)->getBeginLoc(),
2201diag::note_acc_previous_clause_here);
2208GangKinds, IntExprs, EndLoc);
2221 const autoGangClauses = llvm::make_filter_range(
2222ExistingClauses, llvm::IsaPred<OpenACCGangClause>);
2224 for(
auto*GC : GangClauses) {
2225 const auto*GangClause = cast<OpenACCGangClause>(GC);
2226 for(
unsignedI = 0; I < GangClause->getNumExprs(); ++I) {
2227std::pair<OpenACCGangKind, const Expr *> EPair = GangClause->getExpr(I);
2231 if(
const auto*DimVal = dyn_cast<ConstantExpr>(EPair.second);
2232DimVal && DimVal->getResultAsAPSInt() > 1) {
2233 Diag(BeginLoc, diag::err_acc_gang_reduction_conflict)
2234<<
1 << DirectiveKind;
2235 Diag(GangClause->getBeginLoc(), diag::note_acc_previous_clause_here);
2243 getASTContext(), BeginLoc, LParenLoc, ReductionOp, Vars, EndLoc);
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines some OpenACC-specific enums and functions.
This file declares semantic analysis for OpenACC constructs and clauses.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
static QualType getBaseOriginalType(const Expr *Base)
Return original type of the base expression for array section.
static ConstantExpr * Create(const ASTContext &Context, Expr *E, const APValue &Result)
This represents one expression.
Expr * IgnoreParenCasts() LLVM_READONLY
Skip past any parentheses and casts which might surround this expression until reaching a fixed point...
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
std::optional< llvm::APSInt > getIntegerConstantExpr(const ASTContext &Ctx, SourceLocation *Loc=nullptr) const
isIntegerConstantExpr - Return the value if this expression is a valid integer constant expression.
Represents a member of a struct/union/class.
static OpenACCAsyncClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCAttachClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCAutoClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
This is the base type for all OpenACC Clauses.
OpenACCClauseKind getClauseKind() const
SourceLocation getBeginLoc() const
static OpenACCCollapseClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, bool HasForce, Expr *LoopCount, SourceLocation EndLoc)
static OpenACCCopyClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCCopyInClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, bool IsReadOnly, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCCopyOutClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, bool IsZero, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCCreateClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, bool IsZero, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCDefaultAsyncClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCDefaultClause * Create(const ASTContext &C, OpenACCDefaultClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
static OpenACCDeleteClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCDetachClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCDeviceClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCDeviceNumClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCDevicePtrClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
A 'device_type' or 'dtype' clause, takes a list of either an 'asterisk' or an identifier.
static OpenACCDeviceTypeClause * Create(const ASTContext &C, OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< DeviceTypeArgument > Archs, SourceLocation EndLoc)
static OpenACCFinalizeClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCFirstPrivateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCGangClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< OpenACCGangKind > GangKinds, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
static OpenACCHostClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCIfClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static OpenACCIfPresentClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCIndependentClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCNoCreateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCNumGangsClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
static OpenACCNumWorkersClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCPresentClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCPrivateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCReductionClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, OpenACCReductionOperator Operator, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCSelfClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static OpenACCSeqClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCTileClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > SizeExprs, SourceLocation EndLoc)
static OpenACCUseDeviceClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCVectorClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCVectorLengthClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCWaitClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *DevNumExpr, SourceLocation QueuesLoc, ArrayRef< Expr * > QueueIdExprs, SourceLocation EndLoc)
static OpenACCWorkerClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
A (possibly-)qualified type.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
ASTContext & getASTContext() const
A type to represent all the data for an OpenACC Clause that has been parsed, but not yet created/sema...
ArrayRef< Expr * > getIntExprs()
ArrayRef< Expr * > getQueueIdExprs() const
OpenACCDirectiveKind getDirectiveKind() const
ArrayRef< OpenACCGangKind > getGangKinds() const
OpenACCReductionOperator getReductionOp() const
SourceLocation getEndLoc() const
OpenACCClauseKind getClauseKind() const
const Expr * getConditionExpr() const
SourceLocation getLParenLoc() const
ArrayRef< DeviceTypeArgument > getDeviceTypeArchitectures() const
SourceLocation getBeginLoc() const
SourceLocation getQueuesLoc() const
void setVarListDetails(ArrayRef< Expr * > VarList, bool IsReadOnly, bool IsZero)
Expr * getDevNumExpr() const
ArrayRef< Expr * > getVarList()
unsigned getNumIntExprs() const
Expr * getLoopCount() const
OpenACCDefaultClauseKind getDefaultClauseKind() const
ComputeConstructInfo & getActiveComputeConstructInfo()
SourceLocation LoopWorkerClauseLoc
If there is a current 'active' loop construct with a 'worker' clause on it (on any sort of construct)...
OpenACCClause * ActOnClause(ArrayRef< const OpenACCClause * > ExistingClauses, OpenACCParsedClause &Clause)
Called after parsing an OpenACC Clause so that it can be checked.
bool CheckVarIsPointerType(OpenACCClauseKind ClauseKind, Expr *VarExpr)
Called to check the 'var' type is a variable of pointer type, necessary for 'deviceptr' and 'attach' ...
struct clang::SemaOpenACC::LoopGangOnKernelTy LoopGangClauseOnKernel
ExprResult CheckReductionVar(OpenACCDirectiveKind DirectiveKind, OpenACCReductionOperator ReductionOp, Expr *VarExpr)
Called while semantically analyzing the reduction clause, ensuring the var is the correct kind of ref...
ExprResult CheckCollapseLoopCount(Expr *LoopCount)
Checks the loop depth value for a collapse clause.
OpenACCClause * CheckReductionClause(ArrayRef< const OpenACCClause * > ExistingClauses, OpenACCDirectiveKind DirectiveKind, SourceLocation BeginLoc, SourceLocation LParenLoc, OpenACCReductionOperator ReductionOp, ArrayRef< Expr * > Vars, SourceLocation EndLoc)
SourceLocation LoopVectorClauseLoc
If there is a current 'active' loop construct with a 'vector' clause on it (on any sort of construct)...
ExprResult CheckGangExpr(ArrayRef< const OpenACCClause * > ExistingClauses, OpenACCDirectiveKind DK, OpenACCGangKind GK, Expr *E)
OpenACCClause * CheckGangClause(OpenACCDirectiveKind DirKind, ArrayRef< const OpenACCClause * > ExistingClauses, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< OpenACCGangKind > GangKinds, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
ExprResult CheckTileSizeExpr(Expr *SizeExpr)
Checks a single size expr for a tile clause.
ASTContext & getASTContext() const
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
SourceLocation getBeginLoc() const LLVM_READONLY
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
RecordDecl * getAsRecordDecl() const
Retrieves the RecordDecl this type refers to.
The JSON file list parser is used to communicate input to InstallAPI.
bool isOpenACCComputeDirectiveKind(OpenACCDirectiveKind K)
bool isOpenACCCombinedDirectiveKind(OpenACCDirectiveKind K)
OpenACCClauseKind
Represents the kind of an OpenACC clause.
@ Invalid
Represents an invalid clause, for the purposes of parsing.
@ Result
The result type of a method or function.
OpenACCDirectiveKind DirKind
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4