/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/include/clang/AST/OpenMPClause.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===- OpenMPClause.h - Classes for OpenMP clauses --------------*- 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 | | // |
9 | | /// \file |
10 | | /// This file defines OpenMP AST classes for clauses. |
11 | | /// There are clauses for executable directives, clauses for declarative |
12 | | /// directives and clauses which can be used in both kinds of directives. |
13 | | // |
14 | | //===----------------------------------------------------------------------===// |
15 | | |
16 | | #ifndef LLVM_CLANG_AST_OPENMPCLAUSE_H |
17 | | #define LLVM_CLANG_AST_OPENMPCLAUSE_H |
18 | | |
19 | | #include "clang/AST/ASTFwd.h" |
20 | | #include "clang/AST/Decl.h" |
21 | | #include "clang/AST/DeclarationName.h" |
22 | | #include "clang/AST/Expr.h" |
23 | | #include "clang/AST/NestedNameSpecifier.h" |
24 | | #include "clang/AST/Stmt.h" |
25 | | #include "clang/AST/StmtIterator.h" |
26 | | #include "clang/Basic/LLVM.h" |
27 | | #include "clang/Basic/OpenMPKinds.h" |
28 | | #include "clang/Basic/SourceLocation.h" |
29 | | #include "llvm/ADT/ArrayRef.h" |
30 | | #include "llvm/ADT/MapVector.h" |
31 | | #include "llvm/ADT/PointerIntPair.h" |
32 | | #include "llvm/ADT/SmallVector.h" |
33 | | #include "llvm/ADT/iterator.h" |
34 | | #include "llvm/ADT/iterator_range.h" |
35 | | #include "llvm/Frontend/OpenMP/OMPAssume.h" |
36 | | #include "llvm/Frontend/OpenMP/OMPConstants.h" |
37 | | #include "llvm/Frontend/OpenMP/OMPContext.h" |
38 | | #include "llvm/Support/Casting.h" |
39 | | #include "llvm/Support/Compiler.h" |
40 | | #include "llvm/Support/TrailingObjects.h" |
41 | | #include <cassert> |
42 | | #include <cstddef> |
43 | | #include <iterator> |
44 | | #include <utility> |
45 | | |
46 | | namespace clang { |
47 | | |
48 | | class ASTContext; |
49 | | |
50 | | //===----------------------------------------------------------------------===// |
51 | | // AST classes for clauses. |
52 | | //===----------------------------------------------------------------------===// |
53 | | |
54 | | /// This is a basic class for representing single OpenMP clause. |
55 | | class OMPClause { |
56 | | /// Starting location of the clause (the clause keyword). |
57 | | SourceLocation StartLoc; |
58 | | |
59 | | /// Ending location of the clause. |
60 | | SourceLocation EndLoc; |
61 | | |
62 | | /// Kind of the clause. |
63 | | OpenMPClauseKind Kind; |
64 | | |
65 | | protected: |
66 | | OMPClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc) |
67 | 291k | : StartLoc(StartLoc), EndLoc(EndLoc), Kind(K) {} |
68 | | |
69 | | public: |
70 | | /// Returns the starting location of the clause. |
71 | 134k | SourceLocation getBeginLoc() const { return StartLoc; } |
72 | | |
73 | | /// Returns the ending location of the clause. |
74 | 104k | SourceLocation getEndLoc() const { return EndLoc; } |
75 | | |
76 | | /// Sets the starting location of the clause. |
77 | 35.8k | void setLocStart(SourceLocation Loc) { StartLoc = Loc; } |
78 | | |
79 | | /// Sets the ending location of the clause. |
80 | 35.8k | void setLocEnd(SourceLocation Loc) { EndLoc = Loc; } |
81 | | |
82 | | /// Returns kind of OpenMP clause (private, shared, reduction, etc.). |
83 | 6.77M | OpenMPClauseKind getClauseKind() const { return Kind; } |
84 | | |
85 | 60.2k | bool isImplicit() const { return StartLoc.isInvalid(); } |
86 | | |
87 | | using child_iterator = StmtIterator; |
88 | | using const_child_iterator = ConstStmtIterator; |
89 | | using child_range = llvm::iterator_range<child_iterator>; |
90 | | using const_child_range = llvm::iterator_range<const_child_iterator>; |
91 | | |
92 | | child_range children(); |
93 | 422 | const_child_range children() const { |
94 | 422 | auto Children = const_cast<OMPClause *>(this)->children(); |
95 | 422 | return const_child_range(Children.begin(), Children.end()); |
96 | 422 | } |
97 | | |
98 | | /// Get the iterator range for the expressions used in the clauses. Used |
99 | | /// expressions include only the children that must be evaluated at the |
100 | | /// runtime before entering the construct. |
101 | | child_range used_children(); |
102 | 0 | const_child_range used_children() const { |
103 | 0 | auto Children = const_cast<OMPClause *>(this)->children(); |
104 | 0 | return const_child_range(Children.begin(), Children.end()); |
105 | 0 | } |
106 | | |
107 | 0 | static bool classof(const OMPClause *) { return true; } |
108 | | }; |
109 | | |
110 | | /// Class that handles pre-initialization statement for some clauses, like |
111 | | /// 'shedule', 'firstprivate' etc. |
112 | | class OMPClauseWithPreInit { |
113 | | friend class OMPClauseReader; |
114 | | |
115 | | /// Pre-initialization statement for the clause. |
116 | | Stmt *PreInit = nullptr; |
117 | | |
118 | | /// Region that captures the associated stmt. |
119 | | OpenMPDirectiveKind CaptureRegion = llvm::omp::OMPD_unknown; |
120 | | |
121 | | protected: |
122 | 137k | OMPClauseWithPreInit(const OMPClause *This) { |
123 | 137k | assert(get(This) && "get is not tuned for pre-init."); |
124 | 137k | } |
125 | | |
126 | | /// Set pre-initialization statement for the clause. |
127 | | void |
128 | | setPreInitStmt(Stmt *S, |
129 | 137k | OpenMPDirectiveKind ThisRegion = llvm::omp::OMPD_unknown) { |
130 | 137k | PreInit = S; |
131 | 137k | CaptureRegion = ThisRegion; |
132 | 137k | } |
133 | | |
134 | | public: |
135 | | /// Get pre-initialization statement for the clause. |
136 | 72.7k | const Stmt *getPreInitStmt() const { return PreInit; } |
137 | | |
138 | | /// Get pre-initialization statement for the clause. |
139 | 26.6k | Stmt *getPreInitStmt() { return PreInit; } |
140 | | |
141 | | /// Get capture region for the stmt in the clause. |
142 | 67.1k | OpenMPDirectiveKind getCaptureRegion() const { return CaptureRegion; } |
143 | | |
144 | | static OMPClauseWithPreInit *get(OMPClause *C); |
145 | | static const OMPClauseWithPreInit *get(const OMPClause *C); |
146 | | }; |
147 | | |
148 | | /// Class that handles post-update expression for some clauses, like |
149 | | /// 'lastprivate', 'reduction' etc. |
150 | | class OMPClauseWithPostUpdate : public OMPClauseWithPreInit { |
151 | | friend class OMPClauseReader; |
152 | | |
153 | | /// Post-update expression for the clause. |
154 | | Expr *PostUpdate = nullptr; |
155 | | |
156 | | protected: |
157 | 44.5k | OMPClauseWithPostUpdate(const OMPClause *This) : OMPClauseWithPreInit(This) { |
158 | 44.5k | assert(get(This) && "get is not tuned for post-update."); |
159 | 44.5k | } |
160 | | |
161 | | /// Set pre-initialization statement for the clause. |
162 | 44.5k | void setPostUpdateExpr(Expr *S) { PostUpdate = S; } |
163 | | |
164 | | public: |
165 | | /// Get post-update expression for the clause. |
166 | 2.92k | const Expr *getPostUpdateExpr() const { return PostUpdate; } |
167 | | |
168 | | /// Get post-update expression for the clause. |
169 | 2.12k | Expr *getPostUpdateExpr() { return PostUpdate; } |
170 | | |
171 | | static OMPClauseWithPostUpdate *get(OMPClause *C); |
172 | | static const OMPClauseWithPostUpdate *get(const OMPClause *C); |
173 | | }; |
174 | | |
175 | | /// This structure contains most locations needed for by an OMPVarListClause. |
176 | | struct OMPVarListLocTy { |
177 | | /// Starting location of the clause (the clause keyword). |
178 | | SourceLocation StartLoc; |
179 | | /// Location of '('. |
180 | | SourceLocation LParenLoc; |
181 | | /// Ending location of the clause. |
182 | | SourceLocation EndLoc; |
183 | 15.9k | OMPVarListLocTy() = default; |
184 | | OMPVarListLocTy(SourceLocation StartLoc, SourceLocation LParenLoc, |
185 | | SourceLocation EndLoc) |
186 | 116k | : StartLoc(StartLoc), LParenLoc(LParenLoc), EndLoc(EndLoc) {} |
187 | | }; |
188 | | |
189 | | /// This represents clauses with the list of variables like 'private', |
190 | | /// 'firstprivate', 'copyin', 'shared', or 'reduction' clauses in the |
191 | | /// '#pragma omp ...' directives. |
192 | | template <class T> class OMPVarListClause : public OMPClause { |
193 | | friend class OMPClauseReader; |
194 | | |
195 | | /// Location of '('. |
196 | | SourceLocation LParenLoc; |
197 | | |
198 | | /// Number of variables in the list. |
199 | | unsigned NumVars; |
200 | | |
201 | | protected: |
202 | | /// Build a clause with \a N variables |
203 | | /// |
204 | | /// \param K Kind of the clause. |
205 | | /// \param StartLoc Starting location of the clause (the clause keyword). |
206 | | /// \param LParenLoc Location of '('. |
207 | | /// \param EndLoc Ending location of the clause. |
208 | | /// \param N Number of the variables in the clause. |
209 | | OMPVarListClause(OpenMPClauseKind K, SourceLocation StartLoc, |
210 | | SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) |
211 | 192k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} clang::OMPVarListClause<clang::OMPPrivateClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 16.0k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPFirstprivateClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 58.3k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPLastprivateClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 6.99k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPSharedClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 5.00k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPLinearClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 3.23k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPAlignedClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 2.10k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPCopyinClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 532 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 181 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPReductionClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 28.8k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 3.17k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPInReductionClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 2.24k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPAllocateClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 2.43k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPFlushClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 96 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPDependClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 4.63k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPMapClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 48.5k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPToClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 3.14k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPFromClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 1.52k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 502 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 130 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 3.44k | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 338 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPNontemporalClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 552 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPInclusiveClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 116 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPExclusiveClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 82 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPAffinityClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 72 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
clang::OMPVarListClause<clang::OMPInitClause>::OMPVarListClause(llvm::omp::Clause, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation, unsigned int) Line | Count | Source | 211 | 113 | : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} |
|
212 | | |
213 | | /// Fetches list of variables associated with this clause. |
214 | 1.34M | MutableArrayRef<Expr *> getVarRefs() { |
215 | 1.34M | return MutableArrayRef<Expr *>( |
216 | 1.34M | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); |
217 | 1.34M | } clang::OMPVarListClause<clang::OMPAffinityClause>::getVarRefs() Line | Count | Source | 214 | 208 | MutableArrayRef<Expr *> getVarRefs() { | 215 | 208 | return MutableArrayRef<Expr *>( | 216 | 208 | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 208 | } |
clang::OMPVarListClause<clang::OMPAlignedClause>::getVarRefs() Line | Count | Source | 214 | 8.85k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 8.85k | return MutableArrayRef<Expr *>( | 216 | 8.85k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 8.85k | } |
clang::OMPVarListClause<clang::OMPAllocateClause>::getVarRefs() Line | Count | Source | 214 | 9.86k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 9.86k | return MutableArrayRef<Expr *>( | 216 | 9.86k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 9.86k | } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::getVarRefs() Line | Count | Source | 214 | 1.41k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 1.41k | return MutableArrayRef<Expr *>( | 216 | 1.41k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 1.41k | } |
clang::OMPVarListClause<clang::OMPCopyinClause>::getVarRefs() Line | Count | Source | 214 | 3.91k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 3.91k | return MutableArrayRef<Expr *>( | 216 | 3.91k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 3.91k | } |
clang::OMPVarListClause<clang::OMPDependClause>::getVarRefs() Line | Count | Source | 214 | 16.9k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 16.9k | return MutableArrayRef<Expr *>( | 216 | 16.9k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 16.9k | } |
clang::OMPVarListClause<clang::OMPExclusiveClause>::getVarRefs() Line | Count | Source | 214 | 132 | MutableArrayRef<Expr *> getVarRefs() { | 215 | 132 | return MutableArrayRef<Expr *>( | 216 | 132 | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 132 | } |
clang::OMPVarListClause<clang::OMPFirstprivateClause>::getVarRefs() Line | Count | Source | 214 | 425k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 425k | return MutableArrayRef<Expr *>( | 216 | 425k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 425k | } |
clang::OMPVarListClause<clang::OMPFlushClause>::getVarRefs() Line | Count | Source | 214 | 128 | MutableArrayRef<Expr *> getVarRefs() { | 215 | 128 | return MutableArrayRef<Expr *>( | 216 | 128 | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 128 | } |
clang::OMPVarListClause<clang::OMPFromClause>::getVarRefs() Line | Count | Source | 214 | 2.49k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 2.49k | return MutableArrayRef<Expr *>( | 216 | 2.49k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 2.49k | } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::getVarRefs() Line | Count | Source | 214 | 769 | MutableArrayRef<Expr *> getVarRefs() { | 215 | 769 | return MutableArrayRef<Expr *>( | 216 | 769 | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 769 | } |
clang::OMPVarListClause<clang::OMPInReductionClause>::getVarRefs() Line | Count | Source | 214 | 35.3k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 35.3k | return MutableArrayRef<Expr *>( | 216 | 35.3k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 35.3k | } |
clang::OMPVarListClause<clang::OMPInclusiveClause>::getVarRefs() Line | Count | Source | 214 | 172 | MutableArrayRef<Expr *> getVarRefs() { | 215 | 172 | return MutableArrayRef<Expr *>( | 216 | 172 | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 172 | } |
clang::OMPVarListClause<clang::OMPInitClause>::getVarRefs() Line | Count | Source | 214 | 293 | MutableArrayRef<Expr *> getVarRefs() { | 215 | 293 | return MutableArrayRef<Expr *>( | 216 | 293 | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 293 | } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::getVarRefs() Line | Count | Source | 214 | 6.65k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 6.65k | return MutableArrayRef<Expr *>( | 216 | 6.65k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 6.65k | } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::getVarRefs() Line | Count | Source | 214 | 90.2k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 90.2k | return MutableArrayRef<Expr *>( | 216 | 90.2k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 90.2k | } |
clang::OMPVarListClause<clang::OMPLinearClause>::getVarRefs() Line | Count | Source | 214 | 85.1k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 85.1k | return MutableArrayRef<Expr *>( | 216 | 85.1k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 85.1k | } |
clang::OMPVarListClause<clang::OMPMapClause>::getVarRefs() Line | Count | Source | 214 | 131k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 131k | return MutableArrayRef<Expr *>( | 216 | 131k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 131k | } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::getVarRefs() Line | Count | Source | 214 | 2.95k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 2.95k | return MutableArrayRef<Expr *>( | 216 | 2.95k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 2.95k | } |
clang::OMPVarListClause<clang::OMPPrivateClause>::getVarRefs() Line | Count | Source | 214 | 107k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 107k | return MutableArrayRef<Expr *>( | 216 | 107k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 107k | } |
clang::OMPVarListClause<clang::OMPReductionClause>::getVarRefs() Line | Count | Source | 214 | 360k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 360k | return MutableArrayRef<Expr *>( | 216 | 360k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 360k | } |
clang::OMPVarListClause<clang::OMPSharedClause>::getVarRefs() Line | Count | Source | 214 | 8.94k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 8.94k | return MutableArrayRef<Expr *>( | 216 | 8.94k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 8.94k | } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::getVarRefs() Line | Count | Source | 214 | 35.3k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 35.3k | return MutableArrayRef<Expr *>( | 216 | 35.3k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 35.3k | } |
clang::OMPVarListClause<clang::OMPToClause>::getVarRefs() Line | Count | Source | 214 | 3.68k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 3.68k | return MutableArrayRef<Expr *>( | 216 | 3.68k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 3.68k | } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::getVarRefs() Line | Count | Source | 214 | 140 | MutableArrayRef<Expr *> getVarRefs() { | 215 | 140 | return MutableArrayRef<Expr *>( | 216 | 140 | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 140 | } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::getVarRefs() Line | Count | Source | 214 | 2.05k | MutableArrayRef<Expr *> getVarRefs() { | 215 | 2.05k | return MutableArrayRef<Expr *>( | 216 | 2.05k | static_cast<T *>(this)->template getTrailingObjects<Expr *>(), NumVars); | 217 | 2.05k | } |
|
218 | | |
219 | | /// Sets the list of variables for this clause. |
220 | 192k | void setVarRefs(ArrayRef<Expr *> VL) { |
221 | 192k | assert(VL.size() == NumVars && |
222 | 192k | "Number of variables is not the same as the preallocated buffer"); |
223 | 0 | std::copy(VL.begin(), VL.end(), |
224 | 192k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); |
225 | 192k | } clang::OMPVarListClause<clang::OMPInitClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 26 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 26 | assert(VL.size() == NumVars && | 222 | 26 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 26 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 26 | } |
clang::OMPVarListClause<clang::OMPPrivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 16.0k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 16.0k | assert(VL.size() == NumVars && | 222 | 16.0k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 16.0k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 16.0k | } |
clang::OMPVarListClause<clang::OMPFirstprivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 58.3k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 58.3k | assert(VL.size() == NumVars && | 222 | 58.3k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 58.3k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 58.3k | } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 6.99k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 6.99k | assert(VL.size() == NumVars && | 222 | 6.99k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 6.99k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 6.99k | } |
clang::OMPVarListClause<clang::OMPSharedClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 5.00k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 5.00k | assert(VL.size() == NumVars && | 222 | 5.00k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 5.00k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 5.00k | } |
clang::OMPVarListClause<clang::OMPReductionClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 28.8k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 28.8k | assert(VL.size() == NumVars && | 222 | 28.8k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 28.8k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 28.8k | } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 3.17k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 3.17k | assert(VL.size() == NumVars && | 222 | 3.17k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 3.17k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 3.17k | } |
clang::OMPVarListClause<clang::OMPInReductionClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 2.24k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 2.24k | assert(VL.size() == NumVars && | 222 | 2.24k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 2.24k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 2.24k | } |
clang::OMPVarListClause<clang::OMPLinearClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 3.23k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 3.23k | assert(VL.size() == NumVars && | 222 | 3.23k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 3.23k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 3.23k | } |
clang::OMPVarListClause<clang::OMPAlignedClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 2.10k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 2.10k | assert(VL.size() == NumVars && | 222 | 2.10k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 2.10k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 2.10k | } |
clang::OMPVarListClause<clang::OMPCopyinClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 532 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 532 | assert(VL.size() == NumVars && | 222 | 532 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 532 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 532 | } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 181 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 181 | assert(VL.size() == NumVars && | 222 | 181 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 181 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 181 | } |
clang::OMPVarListClause<clang::OMPFlushClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 96 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 96 | assert(VL.size() == NumVars && | 222 | 96 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 96 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 96 | } |
clang::OMPVarListClause<clang::OMPDependClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 4.63k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 4.63k | assert(VL.size() == NumVars && | 222 | 4.63k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 4.63k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 4.63k | } |
clang::OMPVarListClause<clang::OMPMapClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 48.5k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 48.5k | assert(VL.size() == NumVars && | 222 | 48.5k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 48.5k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 48.5k | } |
clang::OMPVarListClause<clang::OMPAllocateClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 2.43k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 2.43k | assert(VL.size() == NumVars && | 222 | 2.43k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 2.43k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 2.43k | } |
clang::OMPVarListClause<clang::OMPToClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 3.14k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 3.14k | assert(VL.size() == NumVars && | 222 | 3.14k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 3.14k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 3.14k | } |
clang::OMPVarListClause<clang::OMPFromClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 1.52k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 1.52k | assert(VL.size() == NumVars && | 222 | 1.52k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 1.52k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 1.52k | } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 502 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 502 | assert(VL.size() == NumVars && | 222 | 502 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 502 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 502 | } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 130 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 130 | assert(VL.size() == NumVars && | 222 | 130 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 130 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 130 | } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 3.44k | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 3.44k | assert(VL.size() == NumVars && | 222 | 3.44k | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 3.44k | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 3.44k | } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 338 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 338 | assert(VL.size() == NumVars && | 222 | 338 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 338 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 338 | } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 552 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 552 | assert(VL.size() == NumVars && | 222 | 552 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 552 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 552 | } |
clang::OMPVarListClause<clang::OMPInclusiveClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 116 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 116 | assert(VL.size() == NumVars && | 222 | 116 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 116 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 116 | } |
clang::OMPVarListClause<clang::OMPExclusiveClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 82 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 82 | assert(VL.size() == NumVars && | 222 | 82 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 82 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 82 | } |
clang::OMPVarListClause<clang::OMPAffinityClause>::setVarRefs(llvm::ArrayRef<clang::Expr*>) Line | Count | Source | 220 | 72 | void setVarRefs(ArrayRef<Expr *> VL) { | 221 | 72 | assert(VL.size() == NumVars && | 222 | 72 | "Number of variables is not the same as the preallocated buffer"); | 223 | 0 | std::copy(VL.begin(), VL.end(), | 224 | 72 | static_cast<T *>(this)->template getTrailingObjects<Expr *>()); | 225 | 72 | } |
|
226 | | |
227 | | public: |
228 | | using varlist_iterator = MutableArrayRef<Expr *>::iterator; |
229 | | using varlist_const_iterator = ArrayRef<const Expr *>::iterator; |
230 | | using varlist_range = llvm::iterator_range<varlist_iterator>; |
231 | | using varlist_const_range = llvm::iterator_range<varlist_const_iterator>; |
232 | | |
233 | 2.24M | unsigned varlist_size() const { return NumVars; } clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_size() const Line | Count | Source | 233 | 206 | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_size() const Line | Count | Source | 233 | 2.17k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_size() const Line | Count | Source | 233 | 5.39k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_size() const Line | Count | Source | 233 | 426k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_size() const Line | Count | Source | 233 | 77.9k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_size() const Line | Count | Source | 233 | 109k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_size() const Line | Count | Source | 233 | 231k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_size() const Line | Count | Source | 233 | 1.32k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_size() const Line | Count | Source | 233 | 49.0k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_size() const Line | Count | Source | 233 | 602k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_size() const Line | Count | Source | 233 | 56.4k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPMapClause>::varlist_size() const Line | Count | Source | 233 | 598k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPToClause>::varlist_size() const Line | Count | Source | 233 | 32.2k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPFromClause>::varlist_size() const Line | Count | Source | 233 | 17.1k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_size() const Line | Count | Source | 233 | 5.65k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_size() const Line | Count | Source | 233 | 650 | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_size() const Line | Count | Source | 233 | 18.1k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::varlist_size() const Line | Count | Source | 233 | 1.72k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPInitClause>::varlist_size() const Line | Count | Source | 233 | 49 | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_size() const Line | Count | Source | 233 | 2.59k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_size() const Line | Count | Source | 233 | 1.05k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_size() const Line | Count | Source | 233 | 50 | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPDependClause>::varlist_size() const Line | Count | Source | 233 | 2.34k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_size() const Line | Count | Source | 233 | 1.66k | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_size() const Line | Count | Source | 233 | 34 | unsigned varlist_size() const { return NumVars; } |
clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_size() const Line | Count | Source | 233 | 26 | unsigned varlist_size() const { return NumVars; } |
|
234 | 17.4k | bool varlist_empty() const { return NumVars == 0; } clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_empty() const Line | Count | Source | 234 | 1.01k | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_empty() const Line | Count | Source | 234 | 2.97k | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_empty() const Line | Count | Source | 234 | 1.37k | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_empty() const Line | Count | Source | 234 | 626 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_empty() const Line | Count | Source | 234 | 1.03k | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_empty() const Line | Count | Source | 234 | 1.97k | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_empty() const Line | Count | Source | 234 | 312 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_empty() const Line | Count | Source | 234 | 176 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_empty() const Line | Count | Source | 234 | 459 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_empty() const Line | Count | Source | 234 | 448 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_empty() const Line | Count | Source | 234 | 196 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_empty() const Line | Count | Source | 234 | 32 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_empty() const Line | Count | Source | 234 | 16 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPDependClause>::varlist_empty() const Line | Count | Source | 234 | 861 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPMapClause>::varlist_empty() const Line | Count | Source | 234 | 3.71k | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPToClause>::varlist_empty() const Line | Count | Source | 234 | 353 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPFromClause>::varlist_empty() const Line | Count | Source | 234 | 352 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_empty() const Line | Count | Source | 234 | 40 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_empty() const Line | Count | Source | 234 | 16 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_empty() const Line | Count | Source | 234 | 1.17k | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::varlist_empty() const Line | Count | Source | 234 | 157 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_empty() const Line | Count | Source | 234 | 84 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_empty() const Line | Count | Source | 234 | 12 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_empty() const Line | Count | Source | 234 | 4 | bool varlist_empty() const { return NumVars == 0; } |
clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_empty() const Line | Count | Source | 234 | 20 | bool varlist_empty() const { return NumVars == 0; } |
|
235 | | |
236 | 80.5k | varlist_range varlists() { |
237 | 80.5k | return varlist_range(varlist_begin(), varlist_end()); |
238 | 80.5k | } clang::OMPVarListClause<clang::OMPAffinityClause>::varlists() Line | Count | Source | 236 | 22 | varlist_range varlists() { | 237 | 22 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 22 | } |
clang::OMPVarListClause<clang::OMPAlignedClause>::varlists() Line | Count | Source | 236 | 1.45k | varlist_range varlists() { | 237 | 1.45k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 1.45k | } |
clang::OMPVarListClause<clang::OMPAllocateClause>::varlists() Line | Count | Source | 236 | 2.78k | varlist_range varlists() { | 237 | 2.78k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 2.78k | } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlists() Line | Count | Source | 236 | 85 | varlist_range varlists() { | 237 | 85 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 85 | } |
clang::OMPVarListClause<clang::OMPCopyinClause>::varlists() Line | Count | Source | 236 | 222 | varlist_range varlists() { | 237 | 222 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 222 | } |
clang::OMPVarListClause<clang::OMPDependClause>::varlists() Line | Count | Source | 236 | 1.59k | varlist_range varlists() { | 237 | 1.59k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 1.59k | } |
clang::OMPVarListClause<clang::OMPExclusiveClause>::varlists() Line | Count | Source | 236 | 14 | varlist_range varlists() { | 237 | 14 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 14 | } |
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlists() Line | Count | Source | 236 | 6.60k | varlist_range varlists() { | 237 | 6.60k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 6.60k | } |
clang::OMPVarListClause<clang::OMPFlushClause>::varlists() Line | Count | Source | 236 | 40 | varlist_range varlists() { | 237 | 40 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 40 | } |
clang::OMPVarListClause<clang::OMPFromClause>::varlists() Line | Count | Source | 236 | 682 | varlist_range varlists() { | 237 | 682 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 682 | } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::varlists() Line | Count | Source | 236 | 149 | varlist_range varlists() { | 237 | 149 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 149 | } |
clang::OMPVarListClause<clang::OMPInReductionClause>::varlists() Line | Count | Source | 236 | 1.67k | varlist_range varlists() { | 237 | 1.67k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 1.67k | } |
clang::OMPVarListClause<clang::OMPInclusiveClause>::varlists() Line | Count | Source | 236 | 22 | varlist_range varlists() { | 237 | 22 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 22 | } |
clang::OMPVarListClause<clang::OMPInitClause>::varlists() Line | Count | Source | 236 | 23 | varlist_range varlists() { | 237 | 23 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 23 | } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlists() Line | Count | Source | 236 | 1.54k | varlist_range varlists() { | 237 | 1.54k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 1.54k | } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlists() Line | Count | Source | 236 | 8.64k | varlist_range varlists() { | 237 | 8.64k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 8.64k | } |
clang::OMPVarListClause<clang::OMPLinearClause>::varlists() Line | Count | Source | 236 | 3.16k | varlist_range varlists() { | 237 | 3.16k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 3.16k | } |
clang::OMPVarListClause<clang::OMPMapClause>::varlists() Line | Count | Source | 236 | 16.5k | varlist_range varlists() { | 237 | 16.5k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 16.5k | } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlists() Line | Count | Source | 236 | 564 | varlist_range varlists() { | 237 | 564 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 564 | } |
clang::OMPVarListClause<clang::OMPPrivateClause>::varlists() Line | Count | Source | 236 | 6.67k | varlist_range varlists() { | 237 | 6.67k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 6.67k | } |
clang::OMPVarListClause<clang::OMPReductionClause>::varlists() Line | Count | Source | 236 | 22.7k | varlist_range varlists() { | 237 | 22.7k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 22.7k | } |
clang::OMPVarListClause<clang::OMPSharedClause>::varlists() Line | Count | Source | 236 | 2.11k | varlist_range varlists() { | 237 | 2.11k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 2.11k | } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlists() Line | Count | Source | 236 | 1.78k | varlist_range varlists() { | 237 | 1.78k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 1.78k | } |
clang::OMPVarListClause<clang::OMPToClause>::varlists() Line | Count | Source | 236 | 1.13k | varlist_range varlists() { | 237 | 1.13k | return varlist_range(varlist_begin(), varlist_end()); | 238 | 1.13k | } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlists() Line | Count | Source | 236 | 36 | varlist_range varlists() { | 237 | 36 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 36 | } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlists() Line | Count | Source | 236 | 286 | varlist_range varlists() { | 237 | 286 | return varlist_range(varlist_begin(), varlist_end()); | 238 | 286 | } |
|
239 | 32.9k | varlist_const_range varlists() const { |
240 | 32.9k | return varlist_const_range(varlist_begin(), varlist_end()); |
241 | 32.9k | } clang::OMPVarListClause<clang::OMPAffinityClause>::varlists() const Line | Count | Source | 239 | 14 | varlist_const_range varlists() const { | 240 | 14 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 14 | } |
clang::OMPVarListClause<clang::OMPAlignedClause>::varlists() const Line | Count | Source | 239 | 452 | varlist_const_range varlists() const { | 240 | 452 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 452 | } |
clang::OMPVarListClause<clang::OMPAllocateClause>::varlists() const Line | Count | Source | 239 | 179 | varlist_const_range varlists() const { | 240 | 179 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 179 | } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlists() const Line | Count | Source | 239 | 59 | varlist_const_range varlists() const { | 240 | 59 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 59 | } |
clang::OMPVarListClause<clang::OMPCopyinClause>::varlists() const Line | Count | Source | 239 | 46 | varlist_const_range varlists() const { | 240 | 46 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 46 | } |
clang::OMPVarListClause<clang::OMPDependClause>::varlists() const Line | Count | Source | 239 | 694 | varlist_const_range varlists() const { | 240 | 694 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 694 | } |
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPExclusiveClause>::varlists() const clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlists() const Line | Count | Source | 239 | 18.8k | varlist_const_range varlists() const { | 240 | 18.8k | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 18.8k | } |
clang::OMPVarListClause<clang::OMPFlushClause>::varlists() const Line | Count | Source | 239 | 10 | varlist_const_range varlists() const { | 240 | 10 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 10 | } |
clang::OMPVarListClause<clang::OMPFromClause>::varlists() const Line | Count | Source | 239 | 196 | varlist_const_range varlists() const { | 240 | 196 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 196 | } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::varlists() const Line | Count | Source | 239 | 46 | varlist_const_range varlists() const { | 240 | 46 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 46 | } |
clang::OMPVarListClause<clang::OMPInReductionClause>::varlists() const Line | Count | Source | 239 | 50 | varlist_const_range varlists() const { | 240 | 50 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 50 | } |
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPInclusiveClause>::varlists() const clang::OMPVarListClause<clang::OMPInitClause>::varlists() const Line | Count | Source | 239 | 13 | varlist_const_range varlists() const { | 240 | 13 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 13 | } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlists() const Line | Count | Source | 239 | 441 | varlist_const_range varlists() const { | 240 | 441 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 441 | } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlists() const Line | Count | Source | 239 | 1.26k | varlist_const_range varlists() const { | 240 | 1.26k | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 1.26k | } |
clang::OMPVarListClause<clang::OMPLinearClause>::varlists() const Line | Count | Source | 239 | 1.38k | varlist_const_range varlists() const { | 240 | 1.38k | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 1.38k | } |
clang::OMPVarListClause<clang::OMPMapClause>::varlists() const Line | Count | Source | 239 | 4.08k | varlist_const_range varlists() const { | 240 | 4.08k | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 4.08k | } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlists() const Line | Count | Source | 239 | 46 | varlist_const_range varlists() const { | 240 | 46 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 46 | } |
clang::OMPVarListClause<clang::OMPPrivateClause>::varlists() const Line | Count | Source | 239 | 2.21k | varlist_const_range varlists() const { | 240 | 2.21k | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 2.21k | } |
clang::OMPVarListClause<clang::OMPReductionClause>::varlists() const Line | Count | Source | 239 | 2.18k | varlist_const_range varlists() const { | 240 | 2.18k | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 2.18k | } |
clang::OMPVarListClause<clang::OMPSharedClause>::varlists() const Line | Count | Source | 239 | 263 | varlist_const_range varlists() const { | 240 | 263 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 263 | } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlists() const Line | Count | Source | 239 | 99 | varlist_const_range varlists() const { | 240 | 99 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 99 | } |
clang::OMPVarListClause<clang::OMPToClause>::varlists() const Line | Count | Source | 239 | 216 | varlist_const_range varlists() const { | 240 | 216 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 216 | } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlists() const Line | Count | Source | 239 | 24 | varlist_const_range varlists() const { | 240 | 24 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 24 | } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlists() const Line | Count | Source | 239 | 168 | varlist_const_range varlists() const { | 240 | 168 | return varlist_const_range(varlist_begin(), varlist_end()); | 241 | 168 | } |
|
242 | | |
243 | 362k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_begin() Line | Count | Source | 243 | 136 | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_begin() Line | Count | Source | 243 | 2.82k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_begin() Line | Count | Source | 243 | 5.43k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_begin() Line | Count | Source | 243 | 385 | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_begin() Line | Count | Source | 243 | 1.02k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPDependClause>::varlist_begin() Line | Count | Source | 243 | 5.04k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_begin() Line | Count | Source | 243 | 70 | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_begin() Line | Count | Source | 243 | 95.4k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_begin() Line | Count | Source | 243 | 72 | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPFromClause>::varlist_begin() Line | Count | Source | 243 | 1.44k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::varlist_begin() Line | Count | Source | 243 | 463 | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_begin() Line | Count | Source | 243 | 6.51k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_begin() Line | Count | Source | 243 | 92 | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPInitClause>::varlist_begin() Line | Count | Source | 243 | 210 | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_begin() Line | Count | Source | 243 | 3.91k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_begin() Line | Count | Source | 243 | 24.8k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_begin() Line | Count | Source | 243 | 9.32k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPMapClause>::varlist_begin() Line | Count | Source | 243 | 67.9k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_begin() Line | Count | Source | 243 | 1.04k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_begin() Line | Count | Source | 243 | 37.0k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_begin() Line | Count | Source | 243 | 84.3k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_begin() Line | Count | Source | 243 | 5.01k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_begin() Line | Count | Source | 243 | 7.41k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPToClause>::varlist_begin() Line | Count | Source | 243 | 2.03k | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_begin() Line | Count | Source | 243 | 88 | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_begin() Line | Count | Source | 243 | 366 | varlist_iterator varlist_begin() { return getVarRefs().begin(); } |
|
244 | 969k | varlist_iterator varlist_end() { return getVarRefs().end(); } clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_end() Line | Count | Source | 244 | 72 | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_end() Line | Count | Source | 244 | 6.02k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_end() Line | Count | Source | 244 | 4.42k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_end() Line | Count | Source | 244 | 1.02k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_end() Line | Count | Source | 244 | 2.88k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPDependClause>::varlist_end() Line | Count | Source | 244 | 2.81k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_end() Line | Count | Source | 244 | 62 | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_end() Line | Count | Source | 244 | 330k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_end() Line | Count | Source | 244 | 56 | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPFromClause>::varlist_end() Line | Count | Source | 244 | 1.04k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::varlist_end() Line | Count | Source | 244 | 306 | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_end() Line | Count | Source | 244 | 28.8k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_end() Line | Count | Source | 244 | 80 | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPInitClause>::varlist_end() Line | Count | Source | 244 | 83 | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_end() Line | Count | Source | 244 | 2.73k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_end() Line | Count | Source | 244 | 65.4k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_end() Line | Count | Source | 244 | 75.8k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPMapClause>::varlist_end() Line | Count | Source | 244 | 63.7k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_end() Line | Count | Source | 244 | 1.91k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_end() Line | Count | Source | 244 | 70.2k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_end() Line | Count | Source | 244 | 276k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_end() Line | Count | Source | 244 | 3.93k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_end() Line | Count | Source | 244 | 27.9k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPToClause>::varlist_end() Line | Count | Source | 244 | 1.65k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_end() Line | Count | Source | 244 | 52 | varlist_iterator varlist_end() { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_end() Line | Count | Source | 244 | 1.69k | varlist_iterator varlist_end() { return getVarRefs().end(); } |
|
245 | 44.1k | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_begin() const Line | Count | Source | 245 | 14 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_begin() const Line | Count | Source | 245 | 452 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_begin() const Line | Count | Source | 245 | 179 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_begin() const Line | Count | Source | 245 | 59 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_begin() const Line | Count | Source | 245 | 72 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPDependClause>::varlist_begin() const Line | Count | Source | 245 | 1.14k | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_begin() const clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_begin() const Line | Count | Source | 245 | 25.8k | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_begin() const Line | Count | Source | 245 | 18 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPFromClause>::varlist_begin() const Line | Count | Source | 245 | 196 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::varlist_begin() const Line | Count | Source | 245 | 46 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_begin() const Line | Count | Source | 245 | 54 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_begin() const clang::OMPVarListClause<clang::OMPInitClause>::varlist_begin() const Line | Count | Source | 245 | 103 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_begin() const Line | Count | Source | 245 | 441 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_begin() const Line | Count | Source | 245 | 2.34k | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_begin() const Line | Count | Source | 245 | 1.87k | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPMapClause>::varlist_begin() const Line | Count | Source | 245 | 4.08k | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_begin() const Line | Count | Source | 245 | 46 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_begin() const Line | Count | Source | 245 | 3.24k | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_begin() const Line | Count | Source | 245 | 3.02k | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_begin() const Line | Count | Source | 245 | 263 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_begin() const Line | Count | Source | 245 | 159 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPToClause>::varlist_begin() const Line | Count | Source | 245 | 216 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_begin() const Line | Count | Source | 245 | 24 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_begin() const Line | Count | Source | 245 | 240 | varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); } |
|
246 | 128k | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } clang::OMPVarListClause<clang::OMPAffinityClause>::varlist_end() const Line | Count | Source | 246 | 14 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPAlignedClause>::varlist_end() const Line | Count | Source | 246 | 1.00k | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPAllocateClause>::varlist_end() const Line | Count | Source | 246 | 179 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::varlist_end() const Line | Count | Source | 246 | 413 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPCopyinClause>::varlist_end() const Line | Count | Source | 246 | 478 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPDependClause>::varlist_end() const Line | Count | Source | 246 | 1.14k | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPExclusiveClause>::varlist_end() const clang::OMPVarListClause<clang::OMPFirstprivateClause>::varlist_end() const Line | Count | Source | 246 | 62.2k | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPFlushClause>::varlist_end() const Line | Count | Source | 246 | 18 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPFromClause>::varlist_end() const Line | Count | Source | 246 | 196 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::varlist_end() const Line | Count | Source | 246 | 46 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPInReductionClause>::varlist_end() const Line | Count | Source | 246 | 402 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPInclusiveClause>::varlist_end() const clang::OMPVarListClause<clang::OMPInitClause>::varlist_end() const Line | Count | Source | 246 | 13 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::varlist_end() const Line | Count | Source | 246 | 441 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::varlist_end() const Line | Count | Source | 246 | 7.81k | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPLinearClause>::varlist_end() const Line | Count | Source | 246 | 8.76k | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPMapClause>::varlist_end() const Line | Count | Source | 246 | 4.08k | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::varlist_end() const Line | Count | Source | 246 | 46 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPPrivateClause>::varlist_end() const Line | Count | Source | 246 | 5.99k | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPReductionClause>::varlist_end() const Line | Count | Source | 246 | 32.8k | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPSharedClause>::varlist_end() const Line | Count | Source | 246 | 263 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::varlist_end() const Line | Count | Source | 246 | 1.43k | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPToClause>::varlist_end() const Line | Count | Source | 246 | 216 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::varlist_end() const Line | Count | Source | 246 | 24 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::varlist_end() const Line | Count | Source | 246 | 456 | varlist_const_iterator varlist_end() const { return getVarRefs().end(); } |
|
247 | | |
248 | | /// Sets the location of '('. |
249 | 15.1k | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } clang::OMPVarListClause<clang::OMPInitClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 26 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPPrivateClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 1.47k | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPFirstprivateClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 4.34k | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 430 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPSharedClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 473 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPReductionClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 1.00k | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 112 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPInReductionClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 91 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPLinearClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 386 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPAlignedClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 262 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPCopyinClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 82 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 23 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPFlushClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 10 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPDependClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 743 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPMapClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 4.23k | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPAllocateClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 278 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPToClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 216 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPFromClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 196 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 90 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 14 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 446 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 46 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 98 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPInclusiveClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 12 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPExclusiveClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 12 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
clang::OMPVarListClause<clang::OMPAffinityClause>::setLParenLoc(clang::SourceLocation) Line | Count | Source | 249 | 10 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
|
250 | | |
251 | | /// Returns the location of '('. |
252 | 66.4k | SourceLocation getLParenLoc() const { return LParenLoc; } clang::OMPVarListClause<clang::OMPAffinityClause>::getLParenLoc() const Line | Count | Source | 252 | 22 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPAlignedClause>::getLParenLoc() const Line | Count | Source | 252 | 794 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPAllocateClause>::getLParenLoc() const Line | Count | Source | 252 | 1.38k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::getLParenLoc() const Line | Count | Source | 252 | 85 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPCopyinClause>::getLParenLoc() const Line | Count | Source | 252 | 222 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPDependClause>::getLParenLoc() const Line | Count | Source | 252 | 1.48k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPExclusiveClause>::getLParenLoc() const Line | Count | Source | 252 | 14 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPFirstprivateClause>::getLParenLoc() const Line | Count | Source | 252 | 5.80k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPFlushClause>::getLParenLoc() const Line | Count | Source | 252 | 42 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPFromClause>::getLParenLoc() const Line | Count | Source | 252 | 682 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::getLParenLoc() const Line | Count | Source | 252 | 143 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPInReductionClause>::getLParenLoc() const Line | Count | Source | 252 | 1.67k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPInclusiveClause>::getLParenLoc() const Line | Count | Source | 252 | 22 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPInitClause>::getLParenLoc() const Line | Count | Source | 252 | 23 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::getLParenLoc() const Line | Count | Source | 252 | 1.54k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::getLParenLoc() const Line | Count | Source | 252 | 2.02k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPLinearClause>::getLParenLoc() const Line | Count | Source | 252 | 992 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPMapClause>::getLParenLoc() const Line | Count | Source | 252 | 16.5k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::getLParenLoc() const Line | Count | Source | 252 | 110 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPPrivateClause>::getLParenLoc() const Line | Count | Source | 252 | 6.67k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPReductionClause>::getLParenLoc() const Line | Count | Source | 252 | 20.7k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPSharedClause>::getLParenLoc() const Line | Count | Source | 252 | 2.11k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::getLParenLoc() const Line | Count | Source | 252 | 1.78k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPToClause>::getLParenLoc() const Line | Count | Source | 252 | 1.13k | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::getLParenLoc() const Line | Count | Source | 252 | 36 | SourceLocation getLParenLoc() const { return LParenLoc; } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::getLParenLoc() const Line | Count | Source | 252 | 286 | SourceLocation getLParenLoc() const { return LParenLoc; } |
|
253 | | |
254 | | /// Fetches list of all variables in the clause. |
255 | 184k | ArrayRef<const Expr *> getVarRefs() const { |
256 | 184k | return llvm::makeArrayRef( |
257 | 184k | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), |
258 | 184k | NumVars); |
259 | 184k | } clang::OMPVarListClause<clang::OMPAffinityClause>::getVarRefs() const Line | Count | Source | 255 | 28 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 28 | return llvm::makeArrayRef( | 257 | 28 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 28 | NumVars); | 259 | 28 | } |
clang::OMPVarListClause<clang::OMPAlignedClause>::getVarRefs() const Line | Count | Source | 255 | 1.45k | ArrayRef<const Expr *> getVarRefs() const { | 256 | 1.45k | return llvm::makeArrayRef( | 257 | 1.45k | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 1.45k | NumVars); | 259 | 1.45k | } |
clang::OMPVarListClause<clang::OMPAllocateClause>::getVarRefs() const Line | Count | Source | 255 | 358 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 358 | return llvm::makeArrayRef( | 257 | 358 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 358 | NumVars); | 259 | 358 | } |
clang::OMPVarListClause<clang::OMPCopyprivateClause>::getVarRefs() const Line | Count | Source | 255 | 472 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 472 | return llvm::makeArrayRef( | 257 | 472 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 472 | NumVars); | 259 | 472 | } |
clang::OMPVarListClause<clang::OMPCopyinClause>::getVarRefs() const Line | Count | Source | 255 | 550 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 550 | return llvm::makeArrayRef( | 257 | 550 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 550 | NumVars); | 259 | 550 | } |
clang::OMPVarListClause<clang::OMPDependClause>::getVarRefs() const Line | Count | Source | 255 | 2.34k | ArrayRef<const Expr *> getVarRefs() const { | 256 | 2.34k | return llvm::makeArrayRef( | 257 | 2.34k | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 2.34k | NumVars); | 259 | 2.34k | } |
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPExclusiveClause>::getVarRefs() const clang::OMPVarListClause<clang::OMPFirstprivateClause>::getVarRefs() const Line | Count | Source | 255 | 88.0k | ArrayRef<const Expr *> getVarRefs() const { | 256 | 88.0k | return llvm::makeArrayRef( | 257 | 88.0k | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 88.0k | NumVars); | 259 | 88.0k | } |
clang::OMPVarListClause<clang::OMPFlushClause>::getVarRefs() const Line | Count | Source | 255 | 36 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 36 | return llvm::makeArrayRef( | 257 | 36 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 36 | NumVars); | 259 | 36 | } |
clang::OMPVarListClause<clang::OMPFromClause>::getVarRefs() const Line | Count | Source | 255 | 498 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 498 | return llvm::makeArrayRef( | 257 | 498 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 498 | NumVars); | 259 | 498 | } |
clang::OMPVarListClause<clang::OMPHasDeviceAddrClause>::getVarRefs() const Line | Count | Source | 255 | 92 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 92 | return llvm::makeArrayRef( | 257 | 92 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 92 | NumVars); | 259 | 92 | } |
clang::OMPVarListClause<clang::OMPInReductionClause>::getVarRefs() const Line | Count | Source | 255 | 456 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 456 | return llvm::makeArrayRef( | 257 | 456 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 456 | NumVars); | 259 | 456 | } |
Unexecuted instantiation: clang::OMPVarListClause<clang::OMPInclusiveClause>::getVarRefs() const clang::OMPVarListClause<clang::OMPInitClause>::getVarRefs() const Line | Count | Source | 255 | 116 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 116 | return llvm::makeArrayRef( | 257 | 116 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 116 | NumVars); | 259 | 116 | } |
clang::OMPVarListClause<clang::OMPIsDevicePtrClause>::getVarRefs() const Line | Count | Source | 255 | 882 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 882 | return llvm::makeArrayRef( | 257 | 882 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 882 | NumVars); | 259 | 882 | } |
clang::OMPVarListClause<clang::OMPLastprivateClause>::getVarRefs() const Line | Count | Source | 255 | 10.1k | ArrayRef<const Expr *> getVarRefs() const { | 256 | 10.1k | return llvm::makeArrayRef( | 257 | 10.1k | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 10.1k | NumVars); | 259 | 10.1k | } |
clang::OMPVarListClause<clang::OMPLinearClause>::getVarRefs() const Line | Count | Source | 255 | 10.6k | ArrayRef<const Expr *> getVarRefs() const { | 256 | 10.6k | return llvm::makeArrayRef( | 257 | 10.6k | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 10.6k | NumVars); | 259 | 10.6k | } |
clang::OMPVarListClause<clang::OMPMapClause>::getVarRefs() const Line | Count | Source | 255 | 19.9k | ArrayRef<const Expr *> getVarRefs() const { | 256 | 19.9k | return llvm::makeArrayRef( | 257 | 19.9k | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 19.9k | NumVars); | 259 | 19.9k | } |
clang::OMPVarListClause<clang::OMPNontemporalClause>::getVarRefs() const Line | Count | Source | 255 | 92 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 92 | return llvm::makeArrayRef( | 257 | 92 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 92 | NumVars); | 259 | 92 | } |
clang::OMPVarListClause<clang::OMPPrivateClause>::getVarRefs() const Line | Count | Source | 255 | 9.23k | ArrayRef<const Expr *> getVarRefs() const { | 256 | 9.23k | return llvm::makeArrayRef( | 257 | 9.23k | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 9.23k | NumVars); | 259 | 9.23k | } |
clang::OMPVarListClause<clang::OMPReductionClause>::getVarRefs() const Line | Count | Source | 255 | 35.9k | ArrayRef<const Expr *> getVarRefs() const { | 256 | 35.9k | return llvm::makeArrayRef( | 257 | 35.9k | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 35.9k | NumVars); | 259 | 35.9k | } |
clang::OMPVarListClause<clang::OMPSharedClause>::getVarRefs() const Line | Count | Source | 255 | 526 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 526 | return llvm::makeArrayRef( | 257 | 526 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 526 | NumVars); | 259 | 526 | } |
clang::OMPVarListClause<clang::OMPTaskReductionClause>::getVarRefs() const Line | Count | Source | 255 | 1.59k | ArrayRef<const Expr *> getVarRefs() const { | 256 | 1.59k | return llvm::makeArrayRef( | 257 | 1.59k | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 1.59k | NumVars); | 259 | 1.59k | } |
clang::OMPVarListClause<clang::OMPToClause>::getVarRefs() const Line | Count | Source | 255 | 548 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 548 | return llvm::makeArrayRef( | 257 | 548 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 548 | NumVars); | 259 | 548 | } |
clang::OMPVarListClause<clang::OMPUseDeviceAddrClause>::getVarRefs() const Line | Count | Source | 255 | 48 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 48 | return llvm::makeArrayRef( | 257 | 48 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 48 | NumVars); | 259 | 48 | } |
clang::OMPVarListClause<clang::OMPUseDevicePtrClause>::getVarRefs() const Line | Count | Source | 255 | 696 | ArrayRef<const Expr *> getVarRefs() const { | 256 | 696 | return llvm::makeArrayRef( | 257 | 696 | static_cast<const T *>(this)->template getTrailingObjects<Expr *>(), | 258 | 696 | NumVars); | 259 | 696 | } |
|
260 | | }; |
261 | | |
262 | | /// This represents 'allocator' clause in the '#pragma omp ...' |
263 | | /// directive. |
264 | | /// |
265 | | /// \code |
266 | | /// #pragma omp allocate(a) allocator(omp_default_mem_alloc) |
267 | | /// \endcode |
268 | | /// In this example directive '#pragma omp allocate' has simple 'allocator' |
269 | | /// clause with the allocator 'omp_default_mem_alloc'. |
270 | | class OMPAllocatorClause : public OMPClause { |
271 | | friend class OMPClauseReader; |
272 | | |
273 | | /// Location of '('. |
274 | | SourceLocation LParenLoc; |
275 | | |
276 | | /// Expression with the allocator. |
277 | | Stmt *Allocator = nullptr; |
278 | | |
279 | | /// Set allocator. |
280 | 120 | void setAllocator(Expr *A) { Allocator = A; } |
281 | | |
282 | | public: |
283 | | /// Build 'allocator' clause with the given allocator. |
284 | | /// |
285 | | /// \param A Allocator. |
286 | | /// \param StartLoc Starting location of the clause. |
287 | | /// \param LParenLoc Location of '('. |
288 | | /// \param EndLoc Ending location of the clause. |
289 | | OMPAllocatorClause(Expr *A, SourceLocation StartLoc, SourceLocation LParenLoc, |
290 | | SourceLocation EndLoc) |
291 | | : OMPClause(llvm::omp::OMPC_allocator, StartLoc, EndLoc), |
292 | 447 | LParenLoc(LParenLoc), Allocator(A) {} |
293 | | |
294 | | /// Build an empty clause. |
295 | | OMPAllocatorClause() |
296 | | : OMPClause(llvm::omp::OMPC_allocator, SourceLocation(), |
297 | 120 | SourceLocation()) {} |
298 | | |
299 | | /// Sets the location of '('. |
300 | 120 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
301 | | |
302 | | /// Returns the location of '('. |
303 | 187 | SourceLocation getLParenLoc() const { return LParenLoc; } |
304 | | |
305 | | /// Returns allocator. |
306 | 724 | Expr *getAllocator() const { return cast_or_null<Expr>(Allocator); } |
307 | | |
308 | 4 | child_range children() { return child_range(&Allocator, &Allocator + 1); } |
309 | | |
310 | 0 | const_child_range children() const { |
311 | 0 | return const_child_range(&Allocator, &Allocator + 1); |
312 | 0 | } |
313 | | |
314 | 0 | child_range used_children() { |
315 | 0 | return child_range(child_iterator(), child_iterator()); |
316 | 0 | } |
317 | 0 | const_child_range used_children() const { |
318 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
319 | 0 | } |
320 | | |
321 | 592 | static bool classof(const OMPClause *T) { |
322 | 592 | return T->getClauseKind() == llvm::omp::OMPC_allocator; |
323 | 592 | } |
324 | | }; |
325 | | |
326 | | /// This represents the 'align' clause in the '#pragma omp allocate' |
327 | | /// directive. |
328 | | /// |
329 | | /// \code |
330 | | /// #pragma omp allocate(a) allocator(omp_default_mem_alloc) align(8) |
331 | | /// \endcode |
332 | | /// In this example directive '#pragma omp allocate' has simple 'allocator' |
333 | | /// clause with the allocator 'omp_default_mem_alloc' and align clause with |
334 | | /// value of 8. |
335 | | class OMPAlignClause final : public OMPClause { |
336 | | friend class OMPClauseReader; |
337 | | |
338 | | /// Location of '('. |
339 | | SourceLocation LParenLoc; |
340 | | |
341 | | /// Alignment specified with align clause. |
342 | | Stmt *Alignment = nullptr; |
343 | | |
344 | | /// Set alignment value. |
345 | 20 | void setAlignment(Expr *A) { Alignment = A; } |
346 | | |
347 | | /// Sets the location of '('. |
348 | 20 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
349 | | |
350 | | /// Build 'align' clause with the given alignment |
351 | | /// |
352 | | /// \param A Alignment value. |
353 | | /// \param StartLoc Starting location of the clause. |
354 | | /// \param LParenLoc Location of '('. |
355 | | /// \param EndLoc Ending location of the clause. |
356 | | OMPAlignClause(Expr *A, SourceLocation StartLoc, SourceLocation LParenLoc, |
357 | | SourceLocation EndLoc) |
358 | | : OMPClause(llvm::omp::OMPC_align, StartLoc, EndLoc), |
359 | 77 | LParenLoc(LParenLoc), Alignment(A) {} |
360 | | |
361 | | /// Build an empty clause. |
362 | | OMPAlignClause() |
363 | 20 | : OMPClause(llvm::omp::OMPC_align, SourceLocation(), SourceLocation()) {} |
364 | | |
365 | | public: |
366 | | /// Build 'align' clause with the given alignment |
367 | | /// |
368 | | /// \param A Alignment value. |
369 | | /// \param StartLoc Starting location of the clause. |
370 | | /// \param LParenLoc Location of '('. |
371 | | /// \param EndLoc Ending location of the clause. |
372 | | static OMPAlignClause *Create(const ASTContext &C, Expr *A, |
373 | | SourceLocation StartLoc, |
374 | | SourceLocation LParenLoc, |
375 | | SourceLocation EndLoc); |
376 | | |
377 | | /// Returns the location of '('. |
378 | 25 | SourceLocation getLParenLoc() const { return LParenLoc; } |
379 | | |
380 | | /// Returns alignment |
381 | 109 | Expr *getAlignment() const { return cast_or_null<Expr>(Alignment); } |
382 | | |
383 | 8 | child_range children() { return child_range(&Alignment, &Alignment + 1); } |
384 | | |
385 | 0 | const_child_range children() const { |
386 | 0 | return const_child_range(&Alignment, &Alignment + 1); |
387 | 0 | } |
388 | | |
389 | 0 | child_range used_children() { |
390 | 0 | return child_range(child_iterator(), child_iterator()); |
391 | 0 | } |
392 | 0 | const_child_range used_children() const { |
393 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
394 | 0 | } |
395 | | |
396 | 84 | static bool classof(const OMPClause *T) { |
397 | 84 | return T->getClauseKind() == llvm::omp::OMPC_align; |
398 | 84 | } |
399 | | }; |
400 | | |
401 | | /// This represents clause 'allocate' in the '#pragma omp ...' directives. |
402 | | /// |
403 | | /// \code |
404 | | /// #pragma omp parallel private(a) allocate(omp_default_mem_alloc :a) |
405 | | /// \endcode |
406 | | /// In this example directive '#pragma omp parallel' has clause 'private' |
407 | | /// and clause 'allocate' for the variable 'a'. |
408 | | class OMPAllocateClause final |
409 | | : public OMPVarListClause<OMPAllocateClause>, |
410 | | private llvm::TrailingObjects<OMPAllocateClause, Expr *> { |
411 | | friend class OMPClauseReader; |
412 | | friend OMPVarListClause; |
413 | | friend TrailingObjects; |
414 | | |
415 | | /// Allocator specified in the clause, or 'nullptr' if the default one is |
416 | | /// used. |
417 | | Expr *Allocator = nullptr; |
418 | | /// Position of the ':' delimiter in the clause; |
419 | | SourceLocation ColonLoc; |
420 | | |
421 | | /// Build clause with number of variables \a N. |
422 | | /// |
423 | | /// \param StartLoc Starting location of the clause. |
424 | | /// \param LParenLoc Location of '('. |
425 | | /// \param Allocator Allocator expression. |
426 | | /// \param ColonLoc Location of ':' delimiter. |
427 | | /// \param EndLoc Ending location of the clause. |
428 | | /// \param N Number of the variables in the clause. |
429 | | OMPAllocateClause(SourceLocation StartLoc, SourceLocation LParenLoc, |
430 | | Expr *Allocator, SourceLocation ColonLoc, |
431 | | SourceLocation EndLoc, unsigned N) |
432 | | : OMPVarListClause<OMPAllocateClause>(llvm::omp::OMPC_allocate, StartLoc, |
433 | | LParenLoc, EndLoc, N), |
434 | 2.16k | Allocator(Allocator), ColonLoc(ColonLoc) {} |
435 | | |
436 | | /// Build an empty clause. |
437 | | /// |
438 | | /// \param N Number of variables. |
439 | | explicit OMPAllocateClause(unsigned N) |
440 | | : OMPVarListClause<OMPAllocateClause>(llvm::omp::OMPC_allocate, |
441 | | SourceLocation(), SourceLocation(), |
442 | 278 | SourceLocation(), N) {} |
443 | | |
444 | | /// Sets location of ':' symbol in clause. |
445 | 278 | void setColonLoc(SourceLocation CL) { ColonLoc = CL; } |
446 | | |
447 | 278 | void setAllocator(Expr *A) { Allocator = A; } |
448 | | |
449 | | public: |
450 | | /// Creates clause with a list of variables \a VL. |
451 | | /// |
452 | | /// \param C AST context. |
453 | | /// \param StartLoc Starting location of the clause. |
454 | | /// \param LParenLoc Location of '('. |
455 | | /// \param Allocator Allocator expression. |
456 | | /// \param ColonLoc Location of ':' delimiter. |
457 | | /// \param EndLoc Ending location of the clause. |
458 | | /// \param VL List of references to the variables. |
459 | | static OMPAllocateClause *Create(const ASTContext &C, SourceLocation StartLoc, |
460 | | SourceLocation LParenLoc, Expr *Allocator, |
461 | | SourceLocation ColonLoc, |
462 | | SourceLocation EndLoc, ArrayRef<Expr *> VL); |
463 | | |
464 | | /// Returns the allocator expression or nullptr, if no allocator is specified. |
465 | 7.85k | Expr *getAllocator() const { return Allocator; } |
466 | | |
467 | | /// Returns the location of the ':' delimiter. |
468 | 1.38k | SourceLocation getColonLoc() const { return ColonLoc; } |
469 | | |
470 | | /// Creates an empty clause with the place for \a N variables. |
471 | | /// |
472 | | /// \param C AST context. |
473 | | /// \param N The number of variables. |
474 | | static OMPAllocateClause *CreateEmpty(const ASTContext &C, unsigned N); |
475 | | |
476 | 635 | child_range children() { |
477 | 635 | return child_range(reinterpret_cast<Stmt **>(varlist_begin()), |
478 | 635 | reinterpret_cast<Stmt **>(varlist_end())); |
479 | 635 | } |
480 | | |
481 | 0 | const_child_range children() const { |
482 | 0 | auto Children = const_cast<OMPAllocateClause *>(this)->children(); |
483 | 0 | return const_child_range(Children.begin(), Children.end()); |
484 | 0 | } |
485 | | |
486 | 1.47k | child_range used_children() { |
487 | 1.47k | return child_range(child_iterator(), child_iterator()); |
488 | 1.47k | } |
489 | 0 | const_child_range used_children() const { |
490 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
491 | 0 | } |
492 | | |
493 | 195k | static bool classof(const OMPClause *T) { |
494 | 195k | return T->getClauseKind() == llvm::omp::OMPC_allocate; |
495 | 195k | } |
496 | | }; |
497 | | |
498 | | /// This represents 'if' clause in the '#pragma omp ...' directive. |
499 | | /// |
500 | | /// \code |
501 | | /// #pragma omp parallel if(parallel:a > 5) |
502 | | /// \endcode |
503 | | /// In this example directive '#pragma omp parallel' has simple 'if' clause with |
504 | | /// condition 'a > 5' and directive name modifier 'parallel'. |
505 | | class OMPIfClause : public OMPClause, public OMPClauseWithPreInit { |
506 | | friend class OMPClauseReader; |
507 | | |
508 | | /// Location of '('. |
509 | | SourceLocation LParenLoc; |
510 | | |
511 | | /// Condition of the 'if' clause. |
512 | | Stmt *Condition = nullptr; |
513 | | |
514 | | /// Location of ':' (if any). |
515 | | SourceLocation ColonLoc; |
516 | | |
517 | | /// Directive name modifier for the clause. |
518 | | OpenMPDirectiveKind NameModifier = llvm::omp::OMPD_unknown; |
519 | | |
520 | | /// Name modifier location. |
521 | | SourceLocation NameModifierLoc; |
522 | | |
523 | | /// Set condition. |
524 | 2.54k | void setCondition(Expr *Cond) { Condition = Cond; } |
525 | | |
526 | | /// Set directive name modifier for the clause. |
527 | 2.54k | void setNameModifier(OpenMPDirectiveKind NM) { NameModifier = NM; } |
528 | | |
529 | | /// Set location of directive name modifier for the clause. |
530 | 2.54k | void setNameModifierLoc(SourceLocation Loc) { NameModifierLoc = Loc; } |
531 | | |
532 | | /// Set location of ':'. |
533 | 2.54k | void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; } |
534 | | |
535 | | public: |
536 | | /// Build 'if' clause with condition \a Cond. |
537 | | /// |
538 | | /// \param NameModifier [OpenMP 4.1] Directive name modifier of clause. |
539 | | /// \param Cond Condition of the clause. |
540 | | /// \param HelperCond Helper condition for the clause. |
541 | | /// \param CaptureRegion Innermost OpenMP region where expressions in this |
542 | | /// clause must be captured. |
543 | | /// \param StartLoc Starting location of the clause. |
544 | | /// \param LParenLoc Location of '('. |
545 | | /// \param NameModifierLoc Location of directive name modifier. |
546 | | /// \param ColonLoc [OpenMP 4.1] Location of ':'. |
547 | | /// \param EndLoc Ending location of the clause. |
548 | | OMPIfClause(OpenMPDirectiveKind NameModifier, Expr *Cond, Stmt *HelperCond, |
549 | | OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, |
550 | | SourceLocation LParenLoc, SourceLocation NameModifierLoc, |
551 | | SourceLocation ColonLoc, SourceLocation EndLoc) |
552 | | : OMPClause(llvm::omp::OMPC_if, StartLoc, EndLoc), |
553 | | OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Condition(Cond), |
554 | | ColonLoc(ColonLoc), NameModifier(NameModifier), |
555 | 12.6k | NameModifierLoc(NameModifierLoc) { |
556 | 12.6k | setPreInitStmt(HelperCond, CaptureRegion); |
557 | 12.6k | } |
558 | | |
559 | | /// Build an empty clause. |
560 | | OMPIfClause() |
561 | | : OMPClause(llvm::omp::OMPC_if, SourceLocation(), SourceLocation()), |
562 | 2.54k | OMPClauseWithPreInit(this) {} |
563 | | |
564 | | /// Sets the location of '('. |
565 | 2.54k | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
566 | | |
567 | | /// Returns the location of '('. |
568 | 5.30k | SourceLocation getLParenLoc() const { return LParenLoc; } |
569 | | |
570 | | /// Return the location of ':'. |
571 | 5.30k | SourceLocation getColonLoc() const { return ColonLoc; } |
572 | | |
573 | | /// Returns condition. |
574 | 14.4k | Expr *getCondition() const { return cast_or_null<Expr>(Condition); } |
575 | | |
576 | | /// Return directive name modifier associated with the clause. |
577 | 27.6k | OpenMPDirectiveKind getNameModifier() const { return NameModifier; } |
578 | | |
579 | | /// Return the location of directive name modifier. |
580 | 11.8k | SourceLocation getNameModifierLoc() const { return NameModifierLoc; } |
581 | | |
582 | 1.51k | child_range children() { return child_range(&Condition, &Condition + 1); } |
583 | | |
584 | 0 | const_child_range children() const { |
585 | 0 | return const_child_range(&Condition, &Condition + 1); |
586 | 0 | } |
587 | | |
588 | | child_range used_children(); |
589 | 0 | const_child_range used_children() const { |
590 | 0 | auto Children = const_cast<OMPIfClause *>(this)->used_children(); |
591 | 0 | return const_child_range(Children.begin(), Children.end()); |
592 | 0 | } |
593 | | |
594 | 185k | static bool classof(const OMPClause *T) { |
595 | 185k | return T->getClauseKind() == llvm::omp::OMPC_if; |
596 | 185k | } |
597 | | }; |
598 | | |
599 | | /// This represents 'final' clause in the '#pragma omp ...' directive. |
600 | | /// |
601 | | /// \code |
602 | | /// #pragma omp task final(a > 5) |
603 | | /// \endcode |
604 | | /// In this example directive '#pragma omp task' has simple 'final' |
605 | | /// clause with condition 'a > 5'. |
606 | | class OMPFinalClause : public OMPClause, public OMPClauseWithPreInit { |
607 | | friend class OMPClauseReader; |
608 | | |
609 | | /// Location of '('. |
610 | | SourceLocation LParenLoc; |
611 | | |
612 | | /// Condition of the 'if' clause. |
613 | | Stmt *Condition = nullptr; |
614 | | |
615 | | /// Set condition. |
616 | 96 | void setCondition(Expr *Cond) { Condition = Cond; } |
617 | | |
618 | | public: |
619 | | /// Build 'final' clause with condition \a Cond. |
620 | | /// |
621 | | /// \param Cond Condition of the clause. |
622 | | /// \param HelperCond Helper condition for the construct. |
623 | | /// \param CaptureRegion Innermost OpenMP region where expressions in this |
624 | | /// clause must be captured. |
625 | | /// \param StartLoc Starting location of the clause. |
626 | | /// \param LParenLoc Location of '('. |
627 | | /// \param EndLoc Ending location of the clause. |
628 | | OMPFinalClause(Expr *Cond, Stmt *HelperCond, |
629 | | OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, |
630 | | SourceLocation LParenLoc, SourceLocation EndLoc) |
631 | | : OMPClause(llvm::omp::OMPC_final, StartLoc, EndLoc), |
632 | 822 | OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Condition(Cond) { |
633 | 822 | setPreInitStmt(HelperCond, CaptureRegion); |
634 | 822 | } |
635 | | |
636 | | /// Build an empty clause. |
637 | | OMPFinalClause() |
638 | | : OMPClause(llvm::omp::OMPC_final, SourceLocation(), SourceLocation()), |
639 | 96 | OMPClauseWithPreInit(this) {} |
640 | | |
641 | | /// Sets the location of '('. |
642 | 96 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
643 | | |
644 | | /// Returns the location of '('. |
645 | 378 | SourceLocation getLParenLoc() const { return LParenLoc; } |
646 | | |
647 | | /// Returns condition. |
648 | 738 | Expr *getCondition() const { return cast_or_null<Expr>(Condition); } |
649 | | |
650 | 236 | child_range children() { return child_range(&Condition, &Condition + 1); } |
651 | | |
652 | 0 | const_child_range children() const { |
653 | 0 | return const_child_range(&Condition, &Condition + 1); |
654 | 0 | } |
655 | | |
656 | | child_range used_children(); |
657 | 0 | const_child_range used_children() const { |
658 | 0 | auto Children = const_cast<OMPFinalClause *>(this)->used_children(); |
659 | 0 | return const_child_range(Children.begin(), Children.end()); |
660 | 0 | } |
661 | | |
662 | 1.05k | static bool classof(const OMPClause *T) { |
663 | 1.05k | return T->getClauseKind() == llvm::omp::OMPC_final; |
664 | 1.05k | } |
665 | | }; |
666 | | |
667 | | /// This represents 'num_threads' clause in the '#pragma omp ...' |
668 | | /// directive. |
669 | | /// |
670 | | /// \code |
671 | | /// #pragma omp parallel num_threads(6) |
672 | | /// \endcode |
673 | | /// In this example directive '#pragma omp parallel' has simple 'num_threads' |
674 | | /// clause with number of threads '6'. |
675 | | class OMPNumThreadsClause : public OMPClause, public OMPClauseWithPreInit { |
676 | | friend class OMPClauseReader; |
677 | | |
678 | | /// Location of '('. |
679 | | SourceLocation LParenLoc; |
680 | | |
681 | | /// Condition of the 'num_threads' clause. |
682 | | Stmt *NumThreads = nullptr; |
683 | | |
684 | | /// Set condition. |
685 | 325 | void setNumThreads(Expr *NThreads) { NumThreads = NThreads; } |
686 | | |
687 | | public: |
688 | | /// Build 'num_threads' clause with condition \a NumThreads. |
689 | | /// |
690 | | /// \param NumThreads Number of threads for the construct. |
691 | | /// \param HelperNumThreads Helper Number of threads for the construct. |
692 | | /// \param CaptureRegion Innermost OpenMP region where expressions in this |
693 | | /// clause must be captured. |
694 | | /// \param StartLoc Starting location of the clause. |
695 | | /// \param LParenLoc Location of '('. |
696 | | /// \param EndLoc Ending location of the clause. |
697 | | OMPNumThreadsClause(Expr *NumThreads, Stmt *HelperNumThreads, |
698 | | OpenMPDirectiveKind CaptureRegion, |
699 | | SourceLocation StartLoc, SourceLocation LParenLoc, |
700 | | SourceLocation EndLoc) |
701 | | : OMPClause(llvm::omp::OMPC_num_threads, StartLoc, EndLoc), |
702 | | OMPClauseWithPreInit(this), LParenLoc(LParenLoc), |
703 | 2.08k | NumThreads(NumThreads) { |
704 | 2.08k | setPreInitStmt(HelperNumThreads, CaptureRegion); |
705 | 2.08k | } |
706 | | |
707 | | /// Build an empty clause. |
708 | | OMPNumThreadsClause() |
709 | | : OMPClause(llvm::omp::OMPC_num_threads, SourceLocation(), |
710 | | SourceLocation()), |
711 | 325 | OMPClauseWithPreInit(this) {} |
712 | | |
713 | | /// Sets the location of '('. |
714 | 325 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
715 | | |
716 | | /// Returns the location of '('. |
717 | 1.22k | SourceLocation getLParenLoc() const { return LParenLoc; } |
718 | | |
719 | | /// Returns number of threads. |
720 | 2.83k | Expr *getNumThreads() const { return cast_or_null<Expr>(NumThreads); } |
721 | | |
722 | 502 | child_range children() { return child_range(&NumThreads, &NumThreads + 1); } |
723 | | |
724 | 0 | const_child_range children() const { |
725 | 0 | return const_child_range(&NumThreads, &NumThreads + 1); |
726 | 0 | } |
727 | | |
728 | 1.88k | child_range used_children() { |
729 | 1.88k | return child_range(child_iterator(), child_iterator()); |
730 | 1.88k | } |
731 | 0 | const_child_range used_children() const { |
732 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
733 | 0 | } |
734 | | |
735 | 18.8k | static bool classof(const OMPClause *T) { |
736 | 18.8k | return T->getClauseKind() == llvm::omp::OMPC_num_threads; |
737 | 18.8k | } |
738 | | }; |
739 | | |
740 | | /// This represents 'safelen' clause in the '#pragma omp ...' |
741 | | /// directive. |
742 | | /// |
743 | | /// \code |
744 | | /// #pragma omp simd safelen(4) |
745 | | /// \endcode |
746 | | /// In this example directive '#pragma omp simd' has clause 'safelen' |
747 | | /// with single expression '4'. |
748 | | /// If the safelen clause is used then no two iterations executed |
749 | | /// concurrently with SIMD instructions can have a greater distance |
750 | | /// in the logical iteration space than its value. The parameter of |
751 | | /// the safelen clause must be a constant positive integer expression. |
752 | | class OMPSafelenClause : public OMPClause { |
753 | | friend class OMPClauseReader; |
754 | | |
755 | | /// Location of '('. |
756 | | SourceLocation LParenLoc; |
757 | | |
758 | | /// Safe iteration space distance. |
759 | | Stmt *Safelen = nullptr; |
760 | | |
761 | | /// Set safelen. |
762 | 240 | void setSafelen(Expr *Len) { Safelen = Len; } |
763 | | |
764 | | public: |
765 | | /// Build 'safelen' clause. |
766 | | /// |
767 | | /// \param Len Expression associated with this clause. |
768 | | /// \param StartLoc Starting location of the clause. |
769 | | /// \param EndLoc Ending location of the clause. |
770 | | OMPSafelenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, |
771 | | SourceLocation EndLoc) |
772 | | : OMPClause(llvm::omp::OMPC_safelen, StartLoc, EndLoc), |
773 | 3.65k | LParenLoc(LParenLoc), Safelen(Len) {} |
774 | | |
775 | | /// Build an empty clause. |
776 | | explicit OMPSafelenClause() |
777 | 240 | : OMPClause(llvm::omp::OMPC_safelen, SourceLocation(), SourceLocation()) { |
778 | 240 | } |
779 | | |
780 | | /// Sets the location of '('. |
781 | 240 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
782 | | |
783 | | /// Returns the location of '('. |
784 | 2.43k | SourceLocation getLParenLoc() const { return LParenLoc; } |
785 | | |
786 | | /// Return safe iteration space distance. |
787 | 3.73k | Expr *getSafelen() const { return cast_or_null<Expr>(Safelen); } |
788 | | |
789 | 760 | child_range children() { return child_range(&Safelen, &Safelen + 1); } |
790 | | |
791 | 0 | const_child_range children() const { |
792 | 0 | return const_child_range(&Safelen, &Safelen + 1); |
793 | 0 | } |
794 | | |
795 | 776 | child_range used_children() { |
796 | 776 | return child_range(child_iterator(), child_iterator()); |
797 | 776 | } |
798 | 0 | const_child_range used_children() const { |
799 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
800 | 0 | } |
801 | | |
802 | 18.5k | static bool classof(const OMPClause *T) { |
803 | 18.5k | return T->getClauseKind() == llvm::omp::OMPC_safelen; |
804 | 18.5k | } |
805 | | }; |
806 | | |
807 | | /// This represents 'simdlen' clause in the '#pragma omp ...' |
808 | | /// directive. |
809 | | /// |
810 | | /// \code |
811 | | /// #pragma omp simd simdlen(4) |
812 | | /// \endcode |
813 | | /// In this example directive '#pragma omp simd' has clause 'simdlen' |
814 | | /// with single expression '4'. |
815 | | /// If the 'simdlen' clause is used then it specifies the preferred number of |
816 | | /// iterations to be executed concurrently. The parameter of the 'simdlen' |
817 | | /// clause must be a constant positive integer expression. |
818 | | class OMPSimdlenClause : public OMPClause { |
819 | | friend class OMPClauseReader; |
820 | | |
821 | | /// Location of '('. |
822 | | SourceLocation LParenLoc; |
823 | | |
824 | | /// Safe iteration space distance. |
825 | | Stmt *Simdlen = nullptr; |
826 | | |
827 | | /// Set simdlen. |
828 | 244 | void setSimdlen(Expr *Len) { Simdlen = Len; } |
829 | | |
830 | | public: |
831 | | /// Build 'simdlen' clause. |
832 | | /// |
833 | | /// \param Len Expression associated with this clause. |
834 | | /// \param StartLoc Starting location of the clause. |
835 | | /// \param EndLoc Ending location of the clause. |
836 | | OMPSimdlenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, |
837 | | SourceLocation EndLoc) |
838 | | : OMPClause(llvm::omp::OMPC_simdlen, StartLoc, EndLoc), |
839 | 2.38k | LParenLoc(LParenLoc), Simdlen(Len) {} |
840 | | |
841 | | /// Build an empty clause. |
842 | | explicit OMPSimdlenClause() |
843 | 244 | : OMPClause(llvm::omp::OMPC_simdlen, SourceLocation(), SourceLocation()) { |
844 | 244 | } |
845 | | |
846 | | /// Sets the location of '('. |
847 | 244 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
848 | | |
849 | | /// Returns the location of '('. |
850 | 1.46k | SourceLocation getLParenLoc() const { return LParenLoc; } |
851 | | |
852 | | /// Return safe iteration space distance. |
853 | 2.87k | Expr *getSimdlen() const { return cast_or_null<Expr>(Simdlen); } |
854 | | |
855 | 330 | child_range children() { return child_range(&Simdlen, &Simdlen + 1); } |
856 | | |
857 | 0 | const_child_range children() const { |
858 | 0 | return const_child_range(&Simdlen, &Simdlen + 1); |
859 | 0 | } |
860 | | |
861 | 800 | child_range used_children() { |
862 | 800 | return child_range(child_iterator(), child_iterator()); |
863 | 800 | } |
864 | 0 | const_child_range used_children() const { |
865 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
866 | 0 | } |
867 | | |
868 | 16.4k | static bool classof(const OMPClause *T) { |
869 | 16.4k | return T->getClauseKind() == llvm::omp::OMPC_simdlen; |
870 | 16.4k | } |
871 | | }; |
872 | | |
873 | | /// This represents the 'sizes' clause in the '#pragma omp tile' directive. |
874 | | /// |
875 | | /// \code |
876 | | /// #pragma omp tile sizes(5,5) |
877 | | /// for (int i = 0; i < 64; ++i) |
878 | | /// for (int j = 0; j < 64; ++j) |
879 | | /// \endcode |
880 | | class OMPSizesClause final |
881 | | : public OMPClause, |
882 | | private llvm::TrailingObjects<OMPSizesClause, Expr *> { |
883 | | friend class OMPClauseReader; |
884 | | friend class llvm::TrailingObjects<OMPSizesClause, Expr *>; |
885 | | |
886 | | /// Location of '('. |
887 | | SourceLocation LParenLoc; |
888 | | |
889 | | /// Number of tile sizes in the clause. |
890 | | unsigned NumSizes; |
891 | | |
892 | | /// Build an empty clause. |
893 | | explicit OMPSizesClause(int NumSizes) |
894 | | : OMPClause(llvm::omp::OMPC_sizes, SourceLocation(), SourceLocation()), |
895 | 106 | NumSizes(NumSizes) {} |
896 | | |
897 | | public: |
898 | | /// Build a 'sizes' AST node. |
899 | | /// |
900 | | /// \param C Context of the AST. |
901 | | /// \param StartLoc Location of the 'sizes' identifier. |
902 | | /// \param LParenLoc Location of '('. |
903 | | /// \param EndLoc Location of ')'. |
904 | | /// \param Sizes Content of the clause. |
905 | | static OMPSizesClause *Create(const ASTContext &C, SourceLocation StartLoc, |
906 | | SourceLocation LParenLoc, SourceLocation EndLoc, |
907 | | ArrayRef<Expr *> Sizes); |
908 | | |
909 | | /// Build an empty 'sizes' AST node for deserialization. |
910 | | /// |
911 | | /// \param C Context of the AST. |
912 | | /// \param NumSizes Number of items in the clause. |
913 | | static OMPSizesClause *CreateEmpty(const ASTContext &C, unsigned NumSizes); |
914 | | |
915 | | /// Sets the location of '('. |
916 | 106 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
917 | | |
918 | | /// Returns the location of '('. |
919 | 31 | SourceLocation getLParenLoc() const { return LParenLoc; } |
920 | | |
921 | | /// Returns the number of list items. |
922 | 110 | unsigned getNumSizes() const { return NumSizes; } |
923 | | |
924 | | /// Returns the tile size expressions. |
925 | 93 | MutableArrayRef<Expr *> getSizesRefs() { |
926 | 93 | return MutableArrayRef<Expr *>(static_cast<OMPSizesClause *>(this) |
927 | 93 | ->template getTrailingObjects<Expr *>(), |
928 | 93 | NumSizes); |
929 | 93 | } |
930 | 175 | ArrayRef<Expr *> getSizesRefs() const { |
931 | 175 | return ArrayRef<Expr *>(static_cast<const OMPSizesClause *>(this) |
932 | 175 | ->template getTrailingObjects<Expr *>(), |
933 | 175 | NumSizes); |
934 | 175 | } |
935 | | |
936 | | /// Sets the tile size expressions. |
937 | 80 | void setSizesRefs(ArrayRef<Expr *> VL) { |
938 | 80 | assert(VL.size() == NumSizes); |
939 | 0 | std::copy(VL.begin(), VL.end(), |
940 | 80 | static_cast<OMPSizesClause *>(this) |
941 | 80 | ->template getTrailingObjects<Expr *>()); |
942 | 80 | } |
943 | | |
944 | 18 | child_range children() { |
945 | 18 | MutableArrayRef<Expr *> Sizes = getSizesRefs(); |
946 | 18 | return child_range(reinterpret_cast<Stmt **>(Sizes.begin()), |
947 | 18 | reinterpret_cast<Stmt **>(Sizes.end())); |
948 | 18 | } |
949 | 0 | const_child_range children() const { |
950 | 0 | ArrayRef<Expr *> Sizes = getSizesRefs(); |
951 | 0 | return const_child_range(reinterpret_cast<Stmt *const *>(Sizes.begin()), |
952 | 0 | reinterpret_cast<Stmt *const *>(Sizes.end())); |
953 | 0 | } |
954 | | |
955 | 0 | child_range used_children() { |
956 | 0 | return child_range(child_iterator(), child_iterator()); |
957 | 0 | } |
958 | 0 | const_child_range used_children() const { |
959 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
960 | 0 | } |
961 | | |
962 | 170 | static bool classof(const OMPClause *T) { |
963 | 170 | return T->getClauseKind() == llvm::omp::OMPC_sizes; |
964 | 170 | } |
965 | | }; |
966 | | |
967 | | /// Representation of the 'full' clause of the '#pragma omp unroll' directive. |
968 | | /// |
969 | | /// \code |
970 | | /// #pragma omp unroll full |
971 | | /// for (int i = 0; i < 64; ++i) |
972 | | /// \endcode |
973 | | class OMPFullClause final : public OMPClause { |
974 | | friend class OMPClauseReader; |
975 | | |
976 | | /// Build an empty clause. |
977 | 18 | explicit OMPFullClause() : OMPClause(llvm::omp::OMPC_full, {}, {}) {} |
978 | | |
979 | | public: |
980 | | /// Build an AST node for a 'full' clause. |
981 | | /// |
982 | | /// \param C Context of the AST. |
983 | | /// \param StartLoc Starting location of the clause. |
984 | | /// \param EndLoc Ending location of the clause. |
985 | | static OMPFullClause *Create(const ASTContext &C, SourceLocation StartLoc, |
986 | | SourceLocation EndLoc); |
987 | | |
988 | | /// Build an empty 'full' AST node for deserialization. |
989 | | /// |
990 | | /// \param C Context of the AST. |
991 | | static OMPFullClause *CreateEmpty(const ASTContext &C); |
992 | | |
993 | 2 | child_range children() { return {child_iterator(), child_iterator()}; } |
994 | 0 | const_child_range children() const { |
995 | 0 | return {const_child_iterator(), const_child_iterator()}; |
996 | 0 | } |
997 | | |
998 | 0 | child_range used_children() { |
999 | 0 | return child_range(child_iterator(), child_iterator()); |
1000 | 0 | } |
1001 | 0 | const_child_range used_children() const { |
1002 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1003 | 0 | } |
1004 | | |
1005 | 107 | static bool classof(const OMPClause *T) { |
1006 | 107 | return T->getClauseKind() == llvm::omp::OMPC_full; |
1007 | 107 | } |
1008 | | }; |
1009 | | |
1010 | | /// Representation of the 'partial' clause of the '#pragma omp unroll' |
1011 | | /// directive. |
1012 | | /// |
1013 | | /// \code |
1014 | | /// #pragma omp unroll partial(4) |
1015 | | /// for (int i = start; i < end; ++i) |
1016 | | /// \endcode |
1017 | | class OMPPartialClause final : public OMPClause { |
1018 | | friend class OMPClauseReader; |
1019 | | |
1020 | | /// Location of '('. |
1021 | | SourceLocation LParenLoc; |
1022 | | |
1023 | | /// Optional argument to the clause (unroll factor). |
1024 | | Stmt *Factor; |
1025 | | |
1026 | | /// Build an empty clause. |
1027 | 89 | explicit OMPPartialClause() : OMPClause(llvm::omp::OMPC_partial, {}, {}) {} |
1028 | | |
1029 | | /// Set the unroll factor. |
1030 | 89 | void setFactor(Expr *E) { Factor = E; } |
1031 | | |
1032 | | /// Sets the location of '('. |
1033 | 89 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
1034 | | |
1035 | | public: |
1036 | | /// Build an AST node for a 'partial' clause. |
1037 | | /// |
1038 | | /// \param C Context of the AST. |
1039 | | /// \param StartLoc Location of the 'partial' identifier. |
1040 | | /// \param LParenLoc Location of '('. |
1041 | | /// \param EndLoc Location of ')'. |
1042 | | /// \param Factor Clause argument. |
1043 | | static OMPPartialClause *Create(const ASTContext &C, SourceLocation StartLoc, |
1044 | | SourceLocation LParenLoc, |
1045 | | SourceLocation EndLoc, Expr *Factor); |
1046 | | |
1047 | | /// Build an empty 'partial' AST node for deserialization. |
1048 | | /// |
1049 | | /// \param C Context of the AST. |
1050 | | static OMPPartialClause *CreateEmpty(const ASTContext &C); |
1051 | | |
1052 | | /// Returns the location of '('. |
1053 | 26 | SourceLocation getLParenLoc() const { return LParenLoc; } |
1054 | | |
1055 | | /// Returns the argument of the clause or nullptr if not set. |
1056 | 125 | Expr *getFactor() const { return cast_or_null<Expr>(Factor); } |
1057 | | |
1058 | 14 | child_range children() { return child_range(&Factor, &Factor + 1); } |
1059 | 0 | const_child_range children() const { |
1060 | 0 | return const_child_range(&Factor, &Factor + 1); |
1061 | 0 | } |
1062 | | |
1063 | 0 | child_range used_children() { |
1064 | 0 | return child_range(child_iterator(), child_iterator()); |
1065 | 0 | } |
1066 | 0 | const_child_range used_children() const { |
1067 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1068 | 0 | } |
1069 | | |
1070 | 178 | static bool classof(const OMPClause *T) { |
1071 | 178 | return T->getClauseKind() == llvm::omp::OMPC_partial; |
1072 | 178 | } |
1073 | | }; |
1074 | | |
1075 | | /// This represents 'collapse' clause in the '#pragma omp ...' |
1076 | | /// directive. |
1077 | | /// |
1078 | | /// \code |
1079 | | /// #pragma omp simd collapse(3) |
1080 | | /// \endcode |
1081 | | /// In this example directive '#pragma omp simd' has clause 'collapse' |
1082 | | /// with single expression '3'. |
1083 | | /// The parameter must be a constant positive integer expression, it specifies |
1084 | | /// the number of nested loops that should be collapsed into a single iteration |
1085 | | /// space. |
1086 | | class OMPCollapseClause : public OMPClause { |
1087 | | friend class OMPClauseReader; |
1088 | | |
1089 | | /// Location of '('. |
1090 | | SourceLocation LParenLoc; |
1091 | | |
1092 | | /// Number of for-loops. |
1093 | | Stmt *NumForLoops = nullptr; |
1094 | | |
1095 | | /// Set the number of associated for-loops. |
1096 | 437 | void setNumForLoops(Expr *Num) { NumForLoops = Num; } |
1097 | | |
1098 | | public: |
1099 | | /// Build 'collapse' clause. |
1100 | | /// |
1101 | | /// \param Num Expression associated with this clause. |
1102 | | /// \param StartLoc Starting location of the clause. |
1103 | | /// \param LParenLoc Location of '('. |
1104 | | /// \param EndLoc Ending location of the clause. |
1105 | | OMPCollapseClause(Expr *Num, SourceLocation StartLoc, |
1106 | | SourceLocation LParenLoc, SourceLocation EndLoc) |
1107 | | : OMPClause(llvm::omp::OMPC_collapse, StartLoc, EndLoc), |
1108 | 6.13k | LParenLoc(LParenLoc), NumForLoops(Num) {} |
1109 | | |
1110 | | /// Build an empty clause. |
1111 | | explicit OMPCollapseClause() |
1112 | | : OMPClause(llvm::omp::OMPC_collapse, SourceLocation(), |
1113 | 437 | SourceLocation()) {} |
1114 | | |
1115 | | /// Sets the location of '('. |
1116 | 437 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
1117 | | |
1118 | | /// Returns the location of '('. |
1119 | 3.80k | SourceLocation getLParenLoc() const { return LParenLoc; } |
1120 | | |
1121 | | /// Return the number of associated for-loops. |
1122 | 10.6k | Expr *getNumForLoops() const { return cast_or_null<Expr>(NumForLoops); } |
1123 | | |
1124 | 862 | child_range children() { return child_range(&NumForLoops, &NumForLoops + 1); } |
1125 | | |
1126 | 0 | const_child_range children() const { |
1127 | 0 | return const_child_range(&NumForLoops, &NumForLoops + 1); |
1128 | 0 | } |
1129 | | |
1130 | 1.36k | child_range used_children() { |
1131 | 1.36k | return child_range(child_iterator(), child_iterator()); |
1132 | 1.36k | } |
1133 | 0 | const_child_range used_children() const { |
1134 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1135 | 0 | } |
1136 | | |
1137 | 128k | static bool classof(const OMPClause *T) { |
1138 | 128k | return T->getClauseKind() == llvm::omp::OMPC_collapse; |
1139 | 128k | } |
1140 | | }; |
1141 | | |
1142 | | /// This represents 'default' clause in the '#pragma omp ...' directive. |
1143 | | /// |
1144 | | /// \code |
1145 | | /// #pragma omp parallel default(shared) |
1146 | | /// \endcode |
1147 | | /// In this example directive '#pragma omp parallel' has simple 'default' |
1148 | | /// clause with kind 'shared'. |
1149 | | class OMPDefaultClause : public OMPClause { |
1150 | | friend class OMPClauseReader; |
1151 | | |
1152 | | /// Location of '('. |
1153 | | SourceLocation LParenLoc; |
1154 | | |
1155 | | /// A kind of the 'default' clause. |
1156 | | llvm::omp::DefaultKind Kind = llvm::omp::OMP_DEFAULT_unknown; |
1157 | | |
1158 | | /// Start location of the kind in source code. |
1159 | | SourceLocation KindKwLoc; |
1160 | | |
1161 | | /// Set kind of the clauses. |
1162 | | /// |
1163 | | /// \param K Argument of clause. |
1164 | 310 | void setDefaultKind(llvm::omp::DefaultKind K) { Kind = K; } |
1165 | | |
1166 | | /// Set argument location. |
1167 | | /// |
1168 | | /// \param KLoc Argument location. |
1169 | 310 | void setDefaultKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; } |
1170 | | |
1171 | | public: |
1172 | | /// Build 'default' clause with argument \a A ('none' or 'shared'). |
1173 | | /// |
1174 | | /// \param A Argument of the clause ('none' or 'shared'). |
1175 | | /// \param ALoc Starting location of the argument. |
1176 | | /// \param StartLoc Starting location of the clause. |
1177 | | /// \param LParenLoc Location of '('. |
1178 | | /// \param EndLoc Ending location of the clause. |
1179 | | OMPDefaultClause(llvm::omp::DefaultKind A, SourceLocation ALoc, |
1180 | | SourceLocation StartLoc, SourceLocation LParenLoc, |
1181 | | SourceLocation EndLoc) |
1182 | | : OMPClause(llvm::omp::OMPC_default, StartLoc, EndLoc), |
1183 | 2.17k | LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {} |
1184 | | |
1185 | | /// Build an empty clause. |
1186 | | OMPDefaultClause() |
1187 | 310 | : OMPClause(llvm::omp::OMPC_default, SourceLocation(), SourceLocation()) { |
1188 | 310 | } |
1189 | | |
1190 | | /// Sets the location of '('. |
1191 | 310 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
1192 | | |
1193 | | /// Returns the location of '('. |
1194 | 814 | SourceLocation getLParenLoc() const { return LParenLoc; } |
1195 | | |
1196 | | /// Returns kind of the clause. |
1197 | 1.92k | llvm::omp::DefaultKind getDefaultKind() const { return Kind; } |
1198 | | |
1199 | | /// Returns location of clause kind. |
1200 | 814 | SourceLocation getDefaultKindKwLoc() const { return KindKwLoc; } |
1201 | | |
1202 | 643 | child_range children() { |
1203 | 643 | return child_range(child_iterator(), child_iterator()); |
1204 | 643 | } |
1205 | | |
1206 | 0 | const_child_range children() const { |
1207 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1208 | 0 | } |
1209 | | |
1210 | 1.08k | child_range used_children() { |
1211 | 1.08k | return child_range(child_iterator(), child_iterator()); |
1212 | 1.08k | } |
1213 | 0 | const_child_range used_children() const { |
1214 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1215 | 0 | } |
1216 | | |
1217 | 756 | static bool classof(const OMPClause *T) { |
1218 | 756 | return T->getClauseKind() == llvm::omp::OMPC_default; |
1219 | 756 | } |
1220 | | }; |
1221 | | |
1222 | | /// This represents 'proc_bind' clause in the '#pragma omp ...' |
1223 | | /// directive. |
1224 | | /// |
1225 | | /// \code |
1226 | | /// #pragma omp parallel proc_bind(master) |
1227 | | /// \endcode |
1228 | | /// In this example directive '#pragma omp parallel' has simple 'proc_bind' |
1229 | | /// clause with kind 'master'. |
1230 | | class OMPProcBindClause : public OMPClause { |
1231 | | friend class OMPClauseReader; |
1232 | | |
1233 | | /// Location of '('. |
1234 | | SourceLocation LParenLoc; |
1235 | | |
1236 | | /// A kind of the 'proc_bind' clause. |
1237 | | llvm::omp::ProcBindKind Kind = llvm::omp::OMP_PROC_BIND_unknown; |
1238 | | |
1239 | | /// Start location of the kind in source code. |
1240 | | SourceLocation KindKwLoc; |
1241 | | |
1242 | | /// Set kind of the clause. |
1243 | | /// |
1244 | | /// \param K Kind of clause. |
1245 | 116 | void setProcBindKind(llvm::omp::ProcBindKind K) { Kind = K; } |
1246 | | |
1247 | | /// Set clause kind location. |
1248 | | /// |
1249 | | /// \param KLoc Kind location. |
1250 | 116 | void setProcBindKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; } |
1251 | | |
1252 | | public: |
1253 | | /// Build 'proc_bind' clause with argument \a A ('master', 'close' or |
1254 | | /// 'spread'). |
1255 | | /// |
1256 | | /// \param A Argument of the clause ('master', 'close' or 'spread'). |
1257 | | /// \param ALoc Starting location of the argument. |
1258 | | /// \param StartLoc Starting location of the clause. |
1259 | | /// \param LParenLoc Location of '('. |
1260 | | /// \param EndLoc Ending location of the clause. |
1261 | | OMPProcBindClause(llvm::omp::ProcBindKind A, SourceLocation ALoc, |
1262 | | SourceLocation StartLoc, SourceLocation LParenLoc, |
1263 | | SourceLocation EndLoc) |
1264 | | : OMPClause(llvm::omp::OMPC_proc_bind, StartLoc, EndLoc), |
1265 | 836 | LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {} |
1266 | | |
1267 | | /// Build an empty clause. |
1268 | | OMPProcBindClause() |
1269 | | : OMPClause(llvm::omp::OMPC_proc_bind, SourceLocation(), |
1270 | 116 | SourceLocation()) {} |
1271 | | |
1272 | | /// Sets the location of '('. |
1273 | 116 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
1274 | | |
1275 | | /// Returns the location of '('. |
1276 | 391 | SourceLocation getLParenLoc() const { return LParenLoc; } |
1277 | | |
1278 | | /// Returns kind of the clause. |
1279 | 754 | llvm::omp::ProcBindKind getProcBindKind() const { return Kind; } |
1280 | | |
1281 | | /// Returns location of clause kind. |
1282 | 391 | SourceLocation getProcBindKindKwLoc() const { return KindKwLoc; } |
1283 | | |
1284 | 152 | child_range children() { |
1285 | 152 | return child_range(child_iterator(), child_iterator()); |
1286 | 152 | } |
1287 | | |
1288 | 0 | const_child_range children() const { |
1289 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1290 | 0 | } |
1291 | | |
1292 | 856 | child_range used_children() { |
1293 | 856 | return child_range(child_iterator(), child_iterator()); |
1294 | 856 | } |
1295 | 0 | const_child_range used_children() const { |
1296 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1297 | 0 | } |
1298 | | |
1299 | 8.11k | static bool classof(const OMPClause *T) { |
1300 | 8.11k | return T->getClauseKind() == llvm::omp::OMPC_proc_bind; |
1301 | 8.11k | } |
1302 | | }; |
1303 | | |
1304 | | /// This represents 'unified_address' clause in the '#pragma omp requires' |
1305 | | /// directive. |
1306 | | /// |
1307 | | /// \code |
1308 | | /// #pragma omp requires unified_address |
1309 | | /// \endcode |
1310 | | /// In this example directive '#pragma omp requires' has 'unified_address' |
1311 | | /// clause. |
1312 | | class OMPUnifiedAddressClause final : public OMPClause { |
1313 | | public: |
1314 | | friend class OMPClauseReader; |
1315 | | /// Build 'unified_address' clause. |
1316 | | /// |
1317 | | /// \param StartLoc Starting location of the clause. |
1318 | | /// \param EndLoc Ending location of the clause. |
1319 | | OMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc) |
1320 | 27 | : OMPClause(llvm::omp::OMPC_unified_address, StartLoc, EndLoc) {} |
1321 | | |
1322 | | /// Build an empty clause. |
1323 | | OMPUnifiedAddressClause() |
1324 | | : OMPClause(llvm::omp::OMPC_unified_address, SourceLocation(), |
1325 | 4 | SourceLocation()) {} |
1326 | | |
1327 | 0 | child_range children() { |
1328 | 0 | return child_range(child_iterator(), child_iterator()); |
1329 | 0 | } |
1330 | | |
1331 | 0 | const_child_range children() const { |
1332 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1333 | 0 | } |
1334 | | |
1335 | 0 | child_range used_children() { |
1336 | 0 | return child_range(child_iterator(), child_iterator()); |
1337 | 0 | } |
1338 | 0 | const_child_range used_children() const { |
1339 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1340 | 0 | } |
1341 | | |
1342 | 5.32k | static bool classof(const OMPClause *T) { |
1343 | 5.32k | return T->getClauseKind() == llvm::omp::OMPC_unified_address; |
1344 | 5.32k | } |
1345 | | }; |
1346 | | |
1347 | | /// This represents 'unified_shared_memory' clause in the '#pragma omp requires' |
1348 | | /// directive. |
1349 | | /// |
1350 | | /// \code |
1351 | | /// #pragma omp requires unified_shared_memory |
1352 | | /// \endcode |
1353 | | /// In this example directive '#pragma omp requires' has 'unified_shared_memory' |
1354 | | /// clause. |
1355 | | class OMPUnifiedSharedMemoryClause final : public OMPClause { |
1356 | | public: |
1357 | | friend class OMPClauseReader; |
1358 | | /// Build 'unified_shared_memory' clause. |
1359 | | /// |
1360 | | /// \param StartLoc Starting location of the clause. |
1361 | | /// \param EndLoc Ending location of the clause. |
1362 | | OMPUnifiedSharedMemoryClause(SourceLocation StartLoc, SourceLocation EndLoc) |
1363 | 39 | : OMPClause(llvm::omp::OMPC_unified_shared_memory, StartLoc, EndLoc) {} |
1364 | | |
1365 | | /// Build an empty clause. |
1366 | | OMPUnifiedSharedMemoryClause() |
1367 | | : OMPClause(llvm::omp::OMPC_unified_shared_memory, SourceLocation(), |
1368 | 4 | SourceLocation()) {} |
1369 | | |
1370 | 0 | child_range children() { |
1371 | 0 | return child_range(child_iterator(), child_iterator()); |
1372 | 0 | } |
1373 | | |
1374 | 0 | const_child_range children() const { |
1375 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1376 | 0 | } |
1377 | | |
1378 | 0 | child_range used_children() { |
1379 | 0 | return child_range(child_iterator(), child_iterator()); |
1380 | 0 | } |
1381 | 0 | const_child_range used_children() const { |
1382 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1383 | 0 | } |
1384 | | |
1385 | 5.34k | static bool classof(const OMPClause *T) { |
1386 | 5.34k | return T->getClauseKind() == llvm::omp::OMPC_unified_shared_memory; |
1387 | 5.34k | } |
1388 | | }; |
1389 | | |
1390 | | /// This represents 'reverse_offload' clause in the '#pragma omp requires' |
1391 | | /// directive. |
1392 | | /// |
1393 | | /// \code |
1394 | | /// #pragma omp requires reverse_offload |
1395 | | /// \endcode |
1396 | | /// In this example directive '#pragma omp requires' has 'reverse_offload' |
1397 | | /// clause. |
1398 | | class OMPReverseOffloadClause final : public OMPClause { |
1399 | | public: |
1400 | | friend class OMPClauseReader; |
1401 | | /// Build 'reverse_offload' clause. |
1402 | | /// |
1403 | | /// \param StartLoc Starting location of the clause. |
1404 | | /// \param EndLoc Ending location of the clause. |
1405 | | OMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc) |
1406 | 17 | : OMPClause(llvm::omp::OMPC_reverse_offload, StartLoc, EndLoc) {} |
1407 | | |
1408 | | /// Build an empty clause. |
1409 | | OMPReverseOffloadClause() |
1410 | | : OMPClause(llvm::omp::OMPC_reverse_offload, SourceLocation(), |
1411 | 6 | SourceLocation()) {} |
1412 | | |
1413 | 0 | child_range children() { |
1414 | 0 | return child_range(child_iterator(), child_iterator()); |
1415 | 0 | } |
1416 | | |
1417 | 0 | const_child_range children() const { |
1418 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1419 | 0 | } |
1420 | | |
1421 | 0 | child_range used_children() { |
1422 | 0 | return child_range(child_iterator(), child_iterator()); |
1423 | 0 | } |
1424 | 0 | const_child_range used_children() const { |
1425 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1426 | 0 | } |
1427 | | |
1428 | 5.33k | static bool classof(const OMPClause *T) { |
1429 | 5.33k | return T->getClauseKind() == llvm::omp::OMPC_reverse_offload; |
1430 | 5.33k | } |
1431 | | }; |
1432 | | |
1433 | | /// This represents 'dynamic_allocators' clause in the '#pragma omp requires' |
1434 | | /// directive. |
1435 | | /// |
1436 | | /// \code |
1437 | | /// #pragma omp requires dynamic_allocators |
1438 | | /// \endcode |
1439 | | /// In this example directive '#pragma omp requires' has 'dynamic_allocators' |
1440 | | /// clause. |
1441 | | class OMPDynamicAllocatorsClause final : public OMPClause { |
1442 | | public: |
1443 | | friend class OMPClauseReader; |
1444 | | /// Build 'dynamic_allocators' clause. |
1445 | | /// |
1446 | | /// \param StartLoc Starting location of the clause. |
1447 | | /// \param EndLoc Ending location of the clause. |
1448 | | OMPDynamicAllocatorsClause(SourceLocation StartLoc, SourceLocation EndLoc) |
1449 | 99 | : OMPClause(llvm::omp::OMPC_dynamic_allocators, StartLoc, EndLoc) {} |
1450 | | |
1451 | | /// Build an empty clause. |
1452 | | OMPDynamicAllocatorsClause() |
1453 | | : OMPClause(llvm::omp::OMPC_dynamic_allocators, SourceLocation(), |
1454 | 4 | SourceLocation()) {} |
1455 | | |
1456 | 0 | child_range children() { |
1457 | 0 | return child_range(child_iterator(), child_iterator()); |
1458 | 0 | } |
1459 | | |
1460 | 0 | const_child_range children() const { |
1461 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1462 | 0 | } |
1463 | | |
1464 | 0 | child_range used_children() { |
1465 | 0 | return child_range(child_iterator(), child_iterator()); |
1466 | 0 | } |
1467 | 0 | const_child_range used_children() const { |
1468 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1469 | 0 | } |
1470 | | |
1471 | 4.96k | static bool classof(const OMPClause *T) { |
1472 | 4.96k | return T->getClauseKind() == llvm::omp::OMPC_dynamic_allocators; |
1473 | 4.96k | } |
1474 | | }; |
1475 | | |
1476 | | /// This represents 'atomic_default_mem_order' clause in the '#pragma omp |
1477 | | /// requires' directive. |
1478 | | /// |
1479 | | /// \code |
1480 | | /// #pragma omp requires atomic_default_mem_order(seq_cst) |
1481 | | /// \endcode |
1482 | | /// In this example directive '#pragma omp requires' has simple |
1483 | | /// atomic_default_mem_order' clause with kind 'seq_cst'. |
1484 | | class OMPAtomicDefaultMemOrderClause final : public OMPClause { |
1485 | | friend class OMPClauseReader; |
1486 | | |
1487 | | /// Location of '(' |
1488 | | SourceLocation LParenLoc; |
1489 | | |
1490 | | /// A kind of the 'atomic_default_mem_order' clause. |
1491 | | OpenMPAtomicDefaultMemOrderClauseKind Kind = |
1492 | | OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown; |
1493 | | |
1494 | | /// Start location of the kind in source code. |
1495 | | SourceLocation KindKwLoc; |
1496 | | |
1497 | | /// Set kind of the clause. |
1498 | | /// |
1499 | | /// \param K Kind of clause. |
1500 | 14 | void setAtomicDefaultMemOrderKind(OpenMPAtomicDefaultMemOrderClauseKind K) { |
1501 | 14 | Kind = K; |
1502 | 14 | } |
1503 | | |
1504 | | /// Set clause kind location. |
1505 | | /// |
1506 | | /// \param KLoc Kind location. |
1507 | 14 | void setAtomicDefaultMemOrderKindKwLoc(SourceLocation KLoc) { |
1508 | 14 | KindKwLoc = KLoc; |
1509 | 14 | } |
1510 | | |
1511 | | public: |
1512 | | /// Build 'atomic_default_mem_order' clause with argument \a A ('seq_cst', |
1513 | | /// 'acq_rel' or 'relaxed'). |
1514 | | /// |
1515 | | /// \param A Argument of the clause ('seq_cst', 'acq_rel' or 'relaxed'). |
1516 | | /// \param ALoc Starting location of the argument. |
1517 | | /// \param StartLoc Starting location of the clause. |
1518 | | /// \param LParenLoc Location of '('. |
1519 | | /// \param EndLoc Ending location of the clause. |
1520 | | OMPAtomicDefaultMemOrderClause(OpenMPAtomicDefaultMemOrderClauseKind A, |
1521 | | SourceLocation ALoc, SourceLocation StartLoc, |
1522 | | SourceLocation LParenLoc, |
1523 | | SourceLocation EndLoc) |
1524 | | : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, StartLoc, EndLoc), |
1525 | 46 | LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {} |
1526 | | |
1527 | | /// Build an empty clause. |
1528 | | OMPAtomicDefaultMemOrderClause() |
1529 | | : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, SourceLocation(), |
1530 | 14 | SourceLocation()) {} |
1531 | | |
1532 | | /// Sets the location of '('. |
1533 | 14 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
1534 | | |
1535 | | /// Returns the locaiton of '('. |
1536 | 14 | SourceLocation getLParenLoc() const { return LParenLoc; } |
1537 | | |
1538 | | /// Returns kind of the clause. |
1539 | 42 | OpenMPAtomicDefaultMemOrderClauseKind getAtomicDefaultMemOrderKind() const { |
1540 | 42 | return Kind; |
1541 | 42 | } |
1542 | | |
1543 | | /// Returns location of clause kind. |
1544 | 14 | SourceLocation getAtomicDefaultMemOrderKindKwLoc() const { return KindKwLoc; } |
1545 | | |
1546 | 0 | child_range children() { |
1547 | 0 | return child_range(child_iterator(), child_iterator()); |
1548 | 0 | } |
1549 | | |
1550 | 0 | const_child_range children() const { |
1551 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1552 | 0 | } |
1553 | | |
1554 | 0 | child_range used_children() { |
1555 | 0 | return child_range(child_iterator(), child_iterator()); |
1556 | 0 | } |
1557 | 0 | const_child_range used_children() const { |
1558 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1559 | 0 | } |
1560 | | |
1561 | 19 | static bool classof(const OMPClause *T) { |
1562 | 19 | return T->getClauseKind() == llvm::omp::OMPC_atomic_default_mem_order; |
1563 | 19 | } |
1564 | | }; |
1565 | | |
1566 | | /// This represents 'schedule' clause in the '#pragma omp ...' directive. |
1567 | | /// |
1568 | | /// \code |
1569 | | /// #pragma omp for schedule(static, 3) |
1570 | | /// \endcode |
1571 | | /// In this example directive '#pragma omp for' has 'schedule' clause with |
1572 | | /// arguments 'static' and '3'. |
1573 | | class OMPScheduleClause : public OMPClause, public OMPClauseWithPreInit { |
1574 | | friend class OMPClauseReader; |
1575 | | |
1576 | | /// Location of '('. |
1577 | | SourceLocation LParenLoc; |
1578 | | |
1579 | | /// A kind of the 'schedule' clause. |
1580 | | OpenMPScheduleClauseKind Kind = OMPC_SCHEDULE_unknown; |
1581 | | |
1582 | | /// Modifiers for 'schedule' clause. |
1583 | | enum {FIRST, SECOND, NUM_MODIFIERS}; |
1584 | | OpenMPScheduleClauseModifier Modifiers[NUM_MODIFIERS]; |
1585 | | |
1586 | | /// Locations of modifiers. |
1587 | | SourceLocation ModifiersLoc[NUM_MODIFIERS]; |
1588 | | |
1589 | | /// Start location of the schedule ind in source code. |
1590 | | SourceLocation KindLoc; |
1591 | | |
1592 | | /// Location of ',' (if any). |
1593 | | SourceLocation CommaLoc; |
1594 | | |
1595 | | /// Chunk size. |
1596 | | Expr *ChunkSize = nullptr; |
1597 | | |
1598 | | /// Set schedule kind. |
1599 | | /// |
1600 | | /// \param K Schedule kind. |
1601 | 596 | void setScheduleKind(OpenMPScheduleClauseKind K) { Kind = K; } |
1602 | | |
1603 | | /// Set the first schedule modifier. |
1604 | | /// |
1605 | | /// \param M Schedule modifier. |
1606 | 596 | void setFirstScheduleModifier(OpenMPScheduleClauseModifier M) { |
1607 | 596 | Modifiers[FIRST] = M; |
1608 | 596 | } |
1609 | | |
1610 | | /// Set the second schedule modifier. |
1611 | | /// |
1612 | | /// \param M Schedule modifier. |
1613 | 596 | void setSecondScheduleModifier(OpenMPScheduleClauseModifier M) { |
1614 | 596 | Modifiers[SECOND] = M; |
1615 | 596 | } |
1616 | | |
1617 | | /// Set location of the first schedule modifier. |
1618 | 596 | void setFirstScheduleModifierLoc(SourceLocation Loc) { |
1619 | 596 | ModifiersLoc[FIRST] = Loc; |
1620 | 596 | } |
1621 | | |
1622 | | /// Set location of the second schedule modifier. |
1623 | 596 | void setSecondScheduleModifierLoc(SourceLocation Loc) { |
1624 | 596 | ModifiersLoc[SECOND] = Loc; |
1625 | 596 | } |
1626 | | |
1627 | | /// Set schedule modifier location. |
1628 | | /// |
1629 | | /// \param M Schedule modifier location. |
1630 | 0 | void setScheduleModifer(OpenMPScheduleClauseModifier M) { |
1631 | 0 | if (Modifiers[FIRST] == OMPC_SCHEDULE_MODIFIER_unknown) |
1632 | 0 | Modifiers[FIRST] = M; |
1633 | 0 | else { |
1634 | 0 | assert(Modifiers[SECOND] == OMPC_SCHEDULE_MODIFIER_unknown); |
1635 | 0 | Modifiers[SECOND] = M; |
1636 | 0 | } |
1637 | 0 | } |
1638 | | |
1639 | | /// Sets the location of '('. |
1640 | | /// |
1641 | | /// \param Loc Location of '('. |
1642 | 596 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
1643 | | |
1644 | | /// Set schedule kind start location. |
1645 | | /// |
1646 | | /// \param KLoc Schedule kind location. |
1647 | 596 | void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; } |
1648 | | |
1649 | | /// Set location of ','. |
1650 | | /// |
1651 | | /// \param Loc Location of ','. |
1652 | 596 | void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; } |
1653 | | |
1654 | | /// Set chunk size. |
1655 | | /// |
1656 | | /// \param E Chunk size. |
1657 | 596 | void setChunkSize(Expr *E) { ChunkSize = E; } |
1658 | | |
1659 | | public: |
1660 | | /// Build 'schedule' clause with schedule kind \a Kind and chunk size |
1661 | | /// expression \a ChunkSize. |
1662 | | /// |
1663 | | /// \param StartLoc Starting location of the clause. |
1664 | | /// \param LParenLoc Location of '('. |
1665 | | /// \param KLoc Starting location of the argument. |
1666 | | /// \param CommaLoc Location of ','. |
1667 | | /// \param EndLoc Ending location of the clause. |
1668 | | /// \param Kind Schedule kind. |
1669 | | /// \param ChunkSize Chunk size. |
1670 | | /// \param HelperChunkSize Helper chunk size for combined directives. |
1671 | | /// \param M1 The first modifier applied to 'schedule' clause. |
1672 | | /// \param M1Loc Location of the first modifier |
1673 | | /// \param M2 The second modifier applied to 'schedule' clause. |
1674 | | /// \param M2Loc Location of the second modifier |
1675 | | OMPScheduleClause(SourceLocation StartLoc, SourceLocation LParenLoc, |
1676 | | SourceLocation KLoc, SourceLocation CommaLoc, |
1677 | | SourceLocation EndLoc, OpenMPScheduleClauseKind Kind, |
1678 | | Expr *ChunkSize, Stmt *HelperChunkSize, |
1679 | | OpenMPScheduleClauseModifier M1, SourceLocation M1Loc, |
1680 | | OpenMPScheduleClauseModifier M2, SourceLocation M2Loc) |
1681 | | : OMPClause(llvm::omp::OMPC_schedule, StartLoc, EndLoc), |
1682 | | OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Kind(Kind), |
1683 | 3.68k | KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) { |
1684 | 3.68k | setPreInitStmt(HelperChunkSize); |
1685 | 3.68k | Modifiers[FIRST] = M1; |
1686 | 3.68k | Modifiers[SECOND] = M2; |
1687 | 3.68k | ModifiersLoc[FIRST] = M1Loc; |
1688 | 3.68k | ModifiersLoc[SECOND] = M2Loc; |
1689 | 3.68k | } |
1690 | | |
1691 | | /// Build an empty clause. |
1692 | | explicit OMPScheduleClause() |
1693 | | : OMPClause(llvm::omp::OMPC_schedule, SourceLocation(), SourceLocation()), |
1694 | 596 | OMPClauseWithPreInit(this) { |
1695 | 596 | Modifiers[FIRST] = OMPC_SCHEDULE_MODIFIER_unknown; |
1696 | 596 | Modifiers[SECOND] = OMPC_SCHEDULE_MODIFIER_unknown; |
1697 | 596 | } |
1698 | | |
1699 | | /// Get kind of the clause. |
1700 | 3.70k | OpenMPScheduleClauseKind getScheduleKind() const { return Kind; } |
1701 | | |
1702 | | /// Get the first modifier of the clause. |
1703 | 7.29k | OpenMPScheduleClauseModifier getFirstScheduleModifier() const { |
1704 | 7.29k | return Modifiers[FIRST]; |
1705 | 7.29k | } |
1706 | | |
1707 | | /// Get the second modifier of the clause. |
1708 | 6.75k | OpenMPScheduleClauseModifier getSecondScheduleModifier() const { |
1709 | 6.75k | return Modifiers[SECOND]; |
1710 | 6.75k | } |
1711 | | |
1712 | | /// Get location of '('. |
1713 | 1.86k | SourceLocation getLParenLoc() { return LParenLoc; } |
1714 | | |
1715 | | /// Get kind location. |
1716 | 1.86k | SourceLocation getScheduleKindLoc() { return KindLoc; } |
1717 | | |
1718 | | /// Get the first modifier location. |
1719 | 1.87k | SourceLocation getFirstScheduleModifierLoc() const { |
1720 | 1.87k | return ModifiersLoc[FIRST]; |
1721 | 1.87k | } |
1722 | | |
1723 | | /// Get the second modifier location. |
1724 | 1.86k | SourceLocation getSecondScheduleModifierLoc() const { |
1725 | 1.86k | return ModifiersLoc[SECOND]; |
1726 | 1.86k | } |
1727 | | |
1728 | | /// Get location of ','. |
1729 | 1.86k | SourceLocation getCommaLoc() { return CommaLoc; } |
1730 | | |
1731 | | /// Get chunk size. |
1732 | 2.28k | Expr *getChunkSize() { return ChunkSize; } |
1733 | | |
1734 | | /// Get chunk size. |
1735 | 1.56k | const Expr *getChunkSize() const { return ChunkSize; } |
1736 | | |
1737 | 1.24k | child_range children() { |
1738 | 1.24k | return child_range(reinterpret_cast<Stmt **>(&ChunkSize), |
1739 | 1.24k | reinterpret_cast<Stmt **>(&ChunkSize) + 1); |
1740 | 1.24k | } |
1741 | | |
1742 | 0 | const_child_range children() const { |
1743 | 0 | auto Children = const_cast<OMPScheduleClause *>(this)->children(); |
1744 | 0 | return const_child_range(Children.begin(), Children.end()); |
1745 | 0 | } |
1746 | | |
1747 | 2.24k | child_range used_children() { |
1748 | 2.24k | return child_range(child_iterator(), child_iterator()); |
1749 | 2.24k | } |
1750 | 0 | const_child_range used_children() const { |
1751 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1752 | 0 | } |
1753 | | |
1754 | 13.1k | static bool classof(const OMPClause *T) { |
1755 | 13.1k | return T->getClauseKind() == llvm::omp::OMPC_schedule; |
1756 | 13.1k | } |
1757 | | }; |
1758 | | |
1759 | | /// This represents 'ordered' clause in the '#pragma omp ...' directive. |
1760 | | /// |
1761 | | /// \code |
1762 | | /// #pragma omp for ordered (2) |
1763 | | /// \endcode |
1764 | | /// In this example directive '#pragma omp for' has 'ordered' clause with |
1765 | | /// parameter 2. |
1766 | | class OMPOrderedClause final |
1767 | | : public OMPClause, |
1768 | | private llvm::TrailingObjects<OMPOrderedClause, Expr *> { |
1769 | | friend class OMPClauseReader; |
1770 | | friend TrailingObjects; |
1771 | | |
1772 | | /// Location of '('. |
1773 | | SourceLocation LParenLoc; |
1774 | | |
1775 | | /// Number of for-loops. |
1776 | | Stmt *NumForLoops = nullptr; |
1777 | | |
1778 | | /// Real number of loops. |
1779 | | unsigned NumberOfLoops = 0; |
1780 | | |
1781 | | /// Build 'ordered' clause. |
1782 | | /// |
1783 | | /// \param Num Expression, possibly associated with this clause. |
1784 | | /// \param NumLoops Number of loops, associated with this clause. |
1785 | | /// \param StartLoc Starting location of the clause. |
1786 | | /// \param LParenLoc Location of '('. |
1787 | | /// \param EndLoc Ending location of the clause. |
1788 | | OMPOrderedClause(Expr *Num, unsigned NumLoops, SourceLocation StartLoc, |
1789 | | SourceLocation LParenLoc, SourceLocation EndLoc) |
1790 | | : OMPClause(llvm::omp::OMPC_ordered, StartLoc, EndLoc), |
1791 | 1.19k | LParenLoc(LParenLoc), NumForLoops(Num), NumberOfLoops(NumLoops) {} |
1792 | | |
1793 | | /// Build an empty clause. |
1794 | | explicit OMPOrderedClause(unsigned NumLoops) |
1795 | | : OMPClause(llvm::omp::OMPC_ordered, SourceLocation(), SourceLocation()), |
1796 | 89 | NumberOfLoops(NumLoops) {} |
1797 | | |
1798 | | /// Set the number of associated for-loops. |
1799 | 89 | void setNumForLoops(Expr *Num) { NumForLoops = Num; } |
1800 | | |
1801 | | public: |
1802 | | /// Build 'ordered' clause. |
1803 | | /// |
1804 | | /// \param Num Expression, possibly associated with this clause. |
1805 | | /// \param NumLoops Number of loops, associated with this clause. |
1806 | | /// \param StartLoc Starting location of the clause. |
1807 | | /// \param LParenLoc Location of '('. |
1808 | | /// \param EndLoc Ending location of the clause. |
1809 | | static OMPOrderedClause *Create(const ASTContext &C, Expr *Num, |
1810 | | unsigned NumLoops, SourceLocation StartLoc, |
1811 | | SourceLocation LParenLoc, |
1812 | | SourceLocation EndLoc); |
1813 | | |
1814 | | /// Build an empty clause. |
1815 | | static OMPOrderedClause* CreateEmpty(const ASTContext &C, unsigned NumLoops); |
1816 | | |
1817 | | /// Sets the location of '('. |
1818 | 89 | void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } |
1819 | | |
1820 | | /// Returns the location of '('. |
1821 | 596 | SourceLocation getLParenLoc() const { return LParenLoc; } |
1822 | | |
1823 | | /// Return the number of associated for-loops. |
1824 | 3.25k | Expr *getNumForLoops() const { return cast_or_null<Expr>(NumForLoops); } |
1825 | | |
1826 | | /// Set number of iterations for the specified loop. |
1827 | | void setLoopNumIterations(unsigned NumLoop, Expr *NumIterations); |
1828 | | /// Get number of iterations for all the loops. |
1829 | | ArrayRef<Expr *> getLoopNumIterations() const; |
1830 | | |
1831 | | /// Set loop counter for the specified loop. |
1832 | | void setLoopCounter(unsigned NumLoop, Expr *Counter); |
1833 | | /// Get loops counter for the specified loop. |
1834 | | Expr *getLoopCounter(unsigned NumLoop); |
1835 | | const Expr *getLoopCounter(unsigned NumLoop) const; |
1836 | | |
1837 | 64 | child_range children() { return child_range(&NumForLoops, &NumForLoops + 1); } |
1838 | | |
1839 | 0 | const_child_range children() const { |
1840 | 0 | return const_child_range(&NumForLoops, &NumForLoops + 1); |
1841 | 0 | } |
1842 | | |
1843 | 204 | child_range used_children() { |
1844 | 204 | return child_range(child_iterator(), child_iterator()); |
1845 | 204 | } |
1846 | 0 | const_child_range used_children() const { |
1847 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1848 | 0 | } |
1849 | | |
1850 | 84.3k | static bool classof(const OMPClause *T) { |
1851 | 84.3k | return T->getClauseKind() == llvm::omp::OMPC_ordered; |
1852 | 84.3k | } |
1853 | | }; |
1854 | | |
1855 | | /// This represents 'nowait' clause in the '#pragma omp ...' directive. |
1856 | | /// |
1857 | | /// \code |
1858 | | /// #pragma omp for nowait |
1859 | | /// \endcode |
1860 | | /// In this example directive '#pragma omp for' has 'nowait' clause. |
1861 | | class OMPNowaitClause : public OMPClause { |
1862 | | public: |
1863 | | /// Build 'nowait' clause. |
1864 | | /// |
1865 | | /// \param StartLoc Starting location of the clause. |
1866 | | /// \param EndLoc Ending location of the clause. |
1867 | | OMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc) |
1868 | 1.54k | : OMPClause(llvm::omp::OMPC_nowait, StartLoc, EndLoc) {} |
1869 | | |
1870 | | /// Build an empty clause. |
1871 | | OMPNowaitClause() |
1872 | 599 | : OMPClause(llvm::omp::OMPC_nowait, SourceLocation(), SourceLocation()) {} |
1873 | | |
1874 | 64 | child_range children() { |
1875 | 64 | return child_range(child_iterator(), child_iterator()); |
1876 | 64 | } |
1877 | | |
1878 | 0 | const_child_range children() const { |
1879 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1880 | 0 | } |
1881 | | |
1882 | 3.41k | child_range used_children() { |
1883 | 3.41k | return child_range(child_iterator(), child_iterator()); |
1884 | 3.41k | } |
1885 | 0 | const_child_range used_children() const { |
1886 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1887 | 0 | } |
1888 | | |
1889 | 30.3k | static bool classof(const OMPClause *T) { |
1890 | 30.3k | return T->getClauseKind() == llvm::omp::OMPC_nowait; |
1891 | 30.3k | } |
1892 | | }; |
1893 | | |
1894 | | /// This represents 'untied' clause in the '#pragma omp ...' directive. |
1895 | | /// |
1896 | | /// \code |
1897 | | /// #pragma omp task untied |
1898 | | /// \endcode |
1899 | | /// In this example directive '#pragma omp task' has 'untied' clause. |
1900 | | class OMPUntiedClause : public OMPClause { |
1901 | | public: |
1902 | | /// Build 'untied' clause. |
1903 | | /// |
1904 | | /// \param StartLoc Starting location of the clause. |
1905 | | /// \param EndLoc Ending location of the clause. |
1906 | | OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc) |
1907 | 146 | : OMPClause(llvm::omp::OMPC_untied, StartLoc, EndLoc) {} |
1908 | | |
1909 | | /// Build an empty clause. |
1910 | | OMPUntiedClause() |
1911 | 58 | : OMPClause(llvm::omp::OMPC_untied, SourceLocation(), SourceLocation()) {} |
1912 | | |
1913 | 120 | child_range children() { |
1914 | 120 | return child_range(child_iterator(), child_iterator()); |
1915 | 120 | } |
1916 | | |
1917 | 0 | const_child_range children() const { |
1918 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1919 | 0 | } |
1920 | | |
1921 | 504 | child_range used_children() { |
1922 | 504 | return child_range(child_iterator(), child_iterator()); |
1923 | 504 | } |
1924 | 0 | const_child_range used_children() const { |
1925 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1926 | 0 | } |
1927 | | |
1928 | 514 | static bool classof(const OMPClause *T) { |
1929 | 514 | return T->getClauseKind() == llvm::omp::OMPC_untied; |
1930 | 514 | } |
1931 | | }; |
1932 | | |
1933 | | /// This represents 'mergeable' clause in the '#pragma omp ...' |
1934 | | /// directive. |
1935 | | /// |
1936 | | /// \code |
1937 | | /// #pragma omp task mergeable |
1938 | | /// \endcode |
1939 | | /// In this example directive '#pragma omp task' has 'mergeable' clause. |
1940 | | class OMPMergeableClause : public OMPClause { |
1941 | | public: |
1942 | | /// Build 'mergeable' clause. |
1943 | | /// |
1944 | | /// \param StartLoc Starting location of the clause. |
1945 | | /// \param EndLoc Ending location of the clause. |
1946 | | OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc) |
1947 | 176 | : OMPClause(llvm::omp::OMPC_mergeable, StartLoc, EndLoc) {} |
1948 | | |
1949 | | /// Build an empty clause. |
1950 | | OMPMergeableClause() |
1951 | | : OMPClause(llvm::omp::OMPC_mergeable, SourceLocation(), |
1952 | 64 | SourceLocation()) {} |
1953 | | |
1954 | 194 | child_range children() { |
1955 | 194 | return child_range(child_iterator(), child_iterator()); |
1956 | 194 | } |
1957 | | |
1958 | 0 | const_child_range children() const { |
1959 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1960 | 0 | } |
1961 | | |
1962 | 520 | child_range used_children() { |
1963 | 520 | return child_range(child_iterator(), child_iterator()); |
1964 | 520 | } |
1965 | 0 | const_child_range used_children() const { |
1966 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1967 | 0 | } |
1968 | | |
1969 | 148 | static bool classof(const OMPClause *T) { |
1970 | 148 | return T->getClauseKind() == llvm::omp::OMPC_mergeable; |
1971 | 148 | } |
1972 | | }; |
1973 | | |
1974 | | /// This represents 'read' clause in the '#pragma omp atomic' directive. |
1975 | | /// |
1976 | | /// \code |
1977 | | /// #pragma omp atomic read |
1978 | | /// \endcode |
1979 | | /// In this example directive '#pragma omp atomic' has 'read' clause. |
1980 | | class OMPReadClause : public OMPClause { |
1981 | | public: |
1982 | | /// Build 'read' clause. |
1983 | | /// |
1984 | | /// \param StartLoc Starting location of the clause. |
1985 | | /// \param EndLoc Ending location of the clause. |
1986 | | OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc) |
1987 | 531 | : OMPClause(llvm::omp::OMPC_read, StartLoc, EndLoc) {} |
1988 | | |
1989 | | /// Build an empty clause. |
1990 | | OMPReadClause() |
1991 | 156 | : OMPClause(llvm::omp::OMPC_read, SourceLocation(), SourceLocation()) {} |
1992 | | |
1993 | 16 | child_range children() { |
1994 | 16 | return child_range(child_iterator(), child_iterator()); |
1995 | 16 | } |
1996 | | |
1997 | 0 | const_child_range children() const { |
1998 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
1999 | 0 | } |
2000 | | |
2001 | 164 | child_range used_children() { |
2002 | 164 | return child_range(child_iterator(), child_iterator()); |
2003 | 164 | } |
2004 | 0 | const_child_range used_children() const { |
2005 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2006 | 0 | } |
2007 | | |
2008 | 124 | static bool classof(const OMPClause *T) { |
2009 | 124 | return T->getClauseKind() == llvm::omp::OMPC_read; |
2010 | 124 | } |
2011 | | }; |
2012 | | |
2013 | | /// This represents 'write' clause in the '#pragma omp atomic' directive. |
2014 | | /// |
2015 | | /// \code |
2016 | | /// #pragma omp atomic write |
2017 | | /// \endcode |
2018 | | /// In this example directive '#pragma omp atomic' has 'write' clause. |
2019 | | class OMPWriteClause : public OMPClause { |
2020 | | public: |
2021 | | /// Build 'write' clause. |
2022 | | /// |
2023 | | /// \param StartLoc Starting location of the clause. |
2024 | | /// \param EndLoc Ending location of the clause. |
2025 | | OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc) |
2026 | 522 | : OMPClause(llvm::omp::OMPC_write, StartLoc, EndLoc) {} |
2027 | | |
2028 | | /// Build an empty clause. |
2029 | | OMPWriteClause() |
2030 | 158 | : OMPClause(llvm::omp::OMPC_write, SourceLocation(), SourceLocation()) {} |
2031 | | |
2032 | 16 | child_range children() { |
2033 | 16 | return child_range(child_iterator(), child_iterator()); |
2034 | 16 | } |
2035 | | |
2036 | 0 | const_child_range children() const { |
2037 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2038 | 0 | } |
2039 | | |
2040 | 112 | child_range used_children() { |
2041 | 112 | return child_range(child_iterator(), child_iterator()); |
2042 | 112 | } |
2043 | 0 | const_child_range used_children() const { |
2044 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2045 | 0 | } |
2046 | | |
2047 | 94 | static bool classof(const OMPClause *T) { |
2048 | 94 | return T->getClauseKind() == llvm::omp::OMPC_write; |
2049 | 94 | } |
2050 | | }; |
2051 | | |
2052 | | /// This represents 'update' clause in the '#pragma omp atomic' |
2053 | | /// directive. |
2054 | | /// |
2055 | | /// \code |
2056 | | /// #pragma omp atomic update |
2057 | | /// \endcode |
2058 | | /// In this example directive '#pragma omp atomic' has 'update' clause. |
2059 | | /// Also, this class represents 'update' clause in '#pragma omp depobj' |
2060 | | /// directive. |
2061 | | /// |
2062 | | /// \code |
2063 | | /// #pragma omp depobj(a) update(in) |
2064 | | /// \endcode |
2065 | | /// In this example directive '#pragma omp depobj' has 'update' clause with 'in' |
2066 | | /// dependence kind. |
2067 | | class OMPUpdateClause final |
2068 | | : public OMPClause, |
2069 | | private llvm::TrailingObjects<OMPUpdateClause, SourceLocation, |
2070 | | OpenMPDependClauseKind> { |
2071 | | friend class OMPClauseReader; |
2072 | | friend TrailingObjects; |
2073 | | |
2074 | | /// true if extended version of the clause for 'depobj' directive. |
2075 | | bool IsExtended = false; |
2076 | | |
2077 | | /// Define the sizes of each trailing object array except the last one. This |
2078 | | /// is required for TrailingObjects to work properly. |
2079 | 72 | size_t numTrailingObjects(OverloadToken<SourceLocation>) const { |
2080 | | // 2 locations: for '(' and argument location. |
2081 | 72 | return IsExtended ? 2 : 00 ; |
2082 | 72 | } |
2083 | | |
2084 | | /// Sets the location of '(' in clause for 'depobj' directive. |
2085 | 48 | void setLParenLoc(SourceLocation Loc) { |
2086 | 48 | assert(IsExtended && "Expected extended clause."); |
2087 | 0 | *getTrailingObjects<SourceLocation>() = Loc; |
2088 | 48 | } |
2089 | | |
2090 | | /// Sets the location of '(' in clause for 'depobj' directive. |
2091 | 48 | void setArgumentLoc(SourceLocation Loc) { |
2092 | 48 | assert(IsExtended && "Expected extended clause."); |
2093 | 0 | *std::next(getTrailingObjects<SourceLocation>(), 1) = Loc; |
2094 | 48 | } |
2095 | | |
2096 | | /// Sets the dependence kind for the clause for 'depobj' directive. |
2097 | 48 | void setDependencyKind(OpenMPDependClauseKind DK) { |
2098 | 48 | assert(IsExtended && "Expected extended clause."); |
2099 | 0 | *getTrailingObjects<OpenMPDependClauseKind>() = DK; |
2100 | 48 | } |
2101 | | |
2102 | | /// Build 'update' clause. |
2103 | | /// |
2104 | | /// \param StartLoc Starting location of the clause. |
2105 | | /// \param EndLoc Ending location of the clause. |
2106 | | OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc, |
2107 | | bool IsExtended) |
2108 | | : OMPClause(llvm::omp::OMPC_update, StartLoc, EndLoc), |
2109 | 649 | IsExtended(IsExtended) {} |
2110 | | |
2111 | | /// Build an empty clause. |
2112 | | OMPUpdateClause(bool IsExtended) |
2113 | | : OMPClause(llvm::omp::OMPC_update, SourceLocation(), SourceLocation()), |
2114 | 116 | IsExtended(IsExtended) {} |
2115 | | |
2116 | | public: |
2117 | | /// Creates clause for 'atomic' directive. |
2118 | | /// |
2119 | | /// \param C AST context. |
2120 | | /// \param StartLoc Starting location of the clause. |
2121 | | /// \param EndLoc Ending location of the clause. |
2122 | | static OMPUpdateClause *Create(const ASTContext &C, SourceLocation StartLoc, |
2123 | | SourceLocation EndLoc); |
2124 | | |
2125 | | /// Creates clause for 'depobj' directive. |
2126 | | /// |
2127 | | /// \param C AST context. |
2128 | | /// \param StartLoc Starting location of the clause. |
2129 | | /// \param LParenLoc Location of '('. |
2130 | | /// \param ArgumentLoc Location of the argument. |
2131 | | /// \param DK Dependence kind. |
2132 | | /// \param EndLoc Ending location of the clause. |
2133 | | static OMPUpdateClause *Create(const ASTContext &C, SourceLocation StartLoc, |
2134 | | SourceLocation LParenLoc, |
2135 | | SourceLocation ArgumentLoc, |
2136 | | OpenMPDependClauseKind DK, |
2137 | | SourceLocation EndLoc); |
2138 | | |
2139 | | /// Creates an empty clause with the place for \a N variables. |
2140 | | /// |
2141 | | /// \param C AST context. |
2142 | | /// \param IsExtended true if extended clause for 'depobj' directive must be |
2143 | | /// created. |
2144 | | static OMPUpdateClause *CreateEmpty(const ASTContext &C, bool IsExtended); |
2145 | | |
2146 | | /// Checks if the clause is the extended clauses for 'depobj' directive. |
2147 | 528 | bool isExtended() const { return IsExtended; } |
2148 | | |
2149 | 8 | child_range children() { |
2150 | 8 | return child_range(child_iterator(), child_iterator()); |
2151 | 8 | } |
2152 | | |
2153 | 0 | const_child_range children() const { |
2154 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2155 | 0 | } |
2156 | | |
2157 | 128 | child_range used_children() { |
2158 | 128 | return child_range(child_iterator(), child_iterator()); |
2159 | 128 | } |
2160 | 0 | const_child_range used_children() const { |
2161 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2162 | 0 | } |
2163 | | |
2164 | | /// Gets the location of '(' in clause for 'depobj' directive. |
2165 | 8 | SourceLocation getLParenLoc() const { |
2166 | 8 | assert(IsExtended && "Expected extended clause."); |
2167 | 0 | return *getTrailingObjects<SourceLocation>(); |
2168 | 8 | } |
2169 | | |
2170 | | /// Gets the location of argument in clause for 'depobj' directive. |
2171 | 8 | SourceLocation getArgumentLoc() const { |
2172 | 8 | assert(IsExtended && "Expected extended clause."); |
2173 | 0 | return *std::next(getTrailingObjects<SourceLocation>(), 1); |
2174 | 8 | } |
2175 | | |
2176 | | /// Gets the dependence kind in clause for 'depobj' directive. |
2177 | 24 | OpenMPDependClauseKind getDependencyKind() const { |
2178 | 24 | assert(IsExtended && "Expected extended clause."); |
2179 | 0 | return *getTrailingObjects<OpenMPDependClauseKind>(); |
2180 | 24 | } |
2181 | | |
2182 | 158 | static bool classof(const OMPClause *T) { |
2183 | 158 | return T->getClauseKind() == llvm::omp::OMPC_update; |
2184 | 158 | } |
2185 | | }; |
2186 | | |
2187 | | /// This represents 'capture' clause in the '#pragma omp atomic' |
2188 | | /// directive. |
2189 | | /// |
2190 | | /// \code |
2191 | | /// #pragma omp atomic capture |
2192 | | /// \endcode |
2193 | | /// In this example directive '#pragma omp atomic' has 'capture' clause. |
2194 | | class OMPCaptureClause : public OMPClause { |
2195 | | public: |
2196 | | /// Build 'capture' clause. |
2197 | | /// |
2198 | | /// \param StartLoc Starting location of the clause. |
2199 | | /// \param EndLoc Ending location of the clause. |
2200 | | OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc) |
2201 | 7.32k | : OMPClause(llvm::omp::OMPC_capture, StartLoc, EndLoc) {} |
2202 | | |
2203 | | /// Build an empty clause. |
2204 | | OMPCaptureClause() |
2205 | 2.98k | : OMPClause(llvm::omp::OMPC_capture, SourceLocation(), SourceLocation()) { |
2206 | 2.98k | } |
2207 | | |
2208 | 16 | child_range children() { |
2209 | 16 | return child_range(child_iterator(), child_iterator()); |
2210 | 16 | } |
2211 | | |
2212 | 0 | const_child_range children() const { |
2213 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2214 | 0 | } |
2215 | | |
2216 | 1.16k | child_range used_children() { |
2217 | 1.16k | return child_range(child_iterator(), child_iterator()); |
2218 | 1.16k | } |
2219 | 0 | const_child_range used_children() const { |
2220 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2221 | 0 | } |
2222 | | |
2223 | 544 | static bool classof(const OMPClause *T) { |
2224 | 544 | return T->getClauseKind() == llvm::omp::OMPC_capture; |
2225 | 544 | } |
2226 | | }; |
2227 | | |
2228 | | /// This represents 'compare' clause in the '#pragma omp atomic' |
2229 | | /// directive. |
2230 | | /// |
2231 | | /// \code |
2232 | | /// #pragma omp atomic compare |
2233 | | /// \endcode |
2234 | | /// In this example directive '#pragma omp atomic' has 'compare' clause. |
2235 | | class OMPCompareClause final : public OMPClause { |
2236 | | public: |
2237 | | /// Build 'compare' clause. |
2238 | | /// |
2239 | | /// \param StartLoc Starting location of the clause. |
2240 | | /// \param EndLoc Ending location of the clause. |
2241 | | OMPCompareClause(SourceLocation StartLoc, SourceLocation EndLoc) |
2242 | 8.89k | : OMPClause(llvm::omp::OMPC_compare, StartLoc, EndLoc) {} |
2243 | | |
2244 | | /// Build an empty clause. |
2245 | | OMPCompareClause() |
2246 | 4.39k | : OMPClause(llvm::omp::OMPC_compare, SourceLocation(), SourceLocation()) { |
2247 | 4.39k | } |
2248 | | |
2249 | 0 | child_range children() { |
2250 | 0 | return child_range(child_iterator(), child_iterator()); |
2251 | 0 | } |
2252 | | |
2253 | 0 | const_child_range children() const { |
2254 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2255 | 0 | } |
2256 | | |
2257 | 336 | child_range used_children() { |
2258 | 336 | return child_range(child_iterator(), child_iterator()); |
2259 | 336 | } |
2260 | 0 | const_child_range used_children() const { |
2261 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2262 | 0 | } |
2263 | | |
2264 | 172 | static bool classof(const OMPClause *T) { |
2265 | 172 | return T->getClauseKind() == llvm::omp::OMPC_compare; |
2266 | 172 | } |
2267 | | }; |
2268 | | |
2269 | | /// This represents 'seq_cst' clause in the '#pragma omp atomic' |
2270 | | /// directive. |
2271 | | /// |
2272 | | /// \code |
2273 | | /// #pragma omp atomic seq_cst |
2274 | | /// \endcode |
2275 | | /// In this example directive '#pragma omp atomic' has 'seq_cst' clause. |
2276 | | class OMPSeqCstClause : public OMPClause { |
2277 | | public: |
2278 | | /// Build 'seq_cst' clause. |
2279 | | /// |
2280 | | /// \param StartLoc Starting location of the clause. |
2281 | | /// \param EndLoc Ending location of the clause. |
2282 | | OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc) |
2283 | 1.72k | : OMPClause(llvm::omp::OMPC_seq_cst, StartLoc, EndLoc) {} |
2284 | | |
2285 | | /// Build an empty clause. |
2286 | | OMPSeqCstClause() |
2287 | 816 | : OMPClause(llvm::omp::OMPC_seq_cst, SourceLocation(), SourceLocation()) { |
2288 | 816 | } |
2289 | | |
2290 | 0 | child_range children() { |
2291 | 0 | return child_range(child_iterator(), child_iterator()); |
2292 | 0 | } |
2293 | | |
2294 | 0 | const_child_range children() const { |
2295 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2296 | 0 | } |
2297 | | |
2298 | 208 | child_range used_children() { |
2299 | 208 | return child_range(child_iterator(), child_iterator()); |
2300 | 208 | } |
2301 | 0 | const_child_range used_children() const { |
2302 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2303 | 0 | } |
2304 | | |
2305 | 11.7k | static bool classof(const OMPClause *T) { |
2306 | 11.7k | return T->getClauseKind() == llvm::omp::OMPC_seq_cst; |
2307 | 11.7k | } |
2308 | | }; |
2309 | | |
2310 | | /// This represents 'acq_rel' clause in the '#pragma omp atomic|flush' |
2311 | | /// directives. |
2312 | | /// |
2313 | | /// \code |
2314 | | /// #pragma omp flush acq_rel |
2315 | | /// \endcode |
2316 | | /// In this example directive '#pragma omp flush' has 'acq_rel' clause. |
2317 | | class OMPAcqRelClause final : public OMPClause { |
2318 | | public: |
2319 | | /// Build 'ack_rel' clause. |
2320 | | /// |
2321 | | /// \param StartLoc Starting location of the clause. |
2322 | | /// \param EndLoc Ending location of the clause. |
2323 | | OMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc) |
2324 | 1.54k | : OMPClause(llvm::omp::OMPC_acq_rel, StartLoc, EndLoc) {} |
2325 | | |
2326 | | /// Build an empty clause. |
2327 | | OMPAcqRelClause() |
2328 | 758 | : OMPClause(llvm::omp::OMPC_acq_rel, SourceLocation(), SourceLocation()) { |
2329 | 758 | } |
2330 | | |
2331 | 0 | child_range children() { |
2332 | 0 | return child_range(child_iterator(), child_iterator()); |
2333 | 0 | } |
2334 | | |
2335 | 0 | const_child_range children() const { |
2336 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2337 | 0 | } |
2338 | | |
2339 | 124 | child_range used_children() { |
2340 | 124 | return child_range(child_iterator(), child_iterator()); |
2341 | 124 | } |
2342 | 0 | const_child_range used_children() const { |
2343 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2344 | 0 | } |
2345 | | |
2346 | 9.75k | static bool classof(const OMPClause *T) { |
2347 | 9.75k | return T->getClauseKind() == llvm::omp::OMPC_acq_rel; |
2348 | 9.75k | } |
2349 | | }; |
2350 | | |
2351 | | /// This represents 'acquire' clause in the '#pragma omp atomic|flush' |
2352 | | /// directives. |
2353 | | /// |
2354 | | /// \code |
2355 | | /// #pragma omp flush acquire |
2356 | | /// \endcode |
2357 | | /// In this example directive '#pragma omp flush' has 'acquire' clause. |
2358 | | class OMPAcquireClause final : public OMPClause { |
2359 | | public: |
2360 | | /// Build 'acquire' clause. |
2361 | | /// |
2362 | | /// \param StartLoc Starting location of the clause. |
2363 | | /// \param EndLoc Ending location of the clause. |
2364 | | OMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc) |
2365 | 1.56k | : OMPClause(llvm::omp::OMPC_acquire, StartLoc, EndLoc) {} |
2366 | | |
2367 | | /// Build an empty clause. |
2368 | | OMPAcquireClause() |
2369 | 768 | : OMPClause(llvm::omp::OMPC_acquire, SourceLocation(), SourceLocation()) { |
2370 | 768 | } |
2371 | | |
2372 | 0 | child_range children() { |
2373 | 0 | return child_range(child_iterator(), child_iterator()); |
2374 | 0 | } |
2375 | | |
2376 | 0 | const_child_range children() const { |
2377 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2378 | 0 | } |
2379 | | |
2380 | 140 | child_range used_children() { |
2381 | 140 | return child_range(child_iterator(), child_iterator()); |
2382 | 140 | } |
2383 | 0 | const_child_range used_children() const { |
2384 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2385 | 0 | } |
2386 | | |
2387 | 7.91k | static bool classof(const OMPClause *T) { |
2388 | 7.91k | return T->getClauseKind() == llvm::omp::OMPC_acquire; |
2389 | 7.91k | } |
2390 | | }; |
2391 | | |
2392 | | /// This represents 'release' clause in the '#pragma omp atomic|flush' |
2393 | | /// directives. |
2394 | | /// |
2395 | | /// \code |
2396 | | /// #pragma omp flush release |
2397 | | /// \endcode |
2398 | | /// In this example directive '#pragma omp flush' has 'release' clause. |
2399 | | class OMPReleaseClause final : public OMPClause { |
2400 | | public: |
2401 | | /// Build 'release' clause. |
2402 | | /// |
2403 | | /// \param StartLoc Starting location of the clause. |
2404 | | /// \param EndLoc Ending location of the clause. |
2405 | | OMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc) |
2406 | 1.60k | : OMPClause(llvm::omp::OMPC_release, StartLoc, EndLoc) {} |
2407 | | |
2408 | | /// Build an empty clause. |
2409 | | OMPReleaseClause() |
2410 | 786 | : OMPClause(llvm::omp::OMPC_release, SourceLocation(), SourceLocation()) { |
2411 | 786 | } |
2412 | | |
2413 | 0 | child_range children() { |
2414 | 0 | return child_range(child_iterator(), child_iterator()); |
2415 | 0 | } |
2416 | | |
2417 | 0 | const_child_range children() const { |
2418 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2419 | 0 | } |
2420 | | |
2421 | 172 | child_range used_children() { |
2422 | 172 | return child_range(child_iterator(), child_iterator()); |
2423 | 172 | } |
2424 | 0 | const_child_range used_children() const { |
2425 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2426 | 0 | } |
2427 | | |
2428 | 6.07k | static bool classof(const OMPClause *T) { |
2429 | 6.07k | return T->getClauseKind() == llvm::omp::OMPC_release; |
2430 | 6.07k | } |
2431 | | }; |
2432 | | |
2433 | | /// This represents 'relaxed' clause in the '#pragma omp atomic' |
2434 | | /// directives. |
2435 | | /// |
2436 | | /// \code |
2437 | | /// #pragma omp atomic relaxed |
2438 | | /// \endcode |
2439 | | /// In this example directive '#pragma omp atomic' has 'relaxed' clause. |
2440 | | class OMPRelaxedClause final : public OMPClause { |
2441 | | public: |
2442 | | /// Build 'relaxed' clause. |
2443 | | /// |
2444 | | /// \param StartLoc Starting location of the clause. |
2445 | | /// \param EndLoc Ending location of the clause. |
2446 | | OMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc) |
2447 | 1.60k | : OMPClause(llvm::omp::OMPC_relaxed, StartLoc, EndLoc) {} |
2448 | | |
2449 | | /// Build an empty clause. |
2450 | | OMPRelaxedClause() |
2451 | 790 | : OMPClause(llvm::omp::OMPC_relaxed, SourceLocation(), SourceLocation()) { |
2452 | 790 | } |
2453 | | |
2454 | 0 | child_range children() { |
2455 | 0 | return child_range(child_iterator(), child_iterator()); |
2456 | 0 | } |
2457 | | |
2458 | 0 | const_child_range children() const { |
2459 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2460 | 0 | } |
2461 | | |
2462 | 160 | child_range used_children() { |
2463 | 160 | return child_range(child_iterator(), child_iterator()); |
2464 | 160 | } |
2465 | 0 | const_child_range used_children() const { |
2466 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2467 | 0 | } |
2468 | | |
2469 | 4.22k | static bool classof(const OMPClause *T) { |
2470 | 4.22k | return T->getClauseKind() == llvm::omp::OMPC_relaxed; |
2471 | 4.22k | } |
2472 | | }; |
2473 | | |
2474 | | /// This represents clause 'private' in the '#pragma omp ...' directives. |
2475 | | /// |
2476 | | /// \code |
2477 | | /// #pragma omp parallel private(a,b) |
2478 | | /// \endcode |
2479 | | /// In this example directive '#pragma omp parallel' has clause 'private' |
2480 | | /// with the variables 'a' and 'b'. |
2481 | | class OMPPrivateClause final |
2482 | | : public OMPVarListClause<OMPPrivateClause>, |
2483 | | private llvm::TrailingObjects<OMPPrivateClause, Expr *> { |
2484 | | friend class OMPClauseReader; |
2485 | | friend OMPVarListClause; |
2486 | | friend TrailingObjects; |
2487 | | |
2488 | | /// Build clause with number of variables \a N. |
2489 | | /// |
2490 | | /// \param StartLoc Starting location of the clause. |
2491 | | /// \param LParenLoc Location of '('. |
2492 | | /// \param EndLoc Ending location of the clause. |
2493 | | /// \param N Number of the variables in the clause. |
2494 | | OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc, |
2495 | | SourceLocation EndLoc, unsigned N) |
2496 | | : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private, StartLoc, |
2497 | 14.5k | LParenLoc, EndLoc, N) {} |
2498 | | |
2499 | | /// Build an empty clause. |
2500 | | /// |
2501 | | /// \param N Number of variables. |
2502 | | explicit OMPPrivateClause(unsigned N) |
2503 | | : OMPVarListClause<OMPPrivateClause>(llvm::omp::OMPC_private, |
2504 | | SourceLocation(), SourceLocation(), |
2505 | 1.47k | SourceLocation(), N) {} |
2506 | | |
2507 | | /// Sets the list of references to private copies with initializers for |
2508 | | /// new private variables. |
2509 | | /// \param VL List of references. |
2510 | | void setPrivateCopies(ArrayRef<Expr *> VL); |
2511 | | |
2512 | | /// Gets the list of references to private copies with initializers for |
2513 | | /// new private variables. |
2514 | 21.1k | MutableArrayRef<Expr *> getPrivateCopies() { |
2515 | 21.1k | return MutableArrayRef<Expr *>(varlist_end(), varlist_size()); |
2516 | 21.1k | } |
2517 | 3.78k | ArrayRef<const Expr *> getPrivateCopies() const { |
2518 | 3.78k | return llvm::makeArrayRef(varlist_end(), varlist_size()); |
2519 | 3.78k | } |
2520 | | |
2521 | | public: |
2522 | | /// Creates clause with a list of variables \a VL. |
2523 | | /// |
2524 | | /// \param C AST context. |
2525 | | /// \param StartLoc Starting location of the clause. |
2526 | | /// \param LParenLoc Location of '('. |
2527 | | /// \param EndLoc Ending location of the clause. |
2528 | | /// \param VL List of references to the variables. |
2529 | | /// \param PrivateVL List of references to private copies with initializers. |
2530 | | static OMPPrivateClause *Create(const ASTContext &C, SourceLocation StartLoc, |
2531 | | SourceLocation LParenLoc, |
2532 | | SourceLocation EndLoc, ArrayRef<Expr *> VL, |
2533 | | ArrayRef<Expr *> PrivateVL); |
2534 | | |
2535 | | /// Creates an empty clause with the place for \a N variables. |
2536 | | /// |
2537 | | /// \param C AST context. |
2538 | | /// \param N The number of variables. |
2539 | | static OMPPrivateClause *CreateEmpty(const ASTContext &C, unsigned N); |
2540 | | |
2541 | | using private_copies_iterator = MutableArrayRef<Expr *>::iterator; |
2542 | | using private_copies_const_iterator = ArrayRef<const Expr *>::iterator; |
2543 | | using private_copies_range = llvm::iterator_range<private_copies_iterator>; |
2544 | | using private_copies_const_range = |
2545 | | llvm::iterator_range<private_copies_const_iterator>; |
2546 | | |
2547 | 10.5k | private_copies_range private_copies() { |
2548 | 10.5k | return private_copies_range(getPrivateCopies().begin(), |
2549 | 10.5k | getPrivateCopies().end()); |
2550 | 10.5k | } |
2551 | | |
2552 | 1.89k | private_copies_const_range private_copies() const { |
2553 | 1.89k | return private_copies_const_range(getPrivateCopies().begin(), |
2554 | 1.89k | getPrivateCopies().end()); |
2555 | 1.89k | } |
2556 | | |
2557 | 14.4k | child_range children() { |
2558 | 14.4k | return child_range(reinterpret_cast<Stmt **>(varlist_begin()), |
2559 | 14.4k | reinterpret_cast<Stmt **>(varlist_end())); |
2560 | 14.4k | } |
2561 | | |
2562 | 0 | const_child_range children() const { |
2563 | 0 | auto Children = const_cast<OMPPrivateClause *>(this)->children(); |
2564 | 0 | return const_child_range(Children.begin(), Children.end()); |
2565 | 0 | } |
2566 | | |
2567 | 2.48k | child_range used_children() { |
2568 | 2.48k | return child_range(child_iterator(), child_iterator()); |
2569 | 2.48k | } |
2570 | 0 | const_child_range used_children() const { |
2571 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2572 | 0 | } |
2573 | | |
2574 | 143k | static bool classof(const OMPClause *T) { |
2575 | 143k | return T->getClauseKind() == llvm::omp::OMPC_private; |
2576 | 143k | } |
2577 | | }; |
2578 | | |
2579 | | /// This represents clause 'firstprivate' in the '#pragma omp ...' |
2580 | | /// directives. |
2581 | | /// |
2582 | | /// \code |
2583 | | /// #pragma omp parallel firstprivate(a,b) |
2584 | | /// \endcode |
2585 | | /// In this example directive '#pragma omp parallel' has clause 'firstprivate' |
2586 | | /// with the variables 'a' and 'b'. |
2587 | | class OMPFirstprivateClause final |
2588 | | : public OMPVarListClause<OMPFirstprivateClause>, |
2589 | | public OMPClauseWithPreInit, |
2590 | | private llvm::TrailingObjects<OMPFirstprivateClause, Expr *> { |
2591 | | friend class OMPClauseReader; |
2592 | | friend OMPVarListClause; |
2593 | | friend TrailingObjects; |
2594 | | |
2595 | | /// Build clause with number of variables \a N. |
2596 | | /// |
2597 | | /// \param StartLoc Starting location of the clause. |
2598 | | /// \param LParenLoc Location of '('. |
2599 | | /// \param EndLoc Ending location of the clause. |
2600 | | /// \param N Number of the variables in the clause. |
2601 | | OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc, |
2602 | | SourceLocation EndLoc, unsigned N) |
2603 | | : OMPVarListClause<OMPFirstprivateClause>(llvm::omp::OMPC_firstprivate, |
2604 | | StartLoc, LParenLoc, EndLoc, N), |
2605 | 54.0k | OMPClauseWithPreInit(this) {} |
2606 | | |
2607 | | /// Build an empty clause. |
2608 | | /// |
2609 | | /// \param N Number of variables. |
2610 | | explicit OMPFirstprivateClause(unsigned N) |
2611 | | : OMPVarListClause<OMPFirstprivateClause>( |
2612 | | llvm::omp::OMPC_firstprivate, SourceLocation(), SourceLocation(), |
2613 | | SourceLocation(), N), |
2614 | 4.34k | OMPClauseWithPreInit(this) {} |
2615 | | |
2616 | | /// Sets the list of references to private copies with initializers for |
2617 | | /// new private variables. |
2618 | | /// \param VL List of references. |
2619 | | void setPrivateCopies(ArrayRef<Expr *> VL); |
2620 | | |
2621 | | /// Gets the list of references to private copies with initializers for |
2622 | | /// new private variables. |
2623 | 178k | MutableArrayRef<Expr *> getPrivateCopies() { |
2624 | 178k | return MutableArrayRef<Expr *>(varlist_end(), varlist_size()); |
2625 | 178k | } |
2626 | 43.4k | ArrayRef<const Expr *> getPrivateCopies() const { |
2627 | 43.4k | return llvm::makeArrayRef(varlist_end(), varlist_size()); |
2628 | 43.4k | } |
2629 | | |
2630 | | /// Sets the list of references to initializer variables for new |
2631 | | /// private variables. |
2632 | | /// \param VL List of references. |
2633 | | void setInits(ArrayRef<Expr *> VL); |
2634 | | |
2635 | | /// Gets the list of references to initializer variables for new |
2636 | | /// private variables. |
2637 | 8.90k | MutableArrayRef<Expr *> getInits() { |
2638 | 8.90k | return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size()); |
2639 | 8.90k | } |
2640 | 21.7k | ArrayRef<const Expr *> getInits() const { |
2641 | 21.7k | return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size()); |
2642 | 21.7k | } |
2643 | | |
2644 | | public: |
2645 | | /// Creates clause with a list of variables \a VL. |
2646 | | /// |
2647 | | /// \param C AST context. |
2648 | | /// \param StartLoc Starting location of the clause. |
2649 | | /// \param LParenLoc Location of '('. |
2650 | | /// \param EndLoc Ending location of the clause. |
2651 | | /// \param VL List of references to the original variables. |
2652 | | /// \param PrivateVL List of references to private copies with initializers. |
2653 | | /// \param InitVL List of references to auto generated variables used for |
2654 | | /// initialization of a single array element. Used if firstprivate variable is |
2655 | | /// of array type. |
2656 | | /// \param PreInit Statement that must be executed before entering the OpenMP |
2657 | | /// region with this clause. |
2658 | | static OMPFirstprivateClause * |
2659 | | Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, |
2660 | | SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL, |
2661 | | ArrayRef<Expr *> InitVL, Stmt *PreInit); |
2662 | | |
2663 | | /// Creates an empty clause with the place for \a N variables. |
2664 | | /// |
2665 | | /// \param C AST context. |
2666 | | /// \param N The number of variables. |
2667 | | static OMPFirstprivateClause *CreateEmpty(const ASTContext &C, unsigned N); |
2668 | | |
2669 | | using private_copies_iterator = MutableArrayRef<Expr *>::iterator; |
2670 | | using private_copies_const_iterator = ArrayRef<const Expr *>::iterator; |
2671 | | using private_copies_range = llvm::iterator_range<private_copies_iterator>; |
2672 | | using private_copies_const_range = |
2673 | | llvm::iterator_range<private_copies_const_iterator>; |
2674 | | |
2675 | 55.6k | private_copies_range private_copies() { |
2676 | 55.6k | return private_copies_range(getPrivateCopies().begin(), |
2677 | 55.6k | getPrivateCopies().end()); |
2678 | 55.6k | } |
2679 | 10.8k | private_copies_const_range private_copies() const { |
2680 | 10.8k | return private_copies_const_range(getPrivateCopies().begin(), |
2681 | 10.8k | getPrivateCopies().end()); |
2682 | 10.8k | } |
2683 | | |
2684 | | using inits_iterator = MutableArrayRef<Expr *>::iterator; |
2685 | | using inits_const_iterator = ArrayRef<const Expr *>::iterator; |
2686 | | using inits_range = llvm::iterator_range<inits_iterator>; |
2687 | | using inits_const_range = llvm::iterator_range<inits_const_iterator>; |
2688 | | |
2689 | 4.45k | inits_range inits() { |
2690 | 4.45k | return inits_range(getInits().begin(), getInits().end()); |
2691 | 4.45k | } |
2692 | 10.8k | inits_const_range inits() const { |
2693 | 10.8k | return inits_const_range(getInits().begin(), getInits().end()); |
2694 | 10.8k | } |
2695 | | |
2696 | 10.1k | child_range children() { |
2697 | 10.1k | return child_range(reinterpret_cast<Stmt **>(varlist_begin()), |
2698 | 10.1k | reinterpret_cast<Stmt **>(varlist_end())); |
2699 | 10.1k | } |
2700 | | |
2701 | 0 | const_child_range children() const { |
2702 | 0 | auto Children = const_cast<OMPFirstprivateClause *>(this)->children(); |
2703 | 0 | return const_child_range(Children.begin(), Children.end()); |
2704 | 0 | } |
2705 | | |
2706 | 24.1k | child_range used_children() { |
2707 | 24.1k | return child_range(reinterpret_cast<Stmt **>(varlist_begin()), |
2708 | 24.1k | reinterpret_cast<Stmt **>(varlist_end())); |
2709 | 24.1k | } |
2710 | 0 | const_child_range used_children() const { |
2711 | 0 | auto Children = const_cast<OMPFirstprivateClause *>(this)->used_children(); |
2712 | 0 | return const_child_range(Children.begin(), Children.end()); |
2713 | 0 | } |
2714 | | |
2715 | 244k | static bool classof(const OMPClause *T) { |
2716 | 244k | return T->getClauseKind() == llvm::omp::OMPC_firstprivate; |
2717 | 244k | } |
2718 | | }; |
2719 | | |
2720 | | /// This represents clause 'lastprivate' in the '#pragma omp ...' |
2721 | | /// directives. |
2722 | | /// |
2723 | | /// \code |
2724 | | /// #pragma omp simd lastprivate(a,b) |
2725 | | /// \endcode |
2726 | | /// In this example directive '#pragma omp simd' has clause 'lastprivate' |
2727 | | /// with the variables 'a' and 'b'. |
2728 | | class OMPLastprivateClause final |
2729 | | : public OMPVarListClause<OMPLastprivateClause>, |
2730 | | public OMPClauseWithPostUpdate, |
2731 | | private llvm::TrailingObjects<OMPLastprivateClause, Expr *> { |
2732 | | // There are 4 additional tail-allocated arrays at the end of the class: |
2733 | | // 1. Contains list of pseudo variables with the default initialization for |
2734 | | // each non-firstprivate variables. Used in codegen for initialization of |
2735 | | // lastprivate copies. |
2736 | | // 2. List of helper expressions for proper generation of assignment operation |
2737 | | // required for lastprivate clause. This list represents private variables |
2738 | | // (for arrays, single array element). |
2739 | | // 3. List of helper expressions for proper generation of assignment operation |
2740 | | // required for lastprivate clause. This list represents original variables |
2741 | | // (for arrays, single array element). |
2742 | | // 4. List of helper expressions that represents assignment operation: |
2743 | | // \code |
2744 | | // DstExprs = SrcExprs; |
2745 | | // \endcode |
2746 | | // Required for proper codegen of final assignment performed by the |
2747 | | // lastprivate clause. |
2748 | | friend class OMPClauseReader; |
2749 | | friend OMPVarListClause; |
2750 | | friend TrailingObjects; |
2751 | | |
2752 | | /// Optional lastprivate kind, e.g. 'conditional', if specified by user. |
2753 | | OpenMPLastprivateModifier LPKind; |
2754 | | /// Optional location of the lasptrivate kind, if specified by user. |
2755 | | SourceLocation LPKindLoc; |
2756 | | /// Optional colon location, if specified by user. |
2757 | | SourceLocation ColonLoc; |
2758 | | |
2759 | | /// Build clause with number of variables \a N. |
2760 | | /// |
2761 | | /// \param StartLoc Starting location of the clause. |
2762 | | /// \param LParenLoc Location of '('. |
2763 | | /// \param EndLoc Ending location of the clause. |
2764 | | /// \param N Number of the variables in the clause. |
2765 | | OMPLastprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc, |
2766 | | SourceLocation EndLoc, OpenMPLastprivateModifier LPKind, |
2767 | | SourceLocation LPKindLoc, SourceLocation ColonLoc, |
2768 | | unsigned N) |
2769 | | : OMPVarListClause<OMPLastprivateClause>(llvm::omp::OMPC_lastprivate, |
2770 | | StartLoc, LParenLoc, EndLoc, N), |
2771 | | OMPClauseWithPostUpdate(this), LPKind(LPKind), LPKindLoc(LPKindLoc), |
2772 | 6.56k | ColonLoc(ColonLoc) {} |
2773 | | |
2774 | | /// Build an empty clause. |
2775 | | /// |
2776 | | /// \param N Number of variables. |
2777 | | explicit OMPLastprivateClause(unsigned N) |
2778 | | : OMPVarListClause<OMPLastprivateClause>( |
2779 | | llvm::omp::OMPC_lastprivate, SourceLocation(), SourceLocation(), |
2780 | | SourceLocation(), N), |
2781 | 430 | OMPClauseWithPostUpdate(this) {} |
2782 | | |
2783 | | /// Get the list of helper expressions for initialization of private |
2784 | | /// copies for lastprivate variables. |
2785 | 34.6k | MutableArrayRef<Expr *> getPrivateCopies() { |
2786 | 34.6k | return MutableArrayRef<Expr *>(varlist_end(), varlist_size()); |
2787 | 34.6k | } |
2788 | 6.55k | ArrayRef<const Expr *> getPrivateCopies() const { |
2789 | 6.55k | return llvm::makeArrayRef(varlist_end(), varlist_size()); |
2790 | 6.55k | } |
2791 | | |
2792 | | /// Set list of helper expressions, required for proper codegen of the |
2793 | | /// clause. These expressions represent private variables (for arrays, single |
2794 | | /// array element) in the final assignment statement performed by the |
2795 | | /// lastprivate clause. |
2796 | | void setSourceExprs(ArrayRef<Expr *> SrcExprs); |
2797 | | |
2798 | | /// Get the list of helper source expressions. |
2799 | 16.8k | MutableArrayRef<Expr *> getSourceExprs() { |
2800 | 16.8k | return MutableArrayRef<Expr *>(getPrivateCopies().end(), varlist_size()); |
2801 | 16.8k | } |
2802 | 5.47k | ArrayRef<const Expr *> getSourceExprs() const { |
2803 | 5.47k | return llvm::makeArrayRef(getPrivateCopies().end(), varlist_size()); |
2804 | 5.47k | } |
2805 | | |
2806 | | /// Set list of helper expressions, required for proper codegen of the |
2807 | | /// clause. These expressions represent original variables (for arrays, single |
2808 | | /// array element) in the final assignment statement performed by the |
2809 | | /// lastprivate clause. |
2810 | | void setDestinationExprs(ArrayRef<Expr *> DstExprs); |
2811 | | |
2812 | | /// Get the list of helper destination expressions. |
2813 | 8.90k | MutableArrayRef<Expr *> getDestinationExprs() { |
2814 | 8.90k | return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size()); |
2815 | 8.90k | } |
2816 | 4.00k | ArrayRef<const Expr *> getDestinationExprs() const { |
2817 | 4.00k | return llvm::makeArrayRef(getSourceExprs().end(), varlist_size()); |
2818 | 4.00k | } |
2819 | | |
2820 | | /// Set list of helper assignment expressions, required for proper |
2821 | | /// codegen of the clause. These expressions are assignment expressions that |
2822 | | /// assign private copy of the variable to original variable. |
2823 | | void setAssignmentOps(ArrayRef<Expr *> AssignmentOps); |
2824 | | |
2825 | | /// Get the list of helper assignment expressions. |
2826 | 952 | MutableArrayRef<Expr *> getAssignmentOps() { |
2827 | 952 | return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size()); |
2828 | 952 | } |
2829 | 1.46k | ArrayRef<const Expr *> getAssignmentOps() const { |
2830 | 1.46k | return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size()); |
2831 | 1.46k | } |
2832 | | |
2833 | | /// Sets lastprivate kind. |
2834 | 430 | void setKind(OpenMPLastprivateModifier Kind) { LPKind = Kind; } |
2835 | | /// Sets location of the lastprivate kind. |
2836 | 430 | void setKindLoc(SourceLocation Loc) { LPKindLoc = Loc; } |
2837 | | /// Sets colon symbol location. |
2838 | 430 | void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; } |
2839 | | |
2840 | | public: |
2841 | | /// Creates clause with a list of variables \a VL. |
2842 | | /// |
2843 | | /// \param C AST context. |
2844 | | /// \param StartLoc Starting location of the clause. |
2845 | | /// \param LParenLoc Location of '('. |
2846 | | /// \param EndLoc Ending location of the clause. |
2847 | | /// \param VL List of references to the variables. |
2848 | | /// \param SrcExprs List of helper expressions for proper generation of |
2849 | | /// assignment operation required for lastprivate clause. This list represents |
2850 | | /// private variables (for arrays, single array element). |
2851 | | /// \param DstExprs List of helper expressions for proper generation of |
2852 | | /// assignment operation required for lastprivate clause. This list represents |
2853 | | /// original variables (for arrays, single array element). |
2854 | | /// \param AssignmentOps List of helper expressions that represents assignment |
2855 | | /// operation: |
2856 | | /// \code |
2857 | | /// DstExprs = SrcExprs; |
2858 | | /// \endcode |
2859 | | /// Required for proper codegen of final assignment performed by the |
2860 | | /// lastprivate clause. |
2861 | | /// \param LPKind Lastprivate kind, e.g. 'conditional'. |
2862 | | /// \param LPKindLoc Location of the lastprivate kind. |
2863 | | /// \param ColonLoc Location of the ':' symbol if lastprivate kind is used. |
2864 | | /// \param PreInit Statement that must be executed before entering the OpenMP |
2865 | | /// region with this clause. |
2866 | | /// \param PostUpdate Expression that must be executed after exit from the |
2867 | | /// OpenMP region with this clause. |
2868 | | static OMPLastprivateClause * |
2869 | | Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, |
2870 | | SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs, |
2871 | | ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps, |
2872 | | OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, |
2873 | | SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate); |
2874 | | |
2875 | | /// Creates an empty clause with the place for \a N variables. |
2876 | | /// |
2877 | | /// \param C AST context. |
2878 | | /// \param N The number of variables. |
2879 | | static OMPLastprivateClause *CreateEmpty(const ASTContext &C, unsigned N); |
2880 | | |
2881 | | /// Lastprivate kind. |
2882 | 8.13k | OpenMPLastprivateModifier getKind() const { return LPKind; } |
2883 | | /// Returns the location of the lastprivate kind. |
2884 | 2.02k | SourceLocation getKindLoc() const { return LPKindLoc; } |
2885 | | /// Returns the location of the ':' symbol, if any. |
2886 | 2.02k | SourceLocation getColonLoc() const { return ColonLoc; } |
2887 | | |
2888 | | using helper_expr_iterator = MutableArrayRef<Expr *>::iterator; |
2889 | | using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator; |
2890 | | using helper_expr_range = llvm::iterator_range<helper_expr_iterator>; |
2891 | | using helper_expr_const_range = |
2892 | | llvm::iterator_range<helper_expr_const_iterator>; |
2893 | | |
2894 | | /// Set list of helper expressions, required for generation of private |
2895 | | /// copies of original lastprivate variables. |
2896 | | void setPrivateCopies(ArrayRef<Expr *> PrivateCopies); |
2897 | | |
2898 | 540 | helper_expr_const_range private_copies() const { |
2899 | 540 | return helper_expr_const_range(getPrivateCopies().begin(), |
2900 | 540 | getPrivateCopies().end()); |
2901 | 540 | } |
2902 | | |
2903 | 5.39k | helper_expr_range private_copies() { |
2904 | 5.39k | return helper_expr_range(getPrivateCopies().begin(), |
2905 | 5.39k | getPrivateCopies().end()); |
2906 | 5.39k | } |
2907 | | |
2908 | 732 | helper_expr_const_range source_exprs() const { |
2909 | 732 | return helper_expr_const_range(getSourceExprs().begin(), |
2910 | 732 | getSourceExprs().end()); |
2911 | 732 | } |
2912 | | |
2913 | 476 | helper_expr_range source_exprs() { |
2914 | 476 | return helper_expr_range(getSourceExprs().begin(), getSourceExprs().end()); |
2915 | 476 | } |
2916 | | |
2917 | 1.27k | helper_expr_const_range destination_exprs() const { |
2918 | 1.27k | return helper_expr_const_range(getDestinationExprs().begin(), |
2919 | 1.27k | getDestinationExprs().end()); |
2920 | 1.27k | } |
2921 | | |
2922 | 476 | helper_expr_range destination_exprs() { |
2923 | 476 | return helper_expr_range(getDestinationExprs().begin(), |
2924 | 476 | getDestinationExprs().end()); |
2925 | 476 | } |
2926 | | |
2927 | 732 | helper_expr_const_range assignment_ops() const { |
2928 | 732 | return helper_expr_const_range(getAssignmentOps().begin(), |
2929 | 732 | getAssignmentOps().end()); |
2930 | 732 | } |
2931 | | |
2932 | 476 | helper_expr_range assignment_ops() { |
2933 | 476 | return helper_expr_range(getAssignmentOps().begin(), |
2934 | 476 | getAssignmentOps().end()); |
2935 | 476 | } |
2936 | | |
2937 | 9.59k | child_range children() { |
2938 | 9.59k | return child_range(reinterpret_cast<Stmt **>(varlist_begin()), |
2939 | 9.59k | reinterpret_cast<Stmt **>(varlist_end())); |
2940 | 9.59k | } |
2941 | | |
2942 | 0 | const_child_range children() const { |
2943 | 0 | auto Children = const_cast<OMPLastprivateClause *>(this)->children(); |
2944 | 0 | return const_child_range(Children.begin(), Children.end()); |
2945 | 0 | } |
2946 | | |
2947 | 1.50k | child_range used_children() { |
2948 | 1.50k | return child_range(child_iterator(), child_iterator()); |
2949 | 1.50k | } |
2950 | 0 | const_child_range used_children() const { |
2951 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
2952 | 0 | } |
2953 | | |
2954 | 352k | static bool classof(const OMPClause *T) { |
2955 | 352k | return T->getClauseKind() == llvm::omp::OMPC_lastprivate; |
2956 | 352k | } |
2957 | | }; |
2958 | | |
2959 | | /// This represents clause 'shared' in the '#pragma omp ...' directives. |
2960 | | /// |
2961 | | /// \code |
2962 | | /// #pragma omp parallel shared(a,b) |
2963 | | /// \endcode |
2964 | | /// In this example directive '#pragma omp parallel' has clause 'shared' |
2965 | | /// with the variables 'a' and 'b'. |
2966 | | class OMPSharedClause final |
2967 | | : public OMPVarListClause<OMPSharedClause>, |
2968 | | private llvm::TrailingObjects<OMPSharedClause, Expr *> { |
2969 | | friend OMPVarListClause; |
2970 | | friend TrailingObjects; |
2971 | | |
2972 | | /// Build clause with number of variables \a N. |
2973 | | /// |
2974 | | /// \param StartLoc Starting location of the clause. |
2975 | | /// \param LParenLoc Location of '('. |
2976 | | /// \param EndLoc Ending location of the clause. |
2977 | | /// \param N Number of the variables in the clause. |
2978 | | OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc, |
2979 | | SourceLocation EndLoc, unsigned N) |
2980 | | : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared, StartLoc, |
2981 | 4.52k | LParenLoc, EndLoc, N) {} |
2982 | | |
2983 | | /// Build an empty clause. |
2984 | | /// |
2985 | | /// \param N Number of variables. |
2986 | | explicit OMPSharedClause(unsigned N) |
2987 | | : OMPVarListClause<OMPSharedClause>(llvm::omp::OMPC_shared, |
2988 | | SourceLocation(), SourceLocation(), |
2989 | 473 | SourceLocation(), N) {} |
2990 | | |
2991 | | public: |
2992 | | /// Creates clause with a list of variables \a VL. |
2993 | | /// |
2994 | | /// \param C AST context. |
2995 | | /// \param StartLoc Starting location of the clause. |
2996 | | /// \param LParenLoc Location of '('. |
2997 | | /// \param EndLoc Ending location of the clause. |
2998 | | /// \param VL List of references to the variables. |
2999 | | static OMPSharedClause *Create(const ASTContext &C, SourceLocation StartLoc, |
3000 | | SourceLocation LParenLoc, |
3001 | | SourceLocation EndLoc, ArrayRef<Expr *> VL); |
3002 | | |
3003 | | /// Creates an empty clause with \a N variables. |
3004 | | /// |
3005 | | /// \param C AST context. |
3006 | | /// \param N The number of variables. |
3007 | | static OMPSharedClause *CreateEmpty(const ASTContext &C, unsigned N); |
3008 | | |
3009 | 782 | child_range children() { |
3010 | 782 | return child_range(reinterpret_cast<Stmt **>(varlist_begin()), |
3011 | 782 | reinterpret_cast<Stmt **>(varlist_end())); |
3012 | 782 | } |
3013 | | |
3014 | 0 | const_child_range children() const { |
3015 | 0 | auto Children = const_cast<OMPSharedClause *>(this)->children(); |
3016 | 0 | return const_child_range(Children.begin(), Children.end()); |
3017 | 0 | } |
3018 | | |
3019 | 1.55k | child_range used_children() { |
3020 | 1.55k | return child_range(child_iterator(), child_iterator()); |
3021 | 1.55k | } |
3022 | 0 | const_child_range used_children() const { |
3023 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
3024 | 0 | } |
3025 | | |
3026 | 1.64k | static bool classof(const OMPClause *T) { |
3027 | 1.64k | return T->getClauseKind() == llvm::omp::OMPC_shared; |
3028 | 1.64k | } |
3029 | | }; |
3030 | | |
3031 | | /// This represents clause 'reduction' in the '#pragma omp ...' |
3032 | | /// directives. |
3033 | | /// |
3034 | | /// \code |
3035 | | /// #pragma omp parallel reduction(+:a,b) |
3036 | | /// \endcode |
3037 | | /// In this example directive '#pragma omp parallel' has clause 'reduction' |
3038 | | /// with operator '+' and the variables 'a' and 'b'. |
3039 | | class OMPReductionClause final |
3040 | | : public OMPVarListClause<OMPReductionClause>, |
3041 | | public OMPClauseWithPostUpdate, |
3042 | | private llvm::TrailingObjects<OMPReductionClause, Expr *> { |
3043 | | friend class OMPClauseReader; |
3044 | | friend OMPVarListClause; |
3045 | | friend TrailingObjects; |
3046 | | |
3047 | | /// Reduction modifier. |
3048 | | OpenMPReductionClauseModifier Modifier = OMPC_REDUCTION_unknown; |
3049 | | |
3050 | | /// Reduction modifier location. |
3051 | | SourceLocation ModifierLoc; |
3052 | | |
3053 | | /// Location of ':'. |
3054 | | SourceLocation ColonLoc; |
3055 | | |
3056 | | /// Nested name specifier for C++. |
3057 | | NestedNameSpecifierLoc QualifierLoc; |
3058 | | |
3059 | | /// Name of custom operator. |
3060 | | DeclarationNameInfo NameInfo; |
3061 | | |
3062 | | /// Build clause with number of variables \a N. |
3063 | | /// |
3064 | | /// \param StartLoc Starting location of the clause. |
3065 | | /// \param LParenLoc Location of '('. |
3066 | | /// \param ModifierLoc Modifier location. |
3067 | | /// \param ColonLoc Location of ':'. |
3068 | | /// \param EndLoc Ending location of the clause. |
3069 | | /// \param N Number of the variables in the clause. |
3070 | | /// \param QualifierLoc The nested-name qualifier with location information |
3071 | | /// \param NameInfo The full name info for reduction identifier. |
3072 | | OMPReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc, |
3073 | | SourceLocation ModifierLoc, SourceLocation ColonLoc, |
3074 | | SourceLocation EndLoc, |
3075 | | OpenMPReductionClauseModifier Modifier, unsigned N, |
3076 | | NestedNameSpecifierLoc QualifierLoc, |
3077 | | const DeclarationNameInfo &NameInfo) |
3078 | | : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction, |
3079 | | StartLoc, LParenLoc, EndLoc, N), |
3080 | | OMPClauseWithPostUpdate(this), Modifier(Modifier), |
3081 | | ModifierLoc(ModifierLoc), ColonLoc(ColonLoc), |
3082 | 27.8k | QualifierLoc(QualifierLoc), NameInfo(NameInfo) {} |
3083 | | |
3084 | | /// Build an empty clause. |
3085 | | /// |
3086 | | /// \param N Number of variables. |
3087 | | explicit OMPReductionClause(unsigned N) |
3088 | | : OMPVarListClause<OMPReductionClause>(llvm::omp::OMPC_reduction, |
3089 | | SourceLocation(), SourceLocation(), |
3090 | | SourceLocation(), N), |
3091 | 1.00k | OMPClauseWithPostUpdate(this) {} |
3092 | | |
3093 | | /// Sets reduction modifier. |
3094 | 1.00k | void setModifier(OpenMPReductionClauseModifier M) { Modifier = M; } |
3095 | | |
3096 | | /// Sets location of the modifier. |
3097 | 1.00k | void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; } |
3098 | | |
3099 | | /// Sets location of ':' symbol in clause. |
3100 | 1.00k | void setColonLoc(SourceLocation CL) { ColonLoc = CL; } |
3101 | | |
3102 | | /// Sets the name info for specified reduction identifier. |
3103 | 1.00k | void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; } |
3104 | | |
3105 | | /// Sets the nested name specifier. |
3106 | 1.00k | void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; } |
3107 | | |
3108 | | /// Set list of helper expressions, required for proper codegen of the |
3109 | | /// clause. These expressions represent private copy of the reduction |
3110 | | /// variable. |
3111 | | void setPrivates(ArrayRef<Expr *> Privates); |
3112 | | |
3113 | | /// Get the list of helper privates. |
3114 | 165k | MutableArrayRef<Expr *> getPrivates() { |
3115 | 165k | return MutableArrayRef<Expr *>(varlist_end(), varlist_size()); |
3116 | 165k | } |
3117 | 29.8k | ArrayRef<const Expr *> getPrivates() const { |
3118 | 29.8k | return llvm::makeArrayRef(varlist_end(), varlist_size()); |
3119 | 29.8k | } |
3120 | | |
3121 | | /// Set list of helper expressions, required for proper codegen of the |
3122 | | /// clause. These expressions represent LHS expression in the final |
3123 | | /// reduction expression performed by the reduction clause. |
3124 | | void setLHSExprs(ArrayRef<Expr *> LHSExprs); |
3125 | | |
3126 | | /// Get the list of helper LHS expressions. |
3127 | 104k | MutableArrayRef<Expr *> getLHSExprs() { |
3128 | 104k | return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size()); |
3129 | 104k | } |
3130 | 22.4k | ArrayRef<const Expr *> getLHSExprs() const { |
3131 | 22.4k | return llvm::makeArrayRef(getPrivates().end(), varlist_size()); |
3132 | 22.4k | } |
3133 | | |
3134 | | /// Set list of helper expressions, required for proper codegen of the |
3135 | | /// clause. These expressions represent RHS expression in the final |
3136 | | /// reduction expression performed by the reduction clause. |
3137 | | /// Also, variables in these expressions are used for proper initialization of |
3138 | | /// reduction copies. |
3139 | | void setRHSExprs(ArrayRef<Expr *> RHSExprs); |
3140 | | |
3141 | | /// Get the list of helper destination expressions. |
3142 | 73.2k | MutableArrayRef<Expr *> getRHSExprs() { |
3143 | 73.2k | return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size()); |
3144 | 73.2k | } |
3145 | 15.3k | ArrayRef<const Expr *> getRHSExprs() const { |
3146 | 15.3k | return llvm::makeArrayRef(getLHSExprs().end(), varlist_size()); |
3147 | 15.3k | } |
3148 | | |
3149 | | /// Set list of helper reduction expressions, required for proper |
3150 | | /// codegen of the clause. These expressions are binary expressions or |
3151 | | /// operator/custom reduction call that calculates new value from source |
3152 | | /// helper expressions to destination helper expressions. |
3153 | | void setReductionOps(ArrayRef<Expr *> ReductionOps); |
3154 | | |
3155 | | /// Get the list of helper reduction expressions. |
3156 | 42.3k | MutableArrayRef<Expr *> getReductionOps() { |
3157 | 42.3k | return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size()); |
3158 | 42.3k | } |
3159 | 8.16k | ArrayRef<const Expr *> getReductionOps() const { |
3160 | 8.16k | return llvm::makeArrayRef(getRHSExprs().end(), varlist_size()); |
3161 | 8.16k | } |
3162 | | |
3163 | | /// Set list of helper copy operations for inscan reductions. |
3164 | | /// The form is: Temps[i] = LHS[i]; |
3165 | | void setInscanCopyOps(ArrayRef<Expr *> Ops); |
3166 | | |
3167 | | /// Get the list of helper inscan copy operations. |
3168 | 560 | MutableArrayRef<Expr *> getInscanCopyOps() { |
3169 | 560 | return MutableArrayRef<Expr *>(getReductionOps().end(), varlist_size()); |
3170 | 560 | } |
3171 | 1.00k | ArrayRef<const Expr *> getInscanCopyOps() const { |
3172 | 1.00k | return llvm::makeArrayRef(getReductionOps().end(), varlist_size()); |
3173 | 1.00k | } |
3174 | | |
3175 | | /// Set list of helper temp vars for inscan copy array operations. |
3176 | | void setInscanCopyArrayTemps(ArrayRef<Expr *> CopyArrayTemps); |
3177 | | |
3178 | | /// Get the list of helper inscan copy temps. |
3179 | 350 | MutableArrayRef<Expr *> getInscanCopyArrayTemps() { |
3180 | 350 | return MutableArrayRef<Expr *>(getInscanCopyOps().end(), varlist_size()); |
3181 | 350 | } |
3182 | 704 | ArrayRef<const Expr *> getInscanCopyArrayTemps() const { |
3183 | 704 | return llvm::makeArrayRef(getInscanCopyOps().end(), varlist_size()); |
3184 | 704 | } |
3185 | | |
3186 | | /// Set list of helper temp elements vars for inscan copy array operations. |
3187 | | void setInscanCopyArrayElems(ArrayRef<Expr *> CopyArrayElems); |
3188 | | |
3189 | | /// Get the list of helper inscan copy temps. |
3190 | 48 | MutableArrayRef<Expr *> getInscanCopyArrayElems() { |
3191 | 48 | return MutableArrayRef<Expr *>(getInscanCopyArrayTemps().end(), |
3192 | 48 | varlist_size()); |
3193 | 48 | } |
3194 | 364 | ArrayRef<const Expr *> getInscanCopyArrayElems() const { |
3195 | 364 | return llvm::makeArrayRef(getInscanCopyArrayTemps().end(), varlist_size()); |
3196 | 364 | } |
3197 | | |
3198 | | public: |
3199 | | /// Creates clause with a list of variables \a VL. |
3200 | | /// |
3201 | | /// \param StartLoc Starting location of the clause. |
3202 | | /// \param LParenLoc Location of '('. |
3203 | | /// \param ModifierLoc Modifier location. |
3204 | | /// \param ColonLoc Location of ':'. |
3205 | | /// \param EndLoc Ending location of the clause. |
3206 | | /// \param VL The variables in the clause. |
3207 | | /// \param QualifierLoc The nested-name qualifier with location information |
3208 | | /// \param NameInfo The full name info for reduction identifier. |
3209 | | /// \param Privates List of helper expressions for proper generation of |
3210 | | /// private copies. |
3211 | | /// \param LHSExprs List of helper expressions for proper generation of |
3212 | | /// assignment operation required for copyprivate clause. This list represents |
3213 | | /// LHSs of the reduction expressions. |
3214 | | /// \param RHSExprs List of helper expressions for proper generation of |
3215 | | /// assignment operation required for copyprivate clause. This list represents |
3216 | | /// RHSs of the reduction expressions. |
3217 | | /// Also, variables in these expressions are used for proper initialization of |
3218 | | /// reduction copies. |
3219 | | /// \param ReductionOps List of helper expressions that represents reduction |
3220 | | /// expressions: |
3221 | | /// \code |
3222 | | /// LHSExprs binop RHSExprs; |
3223 | | /// operator binop(LHSExpr, RHSExpr); |
3224 | | /// <CutomReduction>(LHSExpr, RHSExpr); |
3225 | | /// \endcode |
3226 | | /// Required for proper codegen of final reduction operation performed by the |
3227 | | /// reduction clause. |
3228 | | /// \param CopyOps List of copy operations for inscan reductions: |
3229 | | /// \code |
3230 | | /// TempExprs = LHSExprs; |
3231 | | /// \endcode |
3232 | | /// \param CopyArrayTemps Temp arrays for prefix sums. |
3233 | | /// \param CopyArrayElems Temp arrays for prefix sums. |
3234 | | /// \param PreInit Statement that must be executed before entering the OpenMP |
3235 | | /// region with this clause. |
3236 | | /// \param PostUpdate Expression that must be executed after exit from the |
3237 | | /// OpenMP region with this clause. |
3238 | | static OMPReductionClause * |
3239 | | Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, |
3240 | | SourceLocation ModifierLoc, SourceLocation ColonLoc, |
3241 | | SourceLocation EndLoc, OpenMPReductionClauseModifier Modifier, |
3242 | | ArrayRef<Expr *> VL, NestedNameSpecifierLoc QualifierLoc, |
3243 | | const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates, |
3244 | | ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs, |
3245 | | ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> CopyOps, |
3246 | | ArrayRef<Expr *> CopyArrayTemps, ArrayRef<Expr *> CopyArrayElems, |
3247 | | Stmt *PreInit, Expr *PostUpdate); |
3248 | | |
3249 | | /// Creates an empty clause with the place for \a N variables. |
3250 | | /// |
3251 | | /// \param C AST context. |
3252 | | /// \param N The number of variables. |
3253 | | /// \param Modifier Reduction modifier. |
3254 | | static OMPReductionClause * |
3255 | | CreateEmpty(const ASTContext &C, unsigned N, |
3256 | | OpenMPReductionClauseModifier Modifier); |
3257 | | |
3258 | | /// Returns modifier. |
3259 | 93.5k | OpenMPReductionClauseModifier getModifier() const { return Modifier; } |
3260 | | |
3261 | | /// Returns modifier location. |
3262 | 23.0k | SourceLocation getModifierLoc() const { return ModifierLoc; } |
3263 | | |
3264 | | /// Gets location of ':' symbol in clause. |
3265 | 20.7k | SourceLocation getColonLoc() const { return ColonLoc; } |
3266 | | |
3267 | | /// Gets the name info for specified reduction identifier. |
3268 | 23.7k | const DeclarationNameInfo &getNameInfo() const { return NameInfo; } |
3269 | | |
3270 | | /// Gets the nested name specifier. |
3271 | 23.3k | NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; } |
3272 | | |
3273 | | using helper_expr_iterator = MutableArrayRef<Expr *>::iterator; |
3274 | | using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator; |
3275 | | using helper_expr_range = llvm::iterator_range<helper_expr_iterator>; |
3276 | | using helper_expr_const_range = |
3277 | | llvm::iterator_range<helper_expr_const_iterator>; |
3278 | | |
3279 | 3.67k | helper_expr_const_range privates() const { |
3280 | 3.67k | return helper_expr_const_range(getPrivates().begin(), getPrivates().end()); |
3281 | 3.67k | } |
3282 | | |
3283 | 16.2k | helper_expr_range privates() { |
3284 | 16.2k | return helper_expr_range(getPrivates().begin(), getPrivates().end()); |
3285 | 16.2k | } |
3286 | | |
3287 | 3.58k | helper_expr_const_range lhs_exprs() const { |
3288 | 3.58k | return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end()); |
3289 | 3.58k | } |
3290 | | |
3291 | 1.05k | helper_expr_range lhs_exprs() { |
3292 | 1.05k | return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end()); |
3293 | 1.05k | } |
3294 | | |
3295 | 3.58k | helper_expr_const_range rhs_exprs() const { |
3296 | 3.58k | return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end()); |
3297 | 3.58k | } |
3298 | | |
3299 | 1.05k | helper_expr_range rhs_exprs() { |
3300 | 1.05k | return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end()); |
3301 | 1.05k | } |
3302 | | |
3303 | 3.58k | helper_expr_const_range reduction_ops() const { |
3304 | 3.58k | return helper_expr_const_range(getReductionOps().begin(), |
3305 | 3.58k | getReductionOps().end()); |
3306 | 3.58k | } |
3307 | | |
3308 | 20.7k | helper_expr_range reduction_ops() { |
3309 | 20.7k | return helper_expr_range(getReductionOps().begin(), |
3310 | 20.7k | getReductionOps().end()); |
3311 | 20.7k | } |
3312 | | |
3313 | 150 | helper_expr_const_range copy_ops() const { |
3314 | 150 | return helper_expr_const_range(getInscanCopyOps().begin(), |
3315 | 150 | getInscanCopyOps().end()); |
3316 | 150 | } |
3317 | | |
3318 | 24 | helper_expr_range copy_ops() { |
3319 | 24 | return helper_expr_range(getInscanCopyOps().begin(), |
3320 | 24 | getInscanCopyOps().end()); |
3321 | 24 | } |
3322 | | |
3323 | 170 | helper_expr_const_range copy_array_temps() const { |
3324 | 170 | return helper_expr_const_range(getInscanCopyArrayTemps().begin(), |
3325 | 170 | getInscanCopyArrayTemps().end()); |
3326 | 170 | } |
3327 | | |
3328 | 70 | helper_expr_range copy_array_temps() { |
3329 | 70 | return helper_expr_range(getInscanCopyArrayTemps().begin(), |
3330 | 70 | getInscanCopyArrayTemps().end()); |
3331 | 70 | } |
3332 | | |
3333 | 182 | helper_expr_const_range copy_array_elems() const { |
3334 | 182 | return helper_expr_const_range(getInscanCopyArrayElems().begin(), |
3335 | 182 | getInscanCopyArrayElems().end()); |
3336 | 182 | } |
3337 | | |
3338 | 24 | helper_expr_range copy_array_elems() { |
3339 | 24 | return helper_expr_range(getInscanCopyArrayElems().begin(), |
3340 | 24 | getInscanCopyArrayElems().end()); |
3341 | 24 | } |
3342 | | |
3343 | 33.0k | child_range children() { |
3344 | 33.0k | return child_range(reinterpret_cast<Stmt **>(varlist_begin()), |
3345 | 33.0k | reinterpret_cast<Stmt **>(varlist_end())); |
3346 | 33.0k | } |
3347 | | |
3348 | 0 | const_child_range children() const { |
3349 | 0 | auto Children = const_cast<OMPReductionClause *>(this)->children(); |
3350 | 0 | return const_child_range(Children.begin(), Children.end()); |
3351 | 0 | } |
3352 | | |
3353 | 8.77k | child_range used_children() { |
3354 | 8.77k | return child_range(reinterpret_cast<Stmt **>(varlist_begin()), |
3355 | 8.77k | reinterpret_cast<Stmt **>(varlist_end())); |
3356 | 8.77k | } |
3357 | 0 | const_child_range used_children() const { |
3358 | 0 | auto Children = const_cast<OMPReductionClause *>(this)->used_children(); |
3359 | 0 | return const_child_range(Children.begin(), Children.end()); |
3360 | 0 | } |
3361 | | |
3362 | 315k | static bool classof(const OMPClause *T) { |
3363 | 315k | return T->getClauseKind() == llvm::omp::OMPC_reduction; |
3364 | 315k | } |
3365 | | }; |
3366 | | |
3367 | | /// This represents clause 'task_reduction' in the '#pragma omp taskgroup' |
3368 | | /// directives. |
3369 | | /// |
3370 | | /// \code |
3371 | | /// #pragma omp taskgroup task_reduction(+:a,b) |
3372 | | /// \endcode |
3373 | | /// In this example directive '#pragma omp taskgroup' has clause |
3374 | | /// 'task_reduction' with operator '+' and the variables 'a' and 'b'. |
3375 | | class OMPTaskReductionClause final |
3376 | | : public OMPVarListClause<OMPTaskReductionClause>, |
3377 | | public OMPClauseWithPostUpdate, |
3378 | | private llvm::TrailingObjects<OMPTaskReductionClause, Expr *> { |
3379 | | friend class OMPClauseReader; |
3380 | | friend OMPVarListClause; |
3381 | | friend TrailingObjects; |
3382 | | |
3383 | | /// Location of ':'. |
3384 | | SourceLocation ColonLoc; |
3385 | | |
3386 | | /// Nested name specifier for C++. |
3387 | | NestedNameSpecifierLoc QualifierLoc; |
3388 | | |
3389 | | /// Name of custom operator. |
3390 | | DeclarationNameInfo NameInfo; |
3391 | | |
3392 | | /// Build clause with number of variables \a N. |
3393 | | /// |
3394 | | /// \param StartLoc Starting location of the clause. |
3395 | | /// \param LParenLoc Location of '('. |
3396 | | /// \param EndLoc Ending location of the clause. |
3397 | | /// \param ColonLoc Location of ':'. |
3398 | | /// \param N Number of the variables in the clause. |
3399 | | /// \param QualifierLoc The nested-name qualifier with location information |
3400 | | /// \param NameInfo The full name info for reduction identifier. |
3401 | | OMPTaskReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc, |
3402 | | SourceLocation ColonLoc, SourceLocation EndLoc, |
3403 | | unsigned N, NestedNameSpecifierLoc QualifierLoc, |
3404 | | const DeclarationNameInfo &NameInfo) |
3405 | | : OMPVarListClause<OMPTaskReductionClause>( |
3406 | | llvm::omp::OMPC_task_reduction, StartLoc, LParenLoc, EndLoc, N), |
3407 | | OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc), |
3408 | 3.06k | QualifierLoc(QualifierLoc), NameInfo(NameInfo) {} |
3409 | | |
3410 | | /// Build an empty clause. |
3411 | | /// |
3412 | | /// \param N Number of variables. |
3413 | | explicit OMPTaskReductionClause(unsigned N) |
3414 | | : OMPVarListClause<OMPTaskReductionClause>( |
3415 | | llvm::omp::OMPC_task_reduction, SourceLocation(), SourceLocation(), |
3416 | | SourceLocation(), N), |
3417 | 112 | OMPClauseWithPostUpdate(this) {} |
3418 | | |
3419 | | /// Sets location of ':' symbol in clause. |
3420 | 112 | void setColonLoc(SourceLocation CL) { ColonLoc = CL; } |
3421 | | |
3422 | | /// Sets the name info for specified reduction identifier. |
3423 | 112 | void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; } |
3424 | | |
3425 | | /// Sets the nested name specifier. |
3426 | 112 | void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; } |
3427 | | |
3428 | | /// Set list of helper expressions, required for proper codegen of the clause. |
3429 | | /// These expressions represent private copy of the reduction variable. |
3430 | | void setPrivates(ArrayRef<Expr *> Privates); |
3431 | | |
3432 | | /// Get the list of helper privates. |
3433 | 17.7k | MutableArrayRef<Expr *> getPrivates() { |
3434 | 17.7k | return MutableArrayRef<Expr *>(varlist_end(), varlist_size()); |
3435 | 17.7k | } |
3436 | 1.27k | ArrayRef<const Expr *> getPrivates() const { |
3437 | 1.27k | return llvm::makeArrayRef(varlist_end(), varlist_size()); |
3438 | 1.27k | } |
3439 | | |
3440 | | /// Set list of helper expressions, required for proper codegen of the clause. |
3441 | | /// These expressions represent LHS expression in the final reduction |
3442 | | /// expression performed by the reduction clause. |
3443 | | void setLHSExprs(ArrayRef<Expr *> LHSExprs); |
3444 | | |
3445 | | /// Get the list of helper LHS expressions. |
3446 | 10.3k | MutableArrayRef<Expr *> getLHSExprs() { |
3447 | 10.3k | return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size()); |
3448 | 10.3k | } |
3449 | 954 | ArrayRef<const Expr *> getLHSExprs() const { |
3450 | 954 | return llvm::makeArrayRef(getPrivates().end(), varlist_size()); |
3451 | 954 | } |
3452 | | |
3453 | | /// Set list of helper expressions, required for proper codegen of the clause. |
3454 | | /// These expressions represent RHS expression in the final reduction |
3455 | | /// expression performed by the reduction clause. Also, variables in these |
3456 | | /// expressions are used for proper initialization of reduction copies. |
3457 | | void setRHSExprs(ArrayRef<Expr *> RHSExprs); |
3458 | | |
3459 | | /// Get the list of helper destination expressions. |
3460 | 6.97k | MutableArrayRef<Expr *> getRHSExprs() { |
3461 | 6.97k | return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size()); |
3462 | 6.97k | } |
3463 | 636 | ArrayRef<const Expr *> getRHSExprs() const { |
3464 | 636 | return llvm::makeArrayRef(getLHSExprs().end(), varlist_size()); |
3465 | 636 | } |
3466 | | |
3467 | | /// Set list of helper reduction expressions, required for proper |
3468 | | /// codegen of the clause. These expressions are binary expressions or |
3469 | | /// operator/custom reduction call that calculates new value from source |
3470 | | /// helper expressions to destination helper expressions. |
3471 | | void setReductionOps(ArrayRef<Expr *> ReductionOps); |
3472 | | |
3473 | | /// Get the list of helper reduction expressions. |
3474 | 3.57k | MutableArrayRef<Expr *> getReductionOps() { |
3475 | 3.57k | return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size()); |
3476 | 3.57k | } |
3477 | 318 | ArrayRef<const Expr *> getReductionOps() const { |
3478 | 318 | return llvm::makeArrayRef(getRHSExprs().end(), varlist_size()); |
3479 | 318 | } |
3480 | | |
3481 | | public: |
3482 | | /// Creates clause with a list of variables \a VL. |
3483 | | /// |
3484 | | /// \param StartLoc Starting location of the clause. |
3485 | | /// \param LParenLoc Location of '('. |
3486 | | /// \param ColonLoc Location of ':'. |
3487 | | /// \param EndLoc Ending location of the clause. |
3488 | | /// \param VL The variables in the clause. |
3489 | | /// \param QualifierLoc The nested-name qualifier with location information |
3490 | | /// \param NameInfo The full name info for reduction identifier. |
3491 | | /// \param Privates List of helper expressions for proper generation of |
3492 | | /// private copies. |
3493 | | /// \param LHSExprs List of helper expressions for proper generation of |
3494 | | /// assignment operation required for copyprivate clause. This list represents |
3495 | | /// LHSs of the reduction expressions. |
3496 | | /// \param RHSExprs List of helper expressions for proper generation of |
3497 | | /// assignment operation required for copyprivate clause. This list represents |
3498 | | /// RHSs of the reduction expressions. |
3499 | | /// Also, variables in these expressions are used for proper initialization of |
3500 | | /// reduction copies. |
3501 | | /// \param ReductionOps List of helper expressions that represents reduction |
3502 | | /// expressions: |
3503 | | /// \code |
3504 | | /// LHSExprs binop RHSExprs; |
3505 | | /// operator binop(LHSExpr, RHSExpr); |
3506 | | /// <CutomReduction>(LHSExpr, RHSExpr); |
3507 | | /// \endcode |
3508 | | /// Required for proper codegen of final reduction operation performed by the |
3509 | | /// reduction clause. |
3510 | | /// \param PreInit Statement that must be executed before entering the OpenMP |
3511 | | /// region with this clause. |
3512 | | /// \param PostUpdate Expression that must be executed after exit from the |
3513 | | /// OpenMP region with this clause. |
3514 | | static OMPTaskReductionClause * |
3515 | | Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, |
3516 | | SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL, |
3517 | | NestedNameSpecifierLoc QualifierLoc, |
3518 | | const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates, |
3519 | | ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs, |
3520 | | ArrayRef<Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate); |
3521 | | |
3522 | | /// Creates an empty clause with the place for \a N variables. |
3523 | | /// |
3524 | | /// \param C AST context. |
3525 | | /// \param N The number of variables. |
3526 | | static OMPTaskReductionClause *CreateEmpty(const ASTContext &C, unsigned N); |
3527 | | |
3528 | | /// Gets location of ':' symbol in clause. |
3529 | 1.78k | SourceLocation getColonLoc() const { return ColonLoc; } |
3530 | | |
3531 | | /// Gets the name info for specified reduction identifier. |
3532 | 2.21k | const DeclarationNameInfo &getNameInfo() const { return NameInfo; } |
3533 | | |
3534 | | /// Gets the nested name specifier. |
3535 | 2.19k | NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; } |
3536 | | |
3537 | | using helper_expr_iterator = MutableArrayRef<Expr *>::iterator; |
3538 | | using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator; |
3539 | | using helper_expr_range = llvm::iterator_range<helper_expr_iterator>; |
3540 | | using helper_expr_const_range = |
3541 | | llvm::iterator_range<helper_expr_const_iterator>; |
3542 | | |
3543 | 159 | helper_expr_const_range privates() const { |
3544 | 159 | return helper_expr_const_range(getPrivates().begin(), getPrivates().end()); |
3545 | 159 | } |
3546 | | |
3547 | 2.08k | helper_expr_range privates() { |
3548 | 2.08k | return helper_expr_range(getPrivates().begin(), getPrivates().end()); |
3549 | 2.08k | } |
3550 | | |
3551 | 159 | helper_expr_const_range lhs_exprs() const { |
3552 | 159 | return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end()); |
3553 | 159 | } |
3554 | | |
3555 | 112 | helper_expr_range lhs_exprs() { |
3556 | 112 | return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end()); |
3557 | 112 | } |
3558 | | |
3559 | 159 | helper_expr_const_range rhs_exprs() const { |
3560 | 159 | return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end()); |
3561 | 159 | } |
3562 | | |
3563 | 112 | helper_expr_range rhs_exprs() { |
3564 | 112 | return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end()); |
3565 | 112 | } |
3566 | | |
3567 | 159 | helper_expr_const_range reduction_ops() const { |
3568 | 159 | return helper_expr_const_range(getReductionOps().begin(), |
3569 | 159 | getReductionOps().end()); |
3570 | 159 | } |
3571 | | |
3572 | 1.78k | helper_expr_range reduction_ops() { |
3573 | 1.78k | return helper_expr_range(getReductionOps().begin(), |
3574 | 1.78k | getReductionOps().end()); |
3575 | 1.78k | } |
3576 | | |
3577 | 3.03k | child_range children() { |
3578 | 3.03k | return child_range(reinterpret_cast<Stmt **>(varlist_begin()), |
3579 | 3.03k | reinterpret_cast<Stmt **>(varlist_end())); |
3580 | 3.03k | } |
3581 | | |
3582 | 0 | const_child_range children() const { |
3583 | 0 | auto Children = const_cast<OMPTaskReductionClause *>(this)->children(); |
3584 | 0 | return const_child_range(Children.begin(), Children.end()); |
3585 | 0 | } |
3586 | | |
3587 | 468 | child_range used_children() { |
3588 | 468 | return child_range(child_iterator(), child_iterator()); |
3589 | 468 | } |
3590 | 0 | const_child_range used_children() const { |
3591 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
3592 | 0 | } |
3593 | | |
3594 | 3.70k | static bool classof(const OMPClause *T) { |
3595 | 3.70k | return T->getClauseKind() == llvm::omp::OMPC_task_reduction; |
3596 | 3.70k | } |
3597 | | }; |
3598 | | |
3599 | | /// This represents clause 'in_reduction' in the '#pragma omp task' directives. |
3600 | | /// |
3601 | | /// \code |
3602 | | /// #pragma omp task in_reduction(+:a,b) |
3603 | | /// \endcode |
3604 | | /// In this example directive '#pragma omp task' has clause 'in_reduction' with |
3605 | | /// operator '+' and the variables 'a' and 'b'. |
3606 | | class OMPInReductionClause final |
3607 | | : public OMPVarListClause<OMPInReductionClause>, |
3608 | | public OMPClauseWithPostUpdate, |
3609 | | private llvm::TrailingObjects<OMPInReductionClause, Expr *> { |
3610 | | friend class OMPClauseReader; |
3611 | | friend OMPVarListClause; |
3612 | | friend TrailingObjects; |
3613 | | |
3614 | | /// Location of ':'. |
3615 | | SourceLocation ColonLoc; |
3616 | | |
3617 | | /// Nested name specifier for C++. |
3618 | | NestedNameSpecifierLoc QualifierLoc; |
3619 | | |
3620 | | /// Name of custom operator. |
3621 | | DeclarationNameInfo NameInfo; |
3622 | | |
3623 | | /// Build clause with number of variables \a N. |
3624 | | /// |
3625 | | /// \param StartLoc Starting location of the clause. |
3626 | | /// \param LParenLoc Location of '('. |
3627 | | /// \param EndLoc Ending location of the clause. |
3628 | | /// \param ColonLoc Location of ':'. |
3629 | | /// \param N Number of the variables in the clause. |
3630 | | /// \param QualifierLoc The nested-name qualifier with location information |
3631 | | /// \param NameInfo The full name info for reduction identifier. |
3632 | | OMPInReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc, |
3633 | | SourceLocation ColonLoc, SourceLocation EndLoc, |
3634 | | unsigned N, NestedNameSpecifierLoc QualifierLoc, |
3635 | | const DeclarationNameInfo &NameInfo) |
3636 | | : OMPVarListClause<OMPInReductionClause>(llvm::omp::OMPC_in_reduction, |
3637 | | StartLoc, LParenLoc, EndLoc, N), |
3638 | | OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc), |
3639 | 2.15k | QualifierLoc(QualifierLoc), NameInfo(NameInfo) {} |
3640 | | |
3641 | | /// Build an empty clause. |
3642 | | /// |
3643 | | /// \param N Number of variables. |
3644 | | explicit OMPInReductionClause(unsigned N) |
3645 | | : OMPVarListClause<OMPInReductionClause>( |
3646 | | llvm::omp::OMPC_in_reduction, SourceLocation(), SourceLocation(), |
3647 | | SourceLocation(), N), |
3648 | 91 | OMPClauseWithPostUpdate(this) {} |
3649 | | |
3650 | | /// Sets location of ':' symbol in clause. |
3651 | 91 | void setColonLoc(SourceLocation CL) { ColonLoc = CL; } |
3652 | | |
3653 | | /// Sets the name info for specified reduction identifier. |
3654 | 91 | void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; } |
3655 | | |
3656 | | /// Sets the nested name specifier. |
3657 | 91 | void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; } |
3658 | | |
3659 | | /// Set list of helper expressions, required for proper codegen of the clause. |
3660 | | /// These expressions represent private copy of the reduction variable. |
3661 | | void setPrivates(ArrayRef<Expr *> Privates); |
3662 | | |
3663 | | /// Get the list of helper privates. |
3664 | 20.2k | MutableArrayRef<Expr *> getPrivates() { |
3665 | 20.2k | return MutableArrayRef<Expr *>(varlist_end(), varlist_size()); |
3666 | 20.2k | } |
3667 | 348 | ArrayRef<const Expr *> getPrivates() const { |
3668 | 348 | return llvm::makeArrayRef(varlist_end(), varlist_size()); |
3669 | 348 | } |
3670 | | |
3671 | | /// Set list of helper expressions, required for proper codegen of the clause. |
3672 | | /// These expressions represent LHS expression in the final reduction |
3673 | | /// expression performed by the reduction clause. |
3674 | | void setLHSExprs(ArrayRef<Expr *> LHSExprs); |
3675 | | |
3676 | | /// Get the list of helper LHS expressions. |
3677 | 15.3k | MutableArrayRef<Expr *> getLHSExprs() { |
3678 | 15.3k | return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size()); |
3679 | 15.3k | } |
3680 | 240 | ArrayRef<const Expr *> getLHSExprs() const { |
3681 | 240 | return llvm::makeArrayRef(getPrivates().end(), varlist_size()); |
3682 | 240 | } |
3683 | | |
3684 | | /// Set list of helper expressions, required for proper codegen of the clause. |
3685 | | /// These expressions represent RHS expression in the final reduction |
3686 | | /// expression performed by the reduction clause. Also, variables in these |
3687 | | /// expressions are used for proper initialization of reduction copies. |
3688 | | void setRHSExprs(ArrayRef<Expr *> RHSExprs); |
3689 | | |
3690 | | /// Get the list of helper destination expressions. |
3691 | 12.8k | MutableArrayRef<Expr *> getRHSExprs() { |
3692 | 12.8k | return MutableArrayRef<Expr *>(getLHSExprs().end(), varlist_size()); |
3693 | 12.8k | } |
3694 | 224 | ArrayRef<const Expr *> getRHSExprs() const { |
3695 | 224 | return llvm::makeArrayRef(getLHSExprs().end(), varlist_size()); |
3696 | 224 | } |
3697 | | |
3698 | | /// Set list of helper reduction expressions, required for proper |
3699 | | /// codegen of the clause. These expressions are binary expressions or |
3700 | | /// operator/custom reduction call that calculates new value from source |
3701 | | /// helper expressions to destination helper expressions. |
3702 | | void setReductionOps(ArrayRef<Expr *> ReductionOps); |
3703 | | |
3704 | | /// Get the list of helper reduction expressions. |
3705 | 10.4k | MutableArrayRef<Expr *> getReductionOps() { |
3706 | 10.4k | return MutableArrayRef<Expr *>(getRHSExprs().end(), varlist_size()); |
3707 | 10.4k | } |
3708 | 208 | ArrayRef<const Expr *> getReductionOps() const { |
3709 | 208 | return llvm::makeArrayRef(getRHSExprs().end(), varlist_size()); |
3710 | 208 | } |
3711 | | |
3712 | | /// Set list of helper reduction taskgroup descriptors. |
3713 | | void setTaskgroupDescriptors(ArrayRef<Expr *> ReductionOps); |
3714 | | |
3715 | | /// Get the list of helper reduction taskgroup descriptors. |
3716 | 4.87k | MutableArrayRef<Expr *> getTaskgroupDescriptors() { |
3717 | 4.87k | return MutableArrayRef<Expr *>(getReductionOps().end(), varlist_size()); |
3718 | 4.87k | } |
3719 | 100 | ArrayRef<const Expr *> getTaskgroupDescriptors() const { |
3720 | 100 | return llvm::makeArrayRef(getReductionOps().end(), varlist_size()); |
3721 | 100 | } |
3722 | | |
3723 | | public: |
3724 | | /// Creates clause with a list of variables \a VL. |
3725 | | /// |
3726 | | /// \param StartLoc Starting location of the clause. |
3727 | | /// \param LParenLoc Location of '('. |
3728 | | /// \param ColonLoc Location of ':'. |
3729 | | /// \param EndLoc Ending location of the clause. |
3730 | | /// \param VL The variables in the clause. |
3731 | | /// \param QualifierLoc The nested-name qualifier with location information |
3732 | | /// \param NameInfo The full name info for reduction identifier. |
3733 | | /// \param Privates List of helper expressions for proper generation of |
3734 | | /// private copies. |
3735 | | /// \param LHSExprs List of helper expressions for proper generation of |
3736 | | /// assignment operation required for copyprivate clause. This list represents |
3737 | | /// LHSs of the reduction expressions. |
3738 | | /// \param RHSExprs List of helper expressions for proper generation of |
3739 | | /// assignment operation required for copyprivate clause. This list represents |
3740 | | /// RHSs of the reduction expressions. |
3741 | | /// Also, variables in these expressions are used for proper initialization of |
3742 | | /// reduction copies. |
3743 | | /// \param ReductionOps List of helper expressions that represents reduction |
3744 | | /// expressions: |
3745 | | /// \code |
3746 | | /// LHSExprs binop RHSExprs; |
3747 | | /// operator binop(LHSExpr, RHSExpr); |
3748 | | /// <CutomReduction>(LHSExpr, RHSExpr); |
3749 | | /// \endcode |
3750 | | /// Required for proper codegen of final reduction operation performed by the |
3751 | | /// reduction clause. |
3752 | | /// \param TaskgroupDescriptors List of helper taskgroup descriptors for |
3753 | | /// corresponding items in parent taskgroup task_reduction clause. |
3754 | | /// \param PreInit Statement that must be executed before entering the OpenMP |
3755 | | /// region with this clause. |
3756 | | /// \param PostUpdate Expression that must be executed after exit from the |
3757 | | /// OpenMP region with this clause. |
3758 | | static OMPInReductionClause * |
3759 | | Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, |
3760 | | SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL, |
3761 | | NestedNameSpecifierLoc QualifierLoc, |
3762 | | const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> Privates, |
3763 | | ArrayRef<Expr *> LHSExprs, ArrayRef<Expr *> RHSExprs, |
3764 | | ArrayRef<Expr *> ReductionOps, ArrayRef<Expr *> TaskgroupDescriptors, |
3765 | | Stmt *PreInit, Expr *PostUpdate); |
3766 | | |
3767 | | /// Creates an empty clause with the place for \a N variables. |
3768 | | /// |
3769 | | /// \param C AST context. |
3770 | | /// \param N The number of variables. |
3771 | | static OMPInReductionClause *CreateEmpty(const ASTContext &C, unsigned N); |
3772 | | |
3773 | | /// Gets location of ':' symbol in clause. |
3774 | 1.67k | SourceLocation getColonLoc() const { return ColonLoc; } |
3775 | | |
3776 | | /// Gets the name info for specified reduction identifier. |
3777 | 1.86k | const DeclarationNameInfo &getNameInfo() const { return NameInfo; } |
3778 | | |
3779 | | /// Gets the nested name specifier. |
3780 | 1.85k | NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; } |
3781 | | |
3782 | | using helper_expr_iterator = MutableArrayRef<Expr *>::iterator; |
3783 | | using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator; |
3784 | | using helper_expr_range = llvm::iterator_range<helper_expr_iterator>; |
3785 | | using helper_expr_const_range = |
3786 | | llvm::iterator_range<helper_expr_const_iterator>; |
3787 | | |
3788 | 54 | helper_expr_const_range privates() const { |
3789 | 54 | return helper_expr_const_range(getPrivates().begin(), getPrivates().end()); |
3790 | 54 | } |
3791 | | |
3792 | 1.36k | helper_expr_range privates() { |
3793 | 1.36k | return helper_expr_range(getPrivates().begin(), getPrivates().end()); |
3794 | 1.36k | } |
3795 | | |
3796 | 8 | helper_expr_const_range lhs_exprs() const { |
3797 | 8 | return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end()); |
3798 | 8 | } |
3799 | | |
3800 | 91 | helper_expr_range lhs_exprs() { |
3801 | 91 | return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end()); |
3802 | 91 | } |
3803 | | |
3804 | 8 | helper_expr_const_range rhs_exprs() const { |
3805 | 8 | return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end()); |
3806 | 8 | } |
3807 | | |
3808 | 91 | helper_expr_range rhs_exprs() { |
3809 | 91 | return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end()); |
3810 | 91 | } |
3811 | | |
3812 | 54 | helper_expr_const_range reduction_ops() const { |
3813 | 54 | return helper_expr_const_range(getReductionOps().begin(), |
3814 | 54 | getReductionOps().end()); |
3815 | 54 | } |
3816 | | |
3817 | 1.67k | helper_expr_range reduction_ops() { |
3818 | 1.67k | return helper_expr_range(getReductionOps().begin(), |
3819 | 1.67k | getReductionOps().end()); |
3820 | 1.67k | } |
3821 | | |
3822 | 50 | helper_expr_const_range taskgroup_descriptors() const { |
3823 | 50 | return helper_expr_const_range(getTaskgroupDescriptors().begin(), |
3824 | 50 | getTaskgroupDescriptors().end()); |
3825 | 50 | } |
3826 | | |
3827 | 2.43k | helper_expr_range taskgroup_descriptors() { |
3828 | 2.43k | return helper_expr_range(getTaskgroupDescriptors().begin(), |
3829 | 2.43k | getTaskgroupDescriptors().end()); |
3830 | 2.43k | } |
3831 | | |
3832 | 3.21k | child_range children() { |
3833 | 3.21k | return child_range(reinterpret_cast<Stmt **>(varlist_begin()), |
3834 | 3.21k | reinterpret_cast<Stmt **>(varlist_end())); |
3835 | 3.21k | } |
3836 | | |
3837 | 0 | const_child_range children() const { |
3838 | 0 | auto Children = const_cast<OMPInReductionClause *>(this)->children(); |
3839 | 0 | return const_child_range(Children.begin(), Children.end()); |
3840 | 0 | } |
3841 | | |
3842 | 532 | child_range used_children() { |
3843 | 532 | return child_range(child_iterator(), child_iterator()); |
3844 | 532 | } |
3845 | 0 | const_child_range used_children() const { |
3846 | 0 | return const_child_range(const_child_iterator(), const_child_iterator()); |
3847 | 0 | } |
3848 | | |
3849 | 134k | static bool classof(const OMPClause *T) { |
3850 | 134k | return T->getClauseKind() == llvm::omp::OMPC_in_reduction; |
3851 | 134k | } |
3852 | | }; |
3853 | | |
3854 | | /// This represents clause 'linear' in the '#pragma omp ...' |
3855 | | /// directives. |
3856 | | /// |
3857 | | /// \code |
3858 | | /// #pragma omp simd linear(a,b : 2) |
3859 | | /// \endcode |
3860 | | /// In this example directive '#pragma omp simd' has clause 'linear' |
3861 | | /// with variables 'a', 'b' and linear step '2'. |
3862 | | class OMPLinearClause final |
3863 | | : public OMPVarListClause<OMPLinearClause>, |
3864 | | public OMPClauseWithPostUpdate, |
3865 | | private llvm::TrailingObjects<OMPLinearClause, Expr *> { |
3866 | | friend class OMPClauseReader; |
3867 | | friend OMPVarListClause; |
3868 | | friend TrailingObjects; |
3869 | | |
3870 | | /// Modifier of 'linear' clause. |
3871 | | OpenMPLinearClauseKind Modifier = OMPC_LINEAR_val; |
3872 | | |
3873 | | /// Location of linear modifier if any. |
3874 | | SourceLocation ModifierLoc; |
3875 | | |
3876 | | /// Location of ':'. |
3877 | | SourceLocation ColonLoc; |
3878 | | |
3879 | | /// Sets the linear step for clause. |
3880 | 3.23k | void setStep(Expr *Step) { *(getFinals().end()) = Step; } |
3881 | | |
3882 | | /// Sets the expression to calculate linear step for clause. |
3883 | 3.23k | void setCalcStep(Expr *CalcStep) { *(getFinals().end() + 1) = CalcStep; } |
3884 | | |
3885 | | /// Build 'linear' clause with given number of variables \a NumVars. |
3886 | | /// |
3887 | | /// \param StartLoc Starting location of the clause. |
3888 | | /// \param LParenLoc Location of '('. |
3889 | | /// \param ColonLoc Location of ':'. |
3890 | | /// \param EndLoc Ending location of the clause. |
3891 | | /// \param NumVars Number of variables. |
3892 | | OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc, |
3893 | | OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, |
3894 | | SourceLocation ColonLoc, SourceLocation EndLoc, |
3895 | | unsigned NumVars) |
3896 | | : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear, StartLoc, |
3897 | | LParenLoc, EndLoc, NumVars), |
3898 | | OMPClauseWithPostUpdate(this), Modifier(Modifier), |
3899 | 2.85k | ModifierLoc(ModifierLoc), ColonLoc(ColonLoc) {} |
3900 | | |
3901 | | /// Build an empty clause. |
3902 | | /// |
3903 | | /// \param NumVars Number of variables. |
3904 | | explicit OMPLinearClause(unsigned NumVars) |
3905 | | : OMPVarListClause<OMPLinearClause>(llvm::omp::OMPC_linear, |
3906 | | SourceLocation(), SourceLocation(), |
3907 | | SourceLocation(), NumVars), |
3908 | 386 | OMPClauseWithPostUpdate(this) {} |
3909 | | |
3910 | | /// Gets the list of initial values for linear variables. |
3911 | | /// |
3912 | | /// There are NumVars expressions with initial values allocated after the |
3913 | | /// varlist, they are followed by NumVars update expressions (used to update |
3914 | | /// the linear variable's value on current iteration) and they are followed by |
3915 | | /// NumVars final expressions (used to calculate the linear variable's |
3916 | | /// value after the loop body). After these lists, there are 2 helper |
3917 | | /// expressions - linear step and a helper to calculate it before the |
3918 | | /// loop body (used when the linear step is not constant): |
3919 | | /// |
3920 | | /// { Vars[] /* in OMPVarListClause */; Privates[]; Inits[]; Updates[]; |
3921 | | /// Finals[]; Step; CalcStep; } |
3922 | 63.8k | MutableArrayRef<Expr *> getPrivates() { |
3923 | 63.8k | return MutableArrayRef<Expr *>(varlist_end(), varlist_size()); |
3924 | 63.8k | } |
3925 | 7.38k | ArrayRef<const Expr *> getPrivates() const { |
3926 | 7.38k | return llvm::makeArrayRef(varlist_end(), varlist_size()); |
3927 | 7.38k | } |
3928 | | |
3929 | 51.5k | MutableArrayRef<Expr *> getInits() { |
3930 | 51.5k | return MutableArrayRef<Expr *>(getPrivates().end(), varlist_size()); |
3931 | 51.5k | } |
3932 | 5.82k | ArrayRef<const Expr *> getInits() const { |
3933 | 5.82k | return llvm::makeArrayRef(getPrivates().end(), varlist_size()); |
3934 | 5.82k | } |
3935 | | |
3936 | | /// Sets the list of update expressions for linear variables. |
3937 | 38.2k | MutableArrayRef<Expr *> getUpdates() { |
3938 | 38.2k | return MutableArrayRef<Expr *>(getInits().end(), varlist_size()); |
3939 | 38.2k | } |
3940 | 4.26k | ArrayRef<const Expr *> getUpdates() const { |
3941 | 4.26k | return llvm::makeArrayRef(getInits().end(), varlist_size()); |
3942 | 4.26k | } |
3943 | | |
3944 | | /// Sets the list of final update expressions for linear variables. |
3945 | 29.1k | MutableArrayRef<Expr *> getFinals() { |
3946 | 29.1k | return MutableArrayRef<Expr *>(getUpdates().end(), varlist_size()); |
3947 | 29.1k | } |
3948 | 2.89k | ArrayRef<const Expr *> getFinals() const { |
3949 | 2.89k | return llvm::makeArrayRef(getUpdates().end(), varlist_size()); |
3950 | 2.89k | } |
3951 | | |
3952 | | /// Gets the list of used expressions for linear variables. |
3953 | 10.8k | MutableArrayRef<Expr *> getUsedExprs() { |
3954 | 10.8k | return MutableArrayRef<Expr *>(getFinals().end() + 2, varlist_size() + 1); |
3955 | 10.8k | } |
3956 | 0 | ArrayRef<const Expr *> getUsedExprs() const { |
3957 | 0 | return llvm::makeArrayRef(getFinals().end() + 2, varlist_size() + 1); |
3958 | 0 | } |
3959 | | |
3960 | | /// Sets the list of the copies of original linear variables. |
3961 | | /// \param PL List of expressions. |
3962 | | void setPrivates(ArrayRef<Expr *> PL); |
3963 | | |
3964 | | /// Sets the list of the initial values for linear variables. |
3965 | | /// \param IL List of expressions. |
3966 | | void setInits(ArrayRef<Expr *> IL); |
3967 | | |
3968 | | public: |
3969 | | /// Creates clause with a list of variables \a VL and a linear step |
3970 | | /// \a Step. |
3971 | | /// |
3972 | | /// \param C AST Context. |
3973 | | /// \param StartLoc Starting location of the clause. |
3974 | | /// \param LParenLoc Location of '('. |
3975 | | /// \param Modifier Modifier of 'linear' clause. |
3976 | | /// \param ModifierLoc Modifier location. |
3977 | | /// \param ColonLoc Location of ':'. |
3978 | | /// \param EndLoc Ending location of the clause. |
3979 | | /// \param VL List of references to the variables. |
3980 | | /// \param PL List of private copies of original variables. |
3981 | | /// \param IL List of initial values for the variables. |
3982 | | /// \param Step Linear step. |
3983 | | /// \param CalcStep Calculation of the linear step. |
3984 | | /// \param PreInit Statement that must be executed before entering the OpenMP |
3985 | | /// region with this clause. |
3986 | | /// \param PostUpdate Expression that must be executed after exit from the |
3987 | | /// OpenMP region with this clause. |
3988 | | static OMPLinearClause * |
3989 | | Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, |
3990 | | OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, |
3991 | | SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL, |
3992 | | ArrayRef<Expr *> PL, ArrayRef<Expr *> IL, Expr *Step, Expr *CalcStep, |
3993 | | Stmt *PreInit, Expr *PostUpdate); |
3994 | | |
3995 | | /// Creates an empty clause with the place for \a NumVars variables. |
3996 | | /// |
3997 | | /// \param C AST context. |
3998 | | /// \param NumVars Number of variables. |
3999 | | static OMPLinearClause *CreateEmpty(const ASTContext &C, unsigned NumVars); |
4000 | | |
4001 | | /// Set modifier. |
4002 | 386 | void setModifier(OpenMPLinearClauseKind Kind) { Modifier = Kind; } |
4003 | | |
4004 | | /// Return modifier. |
4005 | 3.18k | OpenMPLinearClauseKind getModifier() const { return Modifier; } |
4006 | | |
4007 | | /// Set modifier location. |
4008 | 386 | void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; } |
4009 | | |
4010 | | /// Return modifier location. |
4011 | 1.91k | SourceLocation getModifierLoc() const { return ModifierLoc; } |
4012 | | |
4013 | | /// Sets the location of ':'. |
4014 | 386 | void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; } |
4015 | | |
4016 | | /// Returns the location of ':'. |
4017 | 992 | SourceLocation getColonLoc() const { return ColonLoc; } |
4018 | | |
4019 | | /// Returns linear step. |
4020 | 5.95k | Expr *getStep() { return *(getFinals().end()); } |
4021 | | |
4022 | | /// Returns linear step. |
4023 | 486 | const Expr *getStep() const { return *(getFinals().end()); } |
4024 | | |
4025 | | /// Returns expression to calculate linear step. |
4026 | 2.55k | Expr *getCalcStep() { return *(getFinals().end() + 1); } |
4027 | | |
4028 | | /// Returns expression to calculate linear step. |
4029 | 848 | const Expr *getCalcStep() const { return *(getFinals().end() + 1); } |
4030 | | |
4031 | | /// Sets the list of update expressions for linear variables. |
4032 | | /// \param UL List of expressions. |
4033 | | void setUpdates(ArrayRef<Expr *> UL); |
4034 | | |
4035 |