clang 20.0.0git
StmtOpenACC.h
Go to the documentation of this file.
1//===- StmtOpenACC.h - Classes for OpenACC directives ----------*- C++ -*-===//
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/// \file
9/// This file defines OpenACC AST classes for statement-level contructs.
10///
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_AST_STMTOPENACC_H
14#define LLVM_CLANG_AST_STMTOPENACC_H
15
17#include "clang/AST/Stmt.h"
20#include <memory>
21
22namespace clang {
23/// This is the base class for an OpenACC statement-level construct, other
24/// construct types are expected to inherit from this.
25class OpenACCConstructStmt : public Stmt {
26 friend class ASTStmtWriter;
27 friend class ASTStmtReader;
28 /// The directive kind. Each implementation of this interface should handle
29 /// specific kinds.
31 /// The location of the directive statement, from the '#' to the last token of
32 /// the directive.
34 /// The location of the directive name.
35 SourceLocation DirectiveLoc;
36
37 /// The list of clauses. This is stored here as an ArrayRef, as this is the
38 /// most convienient place to access the list, however the list itself should
39 /// be stored in leaf nodes, likely in trailing-storage.
41
42protected:
44 SourceLocation Start, SourceLocation DirectiveLoc,
46 : Stmt(SC), Kind(K), Range(Start, End), DirectiveLoc(DirectiveLoc) {}
47
48 // Used only for initialization, the leaf class can initialize this to
49 // trailing storage.
51 assert(Clauses.empty() && "Cannot change clause list");
52 Clauses = NewClauses;
53 }
54
55public:
57
58 static bool classof(const Stmt *S) {
59 return S->getStmtClass() >= firstOpenACCConstructStmtConstant &&
60 S->getStmtClass() <= lastOpenACCConstructStmtConstant;
61 }
62
63 SourceLocation getBeginLoc() const { return Range.getBegin(); }
64 SourceLocation getEndLoc() const { return Range.getEnd(); }
65 SourceLocation getDirectiveLoc() const { return DirectiveLoc; }
66 ArrayRef<const OpenACCClause *> clauses() const { return Clauses; }
67
70 }
71
73 return const_cast<OpenACCConstructStmt *>(this)->children();
74 }
75};
76
77/// This is a base class for any OpenACC statement-level constructs that have an
78/// associated statement. This class is not intended to be instantiated, but is
79/// a convenient place to hold the associated statement.
81 friend class ASTStmtWriter;
82 friend class ASTStmtReader;
83 template <typename Derived> friend class RecursiveASTVisitor;
84 Stmt *AssociatedStmt = nullptr;
85
86protected:
88 SourceLocation Start,
89 SourceLocation DirectiveLoc,
90 SourceLocation End, Stmt *AssocStmt)
91 : OpenACCConstructStmt(SC, K, Start, DirectiveLoc, End),
92 AssociatedStmt(AssocStmt) {}
93
94 void setAssociatedStmt(Stmt *S) { AssociatedStmt = S; }
95 Stmt *getAssociatedStmt() { return AssociatedStmt; }
96 const Stmt *getAssociatedStmt() const {
97 return const_cast<OpenACCAssociatedStmtConstruct *>(this)
99 }
100
101public:
102 static bool classof(const Stmt *T) {
103 return false;
104 }
105
107 if (getAssociatedStmt())
108 return child_range(&AssociatedStmt, &AssociatedStmt + 1);
110 }
111
113 return const_cast<OpenACCAssociatedStmtConstruct *>(this)->children();
114 }
115};
116
117/// This class represents a compute construct, representing a 'Kind' of
118/// `parallel', 'serial', or 'kernel'. These constructs are associated with a
119/// 'structured block', defined as:
120///
121/// in C or C++, an executable statement, possibly compound, with a single
122/// entry at the top and a single exit at the bottom
123///
124/// At the moment there is no real motivation to have a different AST node for
125/// those three, as they are semantically identical, and have only minor
126/// differences in the permitted list of clauses, which can be differentiated by
127/// the 'Kind'.
130 private llvm::TrailingObjects<OpenACCComputeConstruct,
131 const OpenACCClause *> {
132 friend class ASTStmtWriter;
133 friend class ASTStmtReader;
134 friend class ASTContext;
135 friend TrailingObjects;
136 OpenACCComputeConstruct(unsigned NumClauses)
138 OpenACCComputeConstructClass, OpenACCDirectiveKind::Invalid,
140 /*AssociatedStmt=*/nullptr) {
141 // We cannot send the TrailingObjects storage to the base class (which holds
142 // a reference to the data) until it is constructed, so we have to set it
143 // separately here.
144 std::uninitialized_value_construct(
145 getTrailingObjects<const OpenACCClause *>(),
146 getTrailingObjects<const OpenACCClause *>() + NumClauses);
147 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
148 NumClauses));
149 }
150
152 SourceLocation DirectiveLoc, SourceLocation End,
154 Stmt *StructuredBlock)
155 : OpenACCAssociatedStmtConstruct(OpenACCComputeConstructClass, K, Start,
156 DirectiveLoc, End, StructuredBlock) {
158 "Only parallel, serial, and kernels constructs should be "
159 "represented by this type");
160
161 // Initialize the trailing storage.
162 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
163 getTrailingObjects<const OpenACCClause *>());
164
165 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
166 Clauses.size()));
167 }
168
169 void setStructuredBlock(Stmt *S) { setAssociatedStmt(S); }
170
171public:
172 static bool classof(const Stmt *T) {
173 return T->getStmtClass() == OpenACCComputeConstructClass;
174 }
175
177 unsigned NumClauses);
180 SourceLocation DirectiveLoc, SourceLocation EndLoc,
181 ArrayRef<const OpenACCClause *> Clauses, Stmt *StructuredBlock);
182
184 const Stmt *getStructuredBlock() const {
185 return const_cast<OpenACCComputeConstruct *>(this)->getStructuredBlock();
186 }
187};
188/// This class represents a 'loop' construct. The 'loop' construct applies to a
189/// 'for' loop (or range-for loop), and is optionally associated with a Compute
190/// Construct.
193 private llvm::TrailingObjects<OpenACCLoopConstruct,
194 const OpenACCClause *> {
195 // The compute/combined construct kind this loop is associated with, or
196 // invalid if this is an orphaned loop construct.
197 OpenACCDirectiveKind ParentComputeConstructKind =
199
200 friend class ASTStmtWriter;
201 friend class ASTStmtReader;
202 friend class ASTContext;
206 friend TrailingObjects;
207
208 OpenACCLoopConstruct(unsigned NumClauses);
209
211 SourceLocation DirLoc, SourceLocation End,
213
214public:
215 static bool classof(const Stmt *T) {
216 return T->getStmtClass() == OpenACCLoopConstructClass;
217 }
218
220 unsigned NumClauses);
221
222 static OpenACCLoopConstruct *
223 Create(const ASTContext &C, OpenACCDirectiveKind ParentKind,
224 SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc,
226
228 const Stmt *getLoop() const {
229 return const_cast<OpenACCLoopConstruct *>(this)->getLoop();
230 }
231
232 /// OpenACC 3.3 2.9:
233 /// An orphaned loop construct is a loop construct that is not lexically
234 /// enclosed within a compute construct. The parent compute construct of a
235 /// loop construct is the nearest compute construct that lexically contains
236 /// the loop construct.
238 return ParentComputeConstructKind == OpenACCDirectiveKind::Invalid;
239 }
240
242 return ParentComputeConstructKind;
243 }
244};
245
246// This class represents a 'combined' construct, which has a bunch of rules
247// shared with both loop and compute constructs.
250 private llvm::TrailingObjects<OpenACCCombinedConstruct,
251 const OpenACCClause *> {
252 friend TrailingObjects;
253 OpenACCCombinedConstruct(unsigned NumClauses)
255 OpenACCCombinedConstructClass, OpenACCDirectiveKind::Invalid,
257 /*AssociatedStmt=*/nullptr) {
258 std::uninitialized_value_construct(
259 getTrailingObjects<const OpenACCClause *>(),
260 getTrailingObjects<const OpenACCClause *>() + NumClauses);
261 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
262 NumClauses));
263 }
264
266 SourceLocation DirectiveLoc, SourceLocation End,
268 Stmt *StructuredBlock)
269 : OpenACCAssociatedStmtConstruct(OpenACCCombinedConstructClass, K, Start,
270 DirectiveLoc, End, StructuredBlock) {
272 "Only parallel loop, serial loop, and kernels loop constructs "
273 "should be represented by this type");
274
275 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
276 getTrailingObjects<const OpenACCClause *>());
277 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
278 Clauses.size()));
279 }
280 void setStructuredBlock(Stmt *S) { setAssociatedStmt(S); }
281
282public:
283 static bool classof(const Stmt *T) {
284 return T->getStmtClass() == OpenACCCombinedConstructClass;
285 }
286
288 unsigned NumClauses);
291 SourceLocation DirectiveLoc, SourceLocation End,
292 ArrayRef<const OpenACCClause *> Clauses, Stmt *StructuredBlock);
294 const Stmt *getLoop() const {
295 return const_cast<OpenACCCombinedConstruct *>(this)->getLoop();
296 }
297};
298
299// This class represents a 'data' construct, which has an associated statement
300// and clauses, but is otherwise pretty simple.
303 private llvm::TrailingObjects<OpenACCDataConstruct,
304 const OpenACCClause *> {
305 friend TrailingObjects;
306 OpenACCDataConstruct(unsigned NumClauses)
308 OpenACCDataConstructClass, OpenACCDirectiveKind::Data,
310 /*AssociatedStmt=*/nullptr) {
311 std::uninitialized_value_construct(
312 getTrailingObjects<const OpenACCClause *>(),
313 getTrailingObjects<const OpenACCClause *>() + NumClauses);
314 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
315 NumClauses));
316 }
317
319 SourceLocation End,
321 Stmt *StructuredBlock)
322 : OpenACCAssociatedStmtConstruct(OpenACCDataConstructClass,
324 DirectiveLoc, End, StructuredBlock) {
325 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
326 getTrailingObjects<const OpenACCClause *>());
327 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
328 Clauses.size()));
329 }
330 void setStructuredBlock(Stmt *S) { setAssociatedStmt(S); }
331
332public:
333 static bool classof(const Stmt *T) {
334 return T->getStmtClass() == OpenACCDataConstructClass;
335 }
336
338 unsigned NumClauses);
340 SourceLocation DirectiveLoc,
341 SourceLocation End,
343 Stmt *StructuredBlock);
345 const Stmt *getStructuredBlock() const {
346 return const_cast<OpenACCDataConstruct *>(this)->getStructuredBlock();
347 }
348};
349// This class represents a 'enter data' construct, which JUST has clauses.
351 : public OpenACCConstructStmt,
352 private llvm::TrailingObjects<OpenACCEnterDataConstruct,
353 const OpenACCClause *> {
354 friend TrailingObjects;
355 OpenACCEnterDataConstruct(unsigned NumClauses)
356 : OpenACCConstructStmt(OpenACCEnterDataConstructClass,
359 std::uninitialized_value_construct(
360 getTrailingObjects<const OpenACCClause *>(),
361 getTrailingObjects<const OpenACCClause *>() + NumClauses);
362 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
363 NumClauses));
364 }
366 SourceLocation End,
368 : OpenACCConstructStmt(OpenACCEnterDataConstructClass,
370 DirectiveLoc, End) {
371 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
372 getTrailingObjects<const OpenACCClause *>());
373 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
374 Clauses.size()));
375 }
376
377public:
378 static bool classof(const Stmt *T) {
379 return T->getStmtClass() == OpenACCEnterDataConstructClass;
380 }
382 unsigned NumClauses);
384 Create(const ASTContext &C, SourceLocation Start, SourceLocation DirectiveLoc,
386};
387// This class represents a 'exit data' construct, which JUST has clauses.
389 : public OpenACCConstructStmt,
390 private llvm::TrailingObjects<OpenACCExitDataConstruct,
391 const OpenACCClause *> {
392 friend TrailingObjects;
393 OpenACCExitDataConstruct(unsigned NumClauses)
394 : OpenACCConstructStmt(OpenACCExitDataConstructClass,
397 std::uninitialized_value_construct(
398 getTrailingObjects<const OpenACCClause *>(),
399 getTrailingObjects<const OpenACCClause *>() + NumClauses);
400 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
401 NumClauses));
402 }
404 SourceLocation End,
406 : OpenACCConstructStmt(OpenACCExitDataConstructClass,
408 DirectiveLoc, End) {
409 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
410 getTrailingObjects<const OpenACCClause *>());
411 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
412 Clauses.size()));
413 }
414
415public:
416 static bool classof(const Stmt *T) {
417 return T->getStmtClass() == OpenACCExitDataConstructClass;
418 }
420 unsigned NumClauses);
422 Create(const ASTContext &C, SourceLocation Start, SourceLocation DirectiveLoc,
424};
425// This class represents a 'host_data' construct, which has an associated
426// statement and clauses, but is otherwise pretty simple.
429 private llvm::TrailingObjects<OpenACCHostDataConstruct,
430 const OpenACCClause *> {
431 friend TrailingObjects;
432 OpenACCHostDataConstruct(unsigned NumClauses)
434 OpenACCHostDataConstructClass, OpenACCDirectiveKind::HostData,
436 /*AssociatedStmt=*/nullptr) {
437 std::uninitialized_value_construct(
438 getTrailingObjects<const OpenACCClause *>(),
439 getTrailingObjects<const OpenACCClause *>() + NumClauses);
440 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
441 NumClauses));
442 }
444 SourceLocation End,
446 Stmt *StructuredBlock)
447 : OpenACCAssociatedStmtConstruct(OpenACCHostDataConstructClass,
449 DirectiveLoc, End, StructuredBlock) {
450 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
451 getTrailingObjects<const OpenACCClause *>());
452 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
453 Clauses.size()));
454 }
455 void setStructuredBlock(Stmt *S) { setAssociatedStmt(S); }
456
457public:
458 static bool classof(const Stmt *T) {
459 return T->getStmtClass() == OpenACCHostDataConstructClass;
460 }
462 unsigned NumClauses);
464 Create(const ASTContext &C, SourceLocation Start, SourceLocation DirectiveLoc,
466 Stmt *StructuredBlock);
468 const Stmt *getStructuredBlock() const {
469 return const_cast<OpenACCHostDataConstruct *>(this)->getStructuredBlock();
470 }
471};
472
473// This class represents a 'wait' construct, which has some expressions plus a
474// clause list.
476 : public OpenACCConstructStmt,
477 private llvm::TrailingObjects<OpenACCWaitConstruct, Expr *,
478 OpenACCClause *> {
479 // FIXME: We should be storing a `const OpenACCClause *` to be consistent with
480 // the rest of the constructs, but TrailingObjects doesn't allow for mixing
481 // constness in its implementation of `getTrailingObjects`.
482
483 friend TrailingObjects;
484 friend class ASTStmtWriter;
485 friend class ASTStmtReader;
486 // Locations of the left and right parens of the 'wait-argument'
487 // expression-list.
488 SourceLocation LParenLoc, RParenLoc;
489 // Location of the 'queues' keyword, if present.
490 SourceLocation QueuesLoc;
491
492 // Number of the expressions being represented. Index '0' is always the
493 // 'devnum' expression, even if it not present.
494 unsigned NumExprs = 0;
495
496 OpenACCWaitConstruct(unsigned NumExprs, unsigned NumClauses)
497 : OpenACCConstructStmt(OpenACCWaitConstructClass,
500 NumExprs(NumExprs) {
501 assert(NumExprs >= 1 &&
502 "NumExprs should always be >= 1 because the 'devnum' "
503 "expr is represented by a null if necessary");
504 std::uninitialized_value_construct(getExprPtr(),
505 getExprPtr() + NumExprs);
506 std::uninitialized_value_construct(getTrailingObjects<OpenACCClause *>(),
507 getTrailingObjects<OpenACCClause *>() +
508 NumClauses);
509 setClauseList(MutableArrayRef(const_cast<const OpenACCClause **>(
510 getTrailingObjects<OpenACCClause *>()),
511 NumClauses));
512 }
513
515 SourceLocation LParenLoc, Expr *DevNumExpr,
516 SourceLocation QueuesLoc, ArrayRef<Expr *> QueueIdExprs,
517 SourceLocation RParenLoc, SourceLocation End,
519 : OpenACCConstructStmt(OpenACCWaitConstructClass,
520 OpenACCDirectiveKind::Wait, Start, DirectiveLoc,
521 End),
522 LParenLoc(LParenLoc), RParenLoc(RParenLoc), QueuesLoc(QueuesLoc),
523 NumExprs(QueueIdExprs.size() + 1) {
524 assert(NumExprs >= 1 &&
525 "NumExprs should always be >= 1 because the 'devnum' "
526 "expr is represented by a null if necessary");
527
528 std::uninitialized_copy(&DevNumExpr, &DevNumExpr + 1,
529 getExprPtr());
530 std::uninitialized_copy(QueueIdExprs.begin(), QueueIdExprs.end(),
531 getExprPtr() + 1);
532
533 std::uninitialized_copy(const_cast<OpenACCClause **>(Clauses.begin()),
534 const_cast<OpenACCClause **>(Clauses.end()),
535 getTrailingObjects<OpenACCClause *>());
536 setClauseList(MutableArrayRef(const_cast<const OpenACCClause **>(
537 getTrailingObjects<OpenACCClause *>()),
538 Clauses.size()));
539 }
540
541 size_t numTrailingObjects(OverloadToken<Expr *>) const { return NumExprs; }
542 size_t numTrailingObjects(OverloadToken<const OpenACCClause *>) const {
543 return clauses().size();
544 }
545
546 Expr **getExprPtr() const {
547 return const_cast<Expr**>(getTrailingObjects<Expr *>());
548 }
549
550 llvm::ArrayRef<Expr *> getExprs() const {
551 return llvm::ArrayRef<Expr *>(getExprPtr(), NumExprs);
552 }
553
554 llvm::ArrayRef<Expr *> getExprs() {
555 return llvm::ArrayRef<Expr *>(getExprPtr(), NumExprs);
556 }
557
558public:
559 static bool classof(const Stmt *T) {
560 return T->getStmtClass() == OpenACCWaitConstructClass;
561 }
562
563 static OpenACCWaitConstruct *
564 CreateEmpty(const ASTContext &C, unsigned NumExprs, unsigned NumClauses);
565
566 static OpenACCWaitConstruct *
567 Create(const ASTContext &C, SourceLocation Start, SourceLocation DirectiveLoc,
568 SourceLocation LParenLoc, Expr *DevNumExpr, SourceLocation QueuesLoc,
569 ArrayRef<Expr *> QueueIdExprs, SourceLocation RParenLoc,
571
572 SourceLocation getLParenLoc() const { return LParenLoc; }
573 SourceLocation getRParenLoc() const { return RParenLoc; }
574 bool hasQueuesTag() const { return !QueuesLoc.isInvalid(); }
575 SourceLocation getQueuesLoc() const { return QueuesLoc; }
576
577 bool hasDevNumExpr() const { return getExprs()[0]; }
578 Expr *getDevNumExpr() const { return getExprs()[0]; }
579 llvm::ArrayRef<Expr *> getQueueIdExprs() { return getExprs().drop_front(); }
581 return getExprs().drop_front();
582 }
583
585 Stmt **Begin = reinterpret_cast<Stmt **>(getExprPtr());
586 return child_range(Begin, Begin + NumExprs);
587 }
588
590 Stmt *const *Begin =
591 reinterpret_cast<Stmt *const *>(getExprPtr());
592 return const_child_range(Begin, Begin + NumExprs);
593 }
594};
595
596// This class represents an 'init' construct, which has just a clause list.
598 : public OpenACCConstructStmt,
599 private llvm::TrailingObjects<OpenACCInitConstruct,
600 const OpenACCClause *> {
601 friend TrailingObjects;
602 OpenACCInitConstruct(unsigned NumClauses)
603 : OpenACCConstructStmt(OpenACCInitConstructClass,
606 std::uninitialized_value_construct(
607 getTrailingObjects<const OpenACCClause *>(),
608 getTrailingObjects<const OpenACCClause *>() + NumClauses);
609 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
610 NumClauses));
611 }
613 SourceLocation End,
615 : OpenACCConstructStmt(OpenACCInitConstructClass,
616 OpenACCDirectiveKind::Init, Start, DirectiveLoc,
617 End) {
618 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
619 getTrailingObjects<const OpenACCClause *>());
620 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
621 Clauses.size()));
622 }
623
624public:
625 static bool classof(const Stmt *T) {
626 return T->getStmtClass() == OpenACCInitConstructClass;
627 }
629 unsigned NumClauses);
631 SourceLocation DirectiveLoc,
632 SourceLocation End,
634};
635
636// This class represents a 'shutdown' construct, which has just a clause list.
638 : public OpenACCConstructStmt,
639 private llvm::TrailingObjects<OpenACCShutdownConstruct,
640 const OpenACCClause *> {
641 friend TrailingObjects;
642 OpenACCShutdownConstruct(unsigned NumClauses)
643 : OpenACCConstructStmt(OpenACCShutdownConstructClass,
646 std::uninitialized_value_construct(
647 getTrailingObjects<const OpenACCClause *>(),
648 getTrailingObjects<const OpenACCClause *>() + NumClauses);
649 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
650 NumClauses));
651 }
653 SourceLocation End,
655 : OpenACCConstructStmt(OpenACCShutdownConstructClass,
657 DirectiveLoc, End) {
658 std::uninitialized_copy(Clauses.begin(), Clauses.end(),
659 getTrailingObjects<const OpenACCClause *>());
660 setClauseList(MutableArrayRef(getTrailingObjects<const OpenACCClause *>(),
661 Clauses.size()));
662 }
663
664public:
665 static bool classof(const Stmt *T) {
666 return T->getStmtClass() == OpenACCShutdownConstructClass;
667 }
669 unsigned NumClauses);
671 Create(const ASTContext &C, SourceLocation Start, SourceLocation DirectiveLoc,
673};
674
675} // namespace clang
676#endif // LLVM_CLANG_AST_STMTOPENACC_H
enum clang::sema::@1718::IndirectLocalPathEntry::EntryKind Kind
Defines some OpenACC-specific enums and functions.
SourceRange Range
Definition: SemaObjC.cpp:758
Defines the clang::SourceLocation class and associated facilities.
SourceLocation Begin
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:188
This represents one expression.
Definition: Expr.h:110
This is a base class for any OpenACC statement-level constructs that have an associated statement.
Definition: StmtOpenACC.h:80
const_child_range children() const
Definition: StmtOpenACC.h:112
const Stmt * getAssociatedStmt() const
Definition: StmtOpenACC.h:96
OpenACCAssociatedStmtConstruct(StmtClass SC, OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End, Stmt *AssocStmt)
Definition: StmtOpenACC.h:87
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:102
This is the base type for all OpenACC Clauses.
Definition: OpenACCClause.h:24
static OpenACCCombinedConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Definition: StmtOpenACC.cpp:93
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:283
const Stmt * getLoop() const
Definition: StmtOpenACC.h:294
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
Definition: StmtOpenACC.h:131
static OpenACCComputeConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Definition: StmtOpenACC.cpp:19
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:172
const Stmt * getStructuredBlock() const
Definition: StmtOpenACC.h:184
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition: StmtOpenACC.h:25
SourceLocation getEndLoc() const
Definition: StmtOpenACC.h:64
SourceLocation getBeginLoc() const
Definition: StmtOpenACC.h:63
OpenACCDirectiveKind getDirectiveKind() const
Definition: StmtOpenACC.h:56
void setClauseList(MutableArrayRef< const OpenACCClause * > NewClauses)
Definition: StmtOpenACC.h:50
ArrayRef< const OpenACCClause * > clauses() const
Definition: StmtOpenACC.h:66
const_child_range children() const
Definition: StmtOpenACC.h:72
SourceLocation getDirectiveLoc() const
Definition: StmtOpenACC.h:65
static bool classof(const Stmt *S)
Definition: StmtOpenACC.h:58
OpenACCConstructStmt(StmtClass SC, OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End)
Definition: StmtOpenACC.h:43
const Stmt * getStructuredBlock() const
Definition: StmtOpenACC.h:345
static OpenACCDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:333
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:378
static OpenACCEnterDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:416
static OpenACCExitDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static OpenACCHostDataConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:458
const Stmt * getStructuredBlock() const
Definition: StmtOpenACC.h:468
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:625
static OpenACCInitConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
This class represents a 'loop' construct.
Definition: StmtOpenACC.h:194
static OpenACCLoopConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Definition: StmtOpenACC.cpp:71
OpenACCDirectiveKind getParentComputeConstructKind() const
Definition: StmtOpenACC.h:241
const Stmt * getLoop() const
Definition: StmtOpenACC.h:228
bool isOrphanedLoopConstruct() const
OpenACC 3.3 2.9: An orphaned loop construct is a loop construct that is not lexically enclosed within...
Definition: StmtOpenACC.h:237
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:215
static OpenACCShutdownConstruct * CreateEmpty(const ASTContext &C, unsigned NumClauses)
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:665
llvm::ArrayRef< Expr * > getQueueIdExprs()
Definition: StmtOpenACC.h:579
static bool classof(const Stmt *T)
Definition: StmtOpenACC.h:559
SourceLocation getRParenLoc() const
Definition: StmtOpenACC.h:573
static OpenACCWaitConstruct * CreateEmpty(const ASTContext &C, unsigned NumExprs, unsigned NumClauses)
llvm::ArrayRef< Expr * > getQueueIdExprs() const
Definition: StmtOpenACC.h:580
SourceLocation getQueuesLoc() const
Definition: StmtOpenACC.h:575
const_child_range children() const
Definition: StmtOpenACC.h:589
SourceLocation getLParenLoc() const
Definition: StmtOpenACC.h:572
Expr * getDevNumExpr() const
Definition: StmtOpenACC.h:578
A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each...
Encodes a location in the source.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
Definition: Stmt.h:84
StmtClass
Definition: Stmt.h:86
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
Definition: Stmt.h:1466
llvm::iterator_range< child_iterator > child_range
Definition: Stmt.h:1469
llvm::iterator_range< const_child_iterator > const_child_range
Definition: Stmt.h:1470
The JSON file list parser is used to communicate input to InstallAPI.
OpenACCDirectiveKind
Definition: OpenACCKinds.h:25
bool isOpenACCComputeDirectiveKind(OpenACCDirectiveKind K)
Definition: OpenACCKinds.h:149
bool isOpenACCCombinedDirectiveKind(OpenACCDirectiveKind K)
Definition: OpenACCKinds.h:155
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
const FunctionProtoType * T