clang 22.0.0git
OpenACCClause.cpp
Go to the documentation of this file.
1//===---- OpenACCClause.cpp - Classes for OpenACC Clauses ----------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the subclasses of the OpenACCClause class declared in
10// OpenACCClause.h
11//
12//===----------------------------------------------------------------------===//
13
16#include "clang/AST/Expr.h"
17
18using namespace clang;
19
61 SourceLocation BeginLoc,
62 SourceLocation LParenLoc,
63 SourceLocation EndLoc) {
64 void *Mem =
65 C.Allocate(sizeof(OpenACCDefaultClause), alignof(OpenACCDefaultClause));
66
67 return new (Mem) OpenACCDefaultClause(K, BeginLoc, LParenLoc, EndLoc);
68}
69
71 SourceLocation BeginLoc,
72 SourceLocation LParenLoc,
73 Expr *ConditionExpr,
74 SourceLocation EndLoc) {
75 void *Mem = C.Allocate(sizeof(OpenACCIfClause), alignof(OpenACCIfClause));
76 return new (Mem) OpenACCIfClause(BeginLoc, LParenLoc, ConditionExpr, EndLoc);
77}
78
80 SourceLocation LParenLoc, Expr *ConditionExpr,
81 SourceLocation EndLoc)
82 : OpenACCClauseWithCondition(OpenACCClauseKind::If, BeginLoc, LParenLoc,
83 ConditionExpr, EndLoc) {
84 assert(ConditionExpr && "if clause requires condition expr");
85 assert((ConditionExpr->isInstantiationDependent() ||
86 ConditionExpr->getType()->isScalarType()) &&
87 "Condition expression type not scalar/dependent");
88}
89
90OpenACCSelfClause *OpenACCSelfClause::Create(const ASTContext &C,
91 SourceLocation BeginLoc,
92 SourceLocation LParenLoc,
93 Expr *ConditionExpr,
94 SourceLocation EndLoc) {
95 void *Mem = C.Allocate(OpenACCSelfClause::totalSizeToAlloc<Expr *>(1));
96 return new (Mem)
97 OpenACCSelfClause(BeginLoc, LParenLoc, ConditionExpr, EndLoc);
98}
99
100OpenACCSelfClause *OpenACCSelfClause::Create(const ASTContext &C,
101 SourceLocation BeginLoc,
102 SourceLocation LParenLoc,
103 ArrayRef<Expr *> VarList,
104 SourceLocation EndLoc) {
105 void *Mem =
106 C.Allocate(OpenACCSelfClause::totalSizeToAlloc<Expr *>(VarList.size()));
107 return new (Mem) OpenACCSelfClause(BeginLoc, LParenLoc, VarList, EndLoc);
108}
109
110OpenACCSelfClause::OpenACCSelfClause(SourceLocation BeginLoc,
111 SourceLocation LParenLoc,
112 ArrayRef<Expr *> VarList,
113 SourceLocation EndLoc)
114 : OpenACCClauseWithParams(OpenACCClauseKind::Self, BeginLoc, LParenLoc,
115 EndLoc),
116 HasConditionExpr(std::nullopt), NumExprs(VarList.size()) {
117 llvm::uninitialized_copy(VarList, getTrailingObjects());
118}
119
120OpenACCSelfClause::OpenACCSelfClause(SourceLocation BeginLoc,
121 SourceLocation LParenLoc,
122 Expr *ConditionExpr, SourceLocation EndLoc)
123 : OpenACCClauseWithParams(OpenACCClauseKind::Self, BeginLoc, LParenLoc,
124 EndLoc),
125 HasConditionExpr(ConditionExpr != nullptr), NumExprs(1) {
126 assert((!ConditionExpr || ConditionExpr->isInstantiationDependent() ||
127 ConditionExpr->getType()->isScalarType()) &&
128 "Condition expression type not scalar/dependent");
129 llvm::uninitialized_copy(ArrayRef(ConditionExpr), getTrailingObjects());
130}
131
133 switch (getClauseKind()) {
134 default:
135 assert(false && "Clause children function not implemented");
136 break;
137#define VISIT_CLAUSE(CLAUSE_NAME) \
138 case OpenACCClauseKind::CLAUSE_NAME: \
139 return cast<OpenACC##CLAUSE_NAME##Clause>(this)->children();
140#define CLAUSE_ALIAS(ALIAS_NAME, CLAUSE_NAME, DEPRECATED) \
141 case OpenACCClauseKind::ALIAS_NAME: \
142 return cast<OpenACC##CLAUSE_NAME##Clause>(this)->children();
143
144#include "clang/Basic/OpenACCClauses.def"
145 }
147}
148
149OpenACCNumWorkersClause::OpenACCNumWorkersClause(SourceLocation BeginLoc,
150 SourceLocation LParenLoc,
151 Expr *IntExpr,
152 SourceLocation EndLoc)
154 LParenLoc, IntExpr, EndLoc) {
155 assert((!IntExpr || IntExpr->isInstantiationDependent() ||
156 IntExpr->getType()->isIntegerType()) &&
157 "Condition expression type not scalar/dependent");
158}
159
161 SourceLocation LParenLoc,
163 ArrayRef<Expr *> IntExprs,
164 SourceLocation EndLoc)
165 : OpenACCClauseWithExprs(OpenACCClauseKind::Gang, BeginLoc, LParenLoc,
166 EndLoc) {
167 assert(GangKinds.size() == IntExprs.size() && "Mismatch exprs/kind?");
168 setExprs(getTrailingObjects<Expr *>(IntExprs.size()), IntExprs);
169 llvm::uninitialized_copy(GangKinds, getTrailingObjects<OpenACCGangKind>());
170}
171
174 SourceLocation LParenLoc, Expr *IntExpr,
175 SourceLocation EndLoc) {
176 void *Mem = C.Allocate(sizeof(OpenACCNumWorkersClause),
177 alignof(OpenACCNumWorkersClause));
178 return new (Mem)
179 OpenACCNumWorkersClause(BeginLoc, LParenLoc, IntExpr, EndLoc);
180}
181
182OpenACCCollapseClause::OpenACCCollapseClause(SourceLocation BeginLoc,
183 SourceLocation LParenLoc,
184 bool HasForce, Expr *LoopCount,
185 SourceLocation EndLoc)
187 LParenLoc, LoopCount, EndLoc),
188 HasForce(HasForce) {}
189
192 SourceLocation LParenLoc, bool HasForce,
193 Expr *LoopCount, SourceLocation EndLoc) {
194 assert((!LoopCount || (LoopCount->isInstantiationDependent() ||
195 isa<ConstantExpr>(LoopCount))) &&
196 "Loop count not constant expression");
197 void *Mem =
198 C.Allocate(sizeof(OpenACCCollapseClause), alignof(OpenACCCollapseClause));
199 return new (Mem)
200 OpenACCCollapseClause(BeginLoc, LParenLoc, HasForce, LoopCount, EndLoc);
201}
202
203OpenACCVectorLengthClause::OpenACCVectorLengthClause(SourceLocation BeginLoc,
204 SourceLocation LParenLoc,
205 Expr *IntExpr,
206 SourceLocation EndLoc)
208 LParenLoc, IntExpr, EndLoc) {
209 assert((!IntExpr || IntExpr->isInstantiationDependent() ||
210 IntExpr->getType()->isIntegerType()) &&
211 "Condition expression type not scalar/dependent");
212}
213
216 SourceLocation LParenLoc, Expr *IntExpr,
217 SourceLocation EndLoc) {
218 void *Mem = C.Allocate(sizeof(OpenACCVectorLengthClause),
219 alignof(OpenACCVectorLengthClause));
220 return new (Mem)
221 OpenACCVectorLengthClause(BeginLoc, LParenLoc, IntExpr, EndLoc);
222}
223
224OpenACCAsyncClause::OpenACCAsyncClause(SourceLocation BeginLoc,
225 SourceLocation LParenLoc, Expr *IntExpr,
226 SourceLocation EndLoc)
228 LParenLoc, IntExpr, EndLoc) {
229 assert((!IntExpr || IntExpr->isInstantiationDependent() ||
230 IntExpr->getType()->isIntegerType()) &&
231 "Condition expression type not scalar/dependent");
232}
233
234OpenACCAsyncClause *OpenACCAsyncClause::Create(const ASTContext &C,
235 SourceLocation BeginLoc,
236 SourceLocation LParenLoc,
237 Expr *IntExpr,
238 SourceLocation EndLoc) {
239 void *Mem =
240 C.Allocate(sizeof(OpenACCAsyncClause), alignof(OpenACCAsyncClause));
241 return new (Mem) OpenACCAsyncClause(BeginLoc, LParenLoc, IntExpr, EndLoc);
242}
243
244OpenACCDeviceNumClause::OpenACCDeviceNumClause(SourceLocation BeginLoc,
245 SourceLocation LParenLoc, Expr *IntExpr,
246 SourceLocation EndLoc)
248 LParenLoc, IntExpr, EndLoc) {
249 assert((IntExpr->isInstantiationDependent() ||
250 IntExpr->getType()->isIntegerType()) &&
251 "device_num expression type not scalar/dependent");
252}
253
254OpenACCDeviceNumClause *OpenACCDeviceNumClause::Create(const ASTContext &C,
255 SourceLocation BeginLoc,
256 SourceLocation LParenLoc,
257 Expr *IntExpr,
258 SourceLocation EndLoc) {
259 void *Mem =
260 C.Allocate(sizeof(OpenACCDeviceNumClause), alignof(OpenACCDeviceNumClause));
261 return new (Mem) OpenACCDeviceNumClause(BeginLoc, LParenLoc, IntExpr, EndLoc);
262}
263
264OpenACCDefaultAsyncClause::OpenACCDefaultAsyncClause(SourceLocation BeginLoc,
265 SourceLocation LParenLoc,
266 Expr *IntExpr,
267 SourceLocation EndLoc)
269 LParenLoc, IntExpr, EndLoc) {
270 assert((IntExpr->isInstantiationDependent() ||
271 IntExpr->getType()->isIntegerType()) &&
272 "default_async expression type not scalar/dependent");
273}
274
277 SourceLocation LParenLoc, Expr *IntExpr,
278 SourceLocation EndLoc) {
279 void *Mem = C.Allocate(sizeof(OpenACCDefaultAsyncClause),
280 alignof(OpenACCDefaultAsyncClause));
281 return new (Mem)
282 OpenACCDefaultAsyncClause(BeginLoc, LParenLoc, IntExpr, EndLoc);
283}
284
285OpenACCWaitClause *OpenACCWaitClause::Create(
286 const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
287 Expr *DevNumExpr, SourceLocation QueuesLoc, ArrayRef<Expr *> QueueIdExprs,
288 SourceLocation EndLoc) {
289 // Allocates enough room in trailing storage for all the int-exprs, plus a
290 // placeholder for the devnum.
291 void *Mem = C.Allocate(
292 OpenACCWaitClause::totalSizeToAlloc<Expr *>(QueueIdExprs.size() + 1));
293 return new (Mem) OpenACCWaitClause(BeginLoc, LParenLoc, DevNumExpr, QueuesLoc,
294 QueueIdExprs, EndLoc);
295}
296
297OpenACCNumGangsClause *OpenACCNumGangsClause::Create(const ASTContext &C,
298 SourceLocation BeginLoc,
299 SourceLocation LParenLoc,
300 ArrayRef<Expr *> IntExprs,
301 SourceLocation EndLoc) {
302 void *Mem = C.Allocate(
303 OpenACCNumGangsClause::totalSizeToAlloc<Expr *>(IntExprs.size()));
304 return new (Mem) OpenACCNumGangsClause(BeginLoc, LParenLoc, IntExprs, EndLoc);
305}
306
307OpenACCTileClause *OpenACCTileClause::Create(const ASTContext &C,
308 SourceLocation BeginLoc,
309 SourceLocation LParenLoc,
310 ArrayRef<Expr *> SizeExprs,
311 SourceLocation EndLoc) {
312 void *Mem =
313 C.Allocate(OpenACCTileClause::totalSizeToAlloc<Expr *>(SizeExprs.size()));
314 return new (Mem) OpenACCTileClause(BeginLoc, LParenLoc, SizeExprs, EndLoc);
315}
316
319 SourceLocation LParenLoc, ArrayRef<Expr *> VarList,
321 SourceLocation EndLoc) {
322 assert(VarList.size() == InitRecipes.size());
323 void *Mem = C.Allocate(
324 OpenACCPrivateClause::totalSizeToAlloc<Expr *, OpenACCPrivateRecipe>(
325 VarList.size(), InitRecipes.size()));
326 return new (Mem)
327 OpenACCPrivateClause(BeginLoc, LParenLoc, VarList, InitRecipes, EndLoc);
328}
329
330OpenACCFirstPrivateClause *OpenACCFirstPrivateClause::Create(
331 const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
333 SourceLocation EndLoc) {
334 void *Mem = C.Allocate(
335 OpenACCFirstPrivateClause::totalSizeToAlloc<Expr *,
337 VarList.size(), InitRecipes.size()));
338 return new (Mem) OpenACCFirstPrivateClause(BeginLoc, LParenLoc, VarList,
339 InitRecipes, EndLoc);
340}
341
342OpenACCAttachClause *OpenACCAttachClause::Create(const ASTContext &C,
343 SourceLocation BeginLoc,
344 SourceLocation LParenLoc,
345 ArrayRef<Expr *> VarList,
346 SourceLocation EndLoc) {
347 void *Mem =
348 C.Allocate(OpenACCAttachClause::totalSizeToAlloc<Expr *>(VarList.size()));
349 return new (Mem) OpenACCAttachClause(BeginLoc, LParenLoc, VarList, EndLoc);
350}
351
352OpenACCDetachClause *OpenACCDetachClause::Create(const ASTContext &C,
353 SourceLocation BeginLoc,
354 SourceLocation LParenLoc,
355 ArrayRef<Expr *> VarList,
356 SourceLocation EndLoc) {
357 void *Mem =
358 C.Allocate(OpenACCDetachClause::totalSizeToAlloc<Expr *>(VarList.size()));
359 return new (Mem) OpenACCDetachClause(BeginLoc, LParenLoc, VarList, EndLoc);
360}
361
362OpenACCDeleteClause *OpenACCDeleteClause::Create(const ASTContext &C,
363 SourceLocation BeginLoc,
364 SourceLocation LParenLoc,
365 ArrayRef<Expr *> VarList,
366 SourceLocation EndLoc) {
367 void *Mem =
368 C.Allocate(OpenACCDeleteClause::totalSizeToAlloc<Expr *>(VarList.size()));
369 return new (Mem) OpenACCDeleteClause(BeginLoc, LParenLoc, VarList, EndLoc);
370}
371
372OpenACCUseDeviceClause *OpenACCUseDeviceClause::Create(const ASTContext &C,
373 SourceLocation BeginLoc,
374 SourceLocation LParenLoc,
375 ArrayRef<Expr *> VarList,
376 SourceLocation EndLoc) {
377 void *Mem = C.Allocate(
378 OpenACCUseDeviceClause::totalSizeToAlloc<Expr *>(VarList.size()));
379 return new (Mem) OpenACCUseDeviceClause(BeginLoc, LParenLoc, VarList, EndLoc);
380}
381
382OpenACCDevicePtrClause *OpenACCDevicePtrClause::Create(const ASTContext &C,
383 SourceLocation BeginLoc,
384 SourceLocation LParenLoc,
385 ArrayRef<Expr *> VarList,
386 SourceLocation EndLoc) {
387 void *Mem = C.Allocate(
388 OpenACCDevicePtrClause::totalSizeToAlloc<Expr *>(VarList.size()));
389 return new (Mem) OpenACCDevicePtrClause(BeginLoc, LParenLoc, VarList, EndLoc);
390}
391
392OpenACCNoCreateClause *OpenACCNoCreateClause::Create(const ASTContext &C,
393 SourceLocation BeginLoc,
394 SourceLocation LParenLoc,
395 ArrayRef<Expr *> VarList,
396 SourceLocation EndLoc) {
397 void *Mem = C.Allocate(
398 OpenACCNoCreateClause::totalSizeToAlloc<Expr *>(VarList.size()));
399 return new (Mem) OpenACCNoCreateClause(BeginLoc, LParenLoc, VarList, EndLoc);
400}
401
402OpenACCPresentClause *OpenACCPresentClause::Create(const ASTContext &C,
403 SourceLocation BeginLoc,
404 SourceLocation LParenLoc,
405 ArrayRef<Expr *> VarList,
406 SourceLocation EndLoc) {
407 void *Mem = C.Allocate(
408 OpenACCPresentClause::totalSizeToAlloc<Expr *>(VarList.size()));
409 return new (Mem) OpenACCPresentClause(BeginLoc, LParenLoc, VarList, EndLoc);
410}
411
412OpenACCHostClause *OpenACCHostClause::Create(const ASTContext &C,
413 SourceLocation BeginLoc,
414 SourceLocation LParenLoc,
415 ArrayRef<Expr *> VarList,
416 SourceLocation EndLoc) {
417 void *Mem =
418 C.Allocate(OpenACCHostClause::totalSizeToAlloc<Expr *>(VarList.size()));
419 return new (Mem) OpenACCHostClause(BeginLoc, LParenLoc, VarList, EndLoc);
420}
421
422OpenACCDeviceClause *OpenACCDeviceClause::Create(const ASTContext &C,
423 SourceLocation BeginLoc,
424 SourceLocation LParenLoc,
425 ArrayRef<Expr *> VarList,
426 SourceLocation EndLoc) {
427 void *Mem =
428 C.Allocate(OpenACCDeviceClause::totalSizeToAlloc<Expr *>(VarList.size()));
429 return new (Mem) OpenACCDeviceClause(BeginLoc, LParenLoc, VarList, EndLoc);
430}
431
434 SourceLocation BeginLoc, SourceLocation LParenLoc,
436 SourceLocation EndLoc) {
437 void *Mem =
438 C.Allocate(OpenACCCopyClause::totalSizeToAlloc<Expr *>(VarList.size()));
439 return new (Mem)
440 OpenACCCopyClause(Spelling, BeginLoc, LParenLoc, Mods, VarList, EndLoc);
441}
442
443OpenACCLinkClause *OpenACCLinkClause::Create(const ASTContext &C,
444 SourceLocation BeginLoc,
445 SourceLocation LParenLoc,
446 ArrayRef<Expr *> VarList,
447 SourceLocation EndLoc) {
448 void *Mem =
449 C.Allocate(OpenACCLinkClause::totalSizeToAlloc<Expr *>(VarList.size()));
450 return new (Mem) OpenACCLinkClause(BeginLoc, LParenLoc, VarList, EndLoc);
451}
452
453OpenACCDeviceResidentClause *OpenACCDeviceResidentClause::Create(
454 const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
455 ArrayRef<Expr *> VarList, SourceLocation EndLoc) {
456 void *Mem = C.Allocate(
457 OpenACCDeviceResidentClause::totalSizeToAlloc<Expr *>(VarList.size()));
458 return new (Mem)
459 OpenACCDeviceResidentClause(BeginLoc, LParenLoc, VarList, EndLoc);
460}
461
464 SourceLocation BeginLoc, SourceLocation LParenLoc,
466 SourceLocation EndLoc) {
467 void *Mem =
468 C.Allocate(OpenACCCopyInClause::totalSizeToAlloc<Expr *>(VarList.size()));
469 return new (Mem)
470 OpenACCCopyInClause(Spelling, BeginLoc, LParenLoc, Mods, VarList, EndLoc);
471}
472
475 SourceLocation BeginLoc, SourceLocation LParenLoc,
477 SourceLocation EndLoc) {
478 void *Mem = C.Allocate(
479 OpenACCCopyOutClause::totalSizeToAlloc<Expr *>(VarList.size()));
480 return new (Mem) OpenACCCopyOutClause(Spelling, BeginLoc, LParenLoc, Mods,
481 VarList, EndLoc);
482}
483
486 SourceLocation BeginLoc, SourceLocation LParenLoc,
488 SourceLocation EndLoc) {
489 void *Mem =
490 C.Allocate(OpenACCCreateClause::totalSizeToAlloc<Expr *>(VarList.size()));
491 return new (Mem)
492 OpenACCCreateClause(Spelling, BeginLoc, LParenLoc, Mods, VarList, EndLoc);
493}
494
495OpenACCDeviceTypeClause *OpenACCDeviceTypeClause::Create(
496 const ASTContext &C, OpenACCClauseKind K, SourceLocation BeginLoc,
498 SourceLocation EndLoc) {
499 void *Mem =
500 C.Allocate(OpenACCDeviceTypeClause::totalSizeToAlloc<DeviceTypeArgument>(
501 Archs.size()));
502 return new (Mem)
503 OpenACCDeviceTypeClause(K, BeginLoc, LParenLoc, Archs, EndLoc);
504}
505
506OpenACCReductionClause *OpenACCReductionClause::Create(
507 const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
510 SourceLocation EndLoc) {
511 size_t NumCombiners = llvm::accumulate(
512 Recipes, 0, [](size_t Num, const OpenACCReductionRecipeWithStorage &R) {
513 return Num + R.CombinerRecipes.size();
514 });
515
516 void *Mem = C.Allocate(OpenACCReductionClause::totalSizeToAlloc<
519 VarList.size(), Recipes.size(), NumCombiners));
520 return new (Mem) OpenACCReductionClause(BeginLoc, LParenLoc, Operator,
521 VarList, Recipes, EndLoc);
522}
523
525 SourceLocation BeginLoc,
526 SourceLocation EndLoc) {
527 void *Mem = C.Allocate(sizeof(OpenACCAutoClause));
528 return new (Mem) OpenACCAutoClause(BeginLoc, EndLoc);
529}
530
533 SourceLocation EndLoc) {
534 void *Mem = C.Allocate(sizeof(OpenACCIndependentClause));
535 return new (Mem) OpenACCIndependentClause(BeginLoc, EndLoc);
536}
537
539 SourceLocation BeginLoc,
540 SourceLocation EndLoc) {
541 void *Mem = C.Allocate(sizeof(OpenACCSeqClause));
542 return new (Mem) OpenACCSeqClause(BeginLoc, EndLoc);
543}
544
546 SourceLocation BeginLoc,
547 SourceLocation EndLoc) {
548 void *Mem = C.Allocate(sizeof(OpenACCNoHostClause));
549 return new (Mem) OpenACCNoHostClause(BeginLoc, EndLoc);
550}
551
554 SourceLocation LParenLoc,
556 ArrayRef<Expr *> IntExprs, SourceLocation EndLoc) {
557 void *Mem =
558 C.Allocate(OpenACCGangClause::totalSizeToAlloc<Expr *, OpenACCGangKind>(
559 IntExprs.size(), GangKinds.size()));
560 return new (Mem)
561 OpenACCGangClause(BeginLoc, LParenLoc, GangKinds, IntExprs, EndLoc);
562}
563
565 SourceLocation LParenLoc,
566 Expr *IntExpr, SourceLocation EndLoc)
568 LParenLoc, IntExpr, EndLoc) {
569 assert((!IntExpr || IntExpr->isInstantiationDependent() ||
570 IntExpr->getType()->isIntegerType()) &&
571 "Int expression type not scalar/dependent");
572}
573
575 SourceLocation BeginLoc,
576 SourceLocation LParenLoc,
577 Expr *IntExpr,
578 SourceLocation EndLoc) {
579 void *Mem =
580 C.Allocate(sizeof(OpenACCWorkerClause), alignof(OpenACCWorkerClause));
581 return new (Mem) OpenACCWorkerClause(BeginLoc, LParenLoc, IntExpr, EndLoc);
582}
583
585 SourceLocation LParenLoc,
586 Expr *IntExpr, SourceLocation EndLoc)
588 LParenLoc, IntExpr, EndLoc) {
589 assert((!IntExpr || IntExpr->isInstantiationDependent() ||
590 IntExpr->getType()->isIntegerType()) &&
591 "Int expression type not scalar/dependent");
592}
593
595 SourceLocation BeginLoc,
596 SourceLocation LParenLoc,
597 Expr *IntExpr,
598 SourceLocation EndLoc) {
599 void *Mem =
600 C.Allocate(sizeof(OpenACCVectorClause), alignof(OpenACCVectorClause));
601 return new (Mem) OpenACCVectorClause(BeginLoc, LParenLoc, IntExpr, EndLoc);
602}
603
605 SourceLocation BeginLoc,
606 SourceLocation EndLoc) {
607 void *Mem =
608 C.Allocate(sizeof(OpenACCFinalizeClause), alignof(OpenACCFinalizeClause));
609 return new (Mem) OpenACCFinalizeClause(BeginLoc, EndLoc);
610}
611
613 SourceLocation BeginLoc,
614 SourceLocation EndLoc) {
615 void *Mem = C.Allocate(sizeof(OpenACCIfPresentClause),
616 alignof(OpenACCIfPresentClause));
617 return new (Mem) OpenACCIfPresentClause(BeginLoc, EndLoc);
618}
619
620OpenACCBindClause *OpenACCBindClause::Create(const ASTContext &C,
621 SourceLocation BeginLoc,
622 SourceLocation LParenLoc,
623 const StringLiteral *SL,
624 SourceLocation EndLoc) {
625 void *Mem = C.Allocate(sizeof(OpenACCBindClause), alignof(OpenACCBindClause));
626 return new (Mem) OpenACCBindClause(BeginLoc, LParenLoc, SL, EndLoc);
627}
628
629OpenACCBindClause *OpenACCBindClause::Create(const ASTContext &C,
630 SourceLocation BeginLoc,
631 SourceLocation LParenLoc,
632 const IdentifierInfo *ID,
633 SourceLocation EndLoc) {
634 void *Mem = C.Allocate(sizeof(OpenACCBindClause), alignof(OpenACCBindClause));
635 return new (Mem) OpenACCBindClause(BeginLoc, LParenLoc, ID, EndLoc);
636}
637
639 const OpenACCBindClause &RHS) {
640 if (LHS.isStringArgument() != RHS.isStringArgument())
641 return false;
642
643 if (LHS.isStringArgument())
644 return LHS.getStringArgument()->getString() ==
646 return LHS.getIdentifierArgument()->getName() ==
648}
649
650//===----------------------------------------------------------------------===//
651// OpenACC clauses printing methods
652//===----------------------------------------------------------------------===//
653
654void OpenACCClausePrinter::printExpr(const Expr *E) {
655 E->printPretty(OS, nullptr, Policy, 0);
656}
657
658void OpenACCClausePrinter::VisitDefaultClause(const OpenACCDefaultClause &C) {
659 OS << "default(" << C.getDefaultClauseKind() << ")";
660}
661
662void OpenACCClausePrinter::VisitIfClause(const OpenACCIfClause &C) {
663 OS << "if(";
664 printExpr(C.getConditionExpr());
665 OS << ")";
666}
667
668void OpenACCClausePrinter::VisitSelfClause(const OpenACCSelfClause &C) {
669 OS << "self";
670
671 if (C.isConditionExprClause()) {
672 if (const Expr *CondExpr = C.getConditionExpr()) {
673 OS << "(";
674 printExpr(CondExpr);
675 OS << ")";
676 }
677 } else {
678 OS << "(";
679 llvm::interleaveComma(C.getVarList(), OS,
680 [&](const Expr *E) { printExpr(E); });
681 OS << ")";
682 }
683}
684
685void OpenACCClausePrinter::VisitNumGangsClause(const OpenACCNumGangsClause &C) {
686 OS << "num_gangs(";
687 llvm::interleaveComma(C.getIntExprs(), OS,
688 [&](const Expr *E) { printExpr(E); });
689 OS << ")";
690}
691
692void OpenACCClausePrinter::VisitTileClause(const OpenACCTileClause &C) {
693 OS << "tile(";
694 llvm::interleaveComma(C.getSizeExprs(), OS,
695 [&](const Expr *E) { printExpr(E); });
696 OS << ")";
697}
698
699void OpenACCClausePrinter::VisitNumWorkersClause(
700 const OpenACCNumWorkersClause &C) {
701 OS << "num_workers(";
702 printExpr(C.getIntExpr());
703 OS << ")";
704}
705
706void OpenACCClausePrinter::VisitVectorLengthClause(
708 OS << "vector_length(";
709 printExpr(C.getIntExpr());
710 OS << ")";
711}
712
713void OpenACCClausePrinter::VisitDeviceNumClause(
714 const OpenACCDeviceNumClause &C) {
715 OS << "device_num(";
716 printExpr(C.getIntExpr());
717 OS << ")";
718}
719
720void OpenACCClausePrinter::VisitDefaultAsyncClause(
722 OS << "default_async(";
723 printExpr(C.getIntExpr());
724 OS << ")";
725}
726
727void OpenACCClausePrinter::VisitAsyncClause(const OpenACCAsyncClause &C) {
728 OS << "async";
729 if (C.hasIntExpr()) {
730 OS << "(";
731 printExpr(C.getIntExpr());
732 OS << ")";
733 }
734}
735
736void OpenACCClausePrinter::VisitPrivateClause(const OpenACCPrivateClause &C) {
737 OS << "private(";
738 llvm::interleaveComma(C.getVarList(), OS,
739 [&](const Expr *E) { printExpr(E); });
740 OS << ")";
741}
742
743void OpenACCClausePrinter::VisitFirstPrivateClause(
745 OS << "firstprivate(";
746 llvm::interleaveComma(C.getVarList(), OS,
747 [&](const Expr *E) { printExpr(E); });
748 OS << ")";
749}
750
751void OpenACCClausePrinter::VisitAttachClause(const OpenACCAttachClause &C) {
752 OS << "attach(";
753 llvm::interleaveComma(C.getVarList(), OS,
754 [&](const Expr *E) { printExpr(E); });
755 OS << ")";
756}
757
758void OpenACCClausePrinter::VisitDetachClause(const OpenACCDetachClause &C) {
759 OS << "detach(";
760 llvm::interleaveComma(C.getVarList(), OS,
761 [&](const Expr *E) { printExpr(E); });
762 OS << ")";
763}
764
765void OpenACCClausePrinter::VisitDeleteClause(const OpenACCDeleteClause &C) {
766 OS << "delete(";
767 llvm::interleaveComma(C.getVarList(), OS,
768 [&](const Expr *E) { printExpr(E); });
769 OS << ")";
770}
771
772void OpenACCClausePrinter::VisitUseDeviceClause(
773 const OpenACCUseDeviceClause &C) {
774 OS << "use_device(";
775 llvm::interleaveComma(C.getVarList(), OS,
776 [&](const Expr *E) { printExpr(E); });
777 OS << ")";
778}
779
780void OpenACCClausePrinter::VisitDevicePtrClause(
781 const OpenACCDevicePtrClause &C) {
782 OS << "deviceptr(";
783 llvm::interleaveComma(C.getVarList(), OS,
784 [&](const Expr *E) { printExpr(E); });
785 OS << ")";
786}
787
788void OpenACCClausePrinter::VisitNoCreateClause(const OpenACCNoCreateClause &C) {
789 OS << "no_create(";
790 llvm::interleaveComma(C.getVarList(), OS,
791 [&](const Expr *E) { printExpr(E); });
792 OS << ")";
793}
794
795void OpenACCClausePrinter::VisitPresentClause(const OpenACCPresentClause &C) {
796 OS << "present(";
797 llvm::interleaveComma(C.getVarList(), OS,
798 [&](const Expr *E) { printExpr(E); });
799 OS << ")";
800}
801
802void OpenACCClausePrinter::VisitHostClause(const OpenACCHostClause &C) {
803 OS << "host(";
804 llvm::interleaveComma(C.getVarList(), OS,
805 [&](const Expr *E) { printExpr(E); });
806 OS << ")";
807}
808
809void OpenACCClausePrinter::VisitDeviceClause(const OpenACCDeviceClause &C) {
810 OS << "device(";
811 llvm::interleaveComma(C.getVarList(), OS,
812 [&](const Expr *E) { printExpr(E); });
813 OS << ")";
814}
815
816void OpenACCClausePrinter::VisitCopyClause(const OpenACCCopyClause &C) {
817 OS << C.getClauseKind() << '(';
818 if (C.getModifierList() != OpenACCModifierKind::Invalid)
819 OS << C.getModifierList() << ": ";
820 llvm::interleaveComma(C.getVarList(), OS,
821 [&](const Expr *E) { printExpr(E); });
822 OS << ")";
823}
824
825void OpenACCClausePrinter::VisitLinkClause(const OpenACCLinkClause &C) {
826 OS << "link(";
827 llvm::interleaveComma(C.getVarList(), OS,
828 [&](const Expr *E) { printExpr(E); });
829 OS << ")";
830}
831
832void OpenACCClausePrinter::VisitDeviceResidentClause(
834 OS << "device_resident(";
835 llvm::interleaveComma(C.getVarList(), OS,
836 [&](const Expr *E) { printExpr(E); });
837 OS << ")";
838}
839
840void OpenACCClausePrinter::VisitCopyInClause(const OpenACCCopyInClause &C) {
841 OS << C.getClauseKind() << '(';
842 if (C.getModifierList() != OpenACCModifierKind::Invalid)
843 OS << C.getModifierList() << ": ";
844 llvm::interleaveComma(C.getVarList(), OS,
845 [&](const Expr *E) { printExpr(E); });
846 OS << ")";
847}
848
849void OpenACCClausePrinter::VisitCopyOutClause(const OpenACCCopyOutClause &C) {
850 OS << C.getClauseKind() << '(';
851 if (C.getModifierList() != OpenACCModifierKind::Invalid)
852 OS << C.getModifierList() << ": ";
853 llvm::interleaveComma(C.getVarList(), OS,
854 [&](const Expr *E) { printExpr(E); });
855 OS << ")";
856}
857
858void OpenACCClausePrinter::VisitCreateClause(const OpenACCCreateClause &C) {
859 OS << C.getClauseKind() << '(';
860 if (C.getModifierList() != OpenACCModifierKind::Invalid)
861 OS << C.getModifierList() << ": ";
862 llvm::interleaveComma(C.getVarList(), OS,
863 [&](const Expr *E) { printExpr(E); });
864 OS << ")";
865}
866
867void OpenACCClausePrinter::VisitReductionClause(
868 const OpenACCReductionClause &C) {
869 OS << "reduction(" << C.getReductionOp() << ": ";
870 llvm::interleaveComma(C.getVarList(), OS,
871 [&](const Expr *E) { printExpr(E); });
872 OS << ")";
873}
874
875void OpenACCClausePrinter::VisitWaitClause(const OpenACCWaitClause &C) {
876 OS << "wait";
877 if (C.hasExprs()) {
878 OS << "(";
879 if (C.hasDevNumExpr()) {
880 OS << "devnum: ";
881 printExpr(C.getDevNumExpr());
882 OS << " : ";
883 }
884
885 if (C.hasQueuesTag())
886 OS << "queues: ";
887
888 llvm::interleaveComma(C.getQueueIdExprs(), OS,
889 [&](const Expr *E) { printExpr(E); });
890 OS << ")";
891 }
892}
893
894void OpenACCClausePrinter::VisitDeviceTypeClause(
895 const OpenACCDeviceTypeClause &C) {
896 OS << C.getClauseKind();
897 OS << "(";
898 llvm::interleaveComma(C.getArchitectures(), OS,
899 [&](const DeviceTypeArgument &Arch) {
900 if (Arch.getIdentifierInfo() == nullptr)
901 OS << "*";
902 else
903 OS << Arch.getIdentifierInfo()->getName();
904 });
905 OS << ")";
906}
907
908void OpenACCClausePrinter::VisitAutoClause(const OpenACCAutoClause &C) {
909 OS << "auto";
910}
911
912void OpenACCClausePrinter::VisitIndependentClause(
914 OS << "independent";
915}
916
917void OpenACCClausePrinter::VisitSeqClause(const OpenACCSeqClause &C) {
918 OS << "seq";
919}
920
921void OpenACCClausePrinter::VisitNoHostClause(const OpenACCNoHostClause &C) {
922 OS << "nohost";
923}
924
925void OpenACCClausePrinter::VisitCollapseClause(const OpenACCCollapseClause &C) {
926 OS << "collapse(";
927 if (C.hasForce())
928 OS << "force:";
929 printExpr(C.getLoopCount());
930 OS << ")";
931}
932
933void OpenACCClausePrinter::VisitGangClause(const OpenACCGangClause &C) {
934 OS << "gang";
935
936 if (C.getNumExprs() > 0) {
937 OS << "(";
938 bool first = true;
939 for (unsigned I = 0; I < C.getNumExprs(); ++I) {
940 if (!first)
941 OS << ", ";
942 first = false;
943
944 OS << C.getExpr(I).first << ": ";
945 printExpr(C.getExpr(I).second);
946 }
947 OS << ")";
948 }
949}
950
951void OpenACCClausePrinter::VisitWorkerClause(const OpenACCWorkerClause &C) {
952 OS << "worker";
953
954 if (C.hasIntExpr()) {
955 OS << "(num: ";
956 printExpr(C.getIntExpr());
957 OS << ")";
958 }
959}
960
961void OpenACCClausePrinter::VisitVectorClause(const OpenACCVectorClause &C) {
962 OS << "vector";
963
964 if (C.hasIntExpr()) {
965 OS << "(length: ";
966 printExpr(C.getIntExpr());
967 OS << ")";
968 }
969}
970
971void OpenACCClausePrinter::VisitFinalizeClause(const OpenACCFinalizeClause &C) {
972 OS << "finalize";
973}
974
975void OpenACCClausePrinter::VisitIfPresentClause(
976 const OpenACCIfPresentClause &C) {
977 OS << "if_present";
978}
979
980void OpenACCClausePrinter::VisitBindClause(const OpenACCBindClause &C) {
981 OS << "bind(";
982 if (C.isStringArgument())
983 OS << '"' << C.getStringArgument()->getString() << '"';
984 else
985 OS << C.getIdentifierArgument()->getName();
986 OS << ")";
987}
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:220
This represents one expression.
Definition Expr.h:112
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Definition Expr.h:223
QualType getType() const
Definition Expr.h:144
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
static bool classof(const OpenACCClause *C)
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 bool classof(const OpenACCClause *C)
OpenACCAutoClause(SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCAutoClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
const IdentifierInfo * getIdentifierArgument() const
const StringLiteral * getStringArgument() const
static bool classof(const OpenACCClause *C)
static OpenACCBindClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, const IdentifierInfo *ID, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
OpenACCClauseWithCondition(OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
OpenACCClauseWithExprs(OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
void setExprs(MutableArrayRef< Expr * > NewExprs)
Used only for initialization, the leaf class can initialize this to trailing storage.
Represents a clause that has a list of parameters.
static bool classof(const OpenACCClause *C)
Represents one of a handful of clauses that have a single integer expression.
OpenACCClauseWithSingleIntExpr(OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
This is the base type for all OpenACC Clauses.
StmtIterator child_iterator
OpenACCClauseKind getClauseKind() const
llvm::iterator_range< child_iterator > child_range
OpenACCClause(OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation EndLoc)
Represents a 'collapse' clause on a 'loop' construct.
static OpenACCCollapseClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, bool HasForce, Expr *LoopCount, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCCopyClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, OpenACCModifierKind Mods, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
static OpenACCCopyInClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, OpenACCModifierKind Mods, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCCopyOutClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, OpenACCModifierKind Mods, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCCreateClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, OpenACCModifierKind Mods, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCDefaultAsyncClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
A 'default' clause, has the optional 'none' or 'present' argument.
OpenACCDefaultClause(OpenACCDefaultClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, 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 bool classof(const OpenACCClause *C)
static OpenACCDetachClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
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 bool classof(const OpenACCClause *C)
static OpenACCDevicePtrClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCDeviceResidentClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
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 bool classof(const OpenACCClause *C)
OpenACCFinalizeClause(SourceLocation BeginLoc, 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, ArrayRef< OpenACCFirstPrivateRecipe > InitRecipes, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCGangClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< OpenACCGangKind > GangKinds, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
OpenACCGangClause(SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< OpenACCGangKind > GangKinds, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCHostClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
An 'if' clause, which has a required condition expression.
OpenACCIfClause(SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static OpenACCIfClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCIfPresentClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
OpenACCIfPresentClause(SourceLocation BeginLoc, SourceLocation EndLoc)
OpenACCIndependentClause(SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCIndependentClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCLinkClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
static OpenACCNoCreateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
OpenACCNoHostClause(SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCNoHostClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCNumGangsClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCNumWorkersClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
static OpenACCPresentClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCPrivateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, ArrayRef< OpenACCPrivateRecipe > InitRecipes, SourceLocation EndLoc)
static OpenACCReductionClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, OpenACCReductionOperator Operator, ArrayRef< Expr * > VarList, ArrayRef< OpenACCReductionRecipeWithStorage > Recipes, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
A 'self' clause, which has an optional condition expression, or, in the event of an 'update' directiv...
static bool classof(const OpenACCClause *C)
static OpenACCSelfClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static OpenACCSeqClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
OpenACCSeqClause(SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCTileClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > SizeExprs, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCUseDeviceClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCVectorClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
OpenACCVectorClause(SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCVectorLengthClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static OpenACCWaitClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *DevNumExpr, SourceLocation QueuesLoc, ArrayRef< Expr * > QueueIdExprs, SourceLocation EndLoc)
static bool classof(const OpenACCClause *C)
static bool classof(const OpenACCClause *C)
static OpenACCWorkerClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
OpenACCWorkerClause(SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
Encodes a location in the source.
void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1799
StringRef getString() const
Definition Expr.h:1867
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
Definition TypeBase.h:8915
bool isScalarType() const
Definition TypeBase.h:8973
The JSON file list parser is used to communicate input to InstallAPI.
OpenACCReductionOperator
bool isa(CodeGen::Address addr)
Definition Address.h:330
OpenACCModifierKind
OpenACCClauseKind
Represents the kind of an OpenACC clause.
@ Gang
'gang' clause, allowed on 'loop' and Combined constructs.
@ VectorLength
'vector_length' clause, allowed on 'parallel', 'kernels', 'parallel loop', and 'kernels loop' constru...
@ Async
'async' clause, allowed on Compute, Data, 'update', 'wait', and Combined constructs.
@ Collapse
'collapse' clause, allowed on 'loop' and Combined constructs.
@ DeviceNum
'device_num' clause, allowed on 'init', 'shutdown', and 'set' constructs.
@ Vector
'vector' clause, allowed on 'loop', Combined, and 'routine' directives.
@ Worker
'worker' clause, allowed on 'loop', Combined, and 'routine' directives.
@ DefaultAsync
'default_async' clause, allowed on 'set' construct.
@ If
'if' clause, allowed on all the Compute Constructs, Data Constructs, Executable Constructs,...
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
@ NumWorkers
'num_workers' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs...
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
Definition CallGraph.h:204
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
OpenACCDefaultClauseKind
IdentifierLoc DeviceTypeArgument
llvm::SmallVector< OpenACCReductionRecipe::CombinerRecipe, 1 > CombinerRecipes