clang  10.0.0svn
OpenMPKinds.h
Go to the documentation of this file.
1 //===--- OpenMPKinds.h - OpenMP enums ---------------------------*- 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 /// Defines some OpenMP-specific enums and functions.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_BASIC_OPENMPKINDS_H
15 #define LLVM_CLANG_BASIC_OPENMPKINDS_H
16 
17 #include "llvm/ADT/StringRef.h"
18 
19 namespace clang {
20 
21 /// OpenMP directives.
23 #define OPENMP_DIRECTIVE(Name) \
24  OMPD_##Name,
25 #define OPENMP_DIRECTIVE_EXT(Name, Str) \
26  OMPD_##Name,
27 #include "clang/Basic/OpenMPKinds.def"
29 };
30 
31 /// OpenMP clauses.
33 #define OPENMP_CLAUSE(Name, Class) \
34  OMPC_##Name,
35 #include "clang/Basic/OpenMPKinds.def"
41 };
42 
43 /// OpenMP attributes for 'default' clause.
45 #define OPENMP_DEFAULT_KIND(Name) \
46  OMPC_DEFAULT_##Name,
47 #include "clang/Basic/OpenMPKinds.def"
49 };
50 
51 /// OpenMP attributes for 'proc_bind' clause.
53 #define OPENMP_PROC_BIND_KIND(Name) \
54  OMPC_PROC_BIND_##Name,
55 #include "clang/Basic/OpenMPKinds.def"
57 };
58 
59 /// OpenMP attributes for 'schedule' clause.
61 #define OPENMP_SCHEDULE_KIND(Name) \
62  OMPC_SCHEDULE_##Name,
63 #include "clang/Basic/OpenMPKinds.def"
65 };
66 
67 /// OpenMP modifiers for 'schedule' clause.
70 #define OPENMP_SCHEDULE_MODIFIER(Name) \
71  OMPC_SCHEDULE_MODIFIER_##Name,
72 #include "clang/Basic/OpenMPKinds.def"
74 };
75 
76 /// OpenMP attributes for 'depend' clause.
78 #define OPENMP_DEPEND_KIND(Name) \
79  OMPC_DEPEND_##Name,
80 #include "clang/Basic/OpenMPKinds.def"
82 };
83 
84 /// OpenMP attributes for 'linear' clause.
86 #define OPENMP_LINEAR_KIND(Name) \
87  OMPC_LINEAR_##Name,
88 #include "clang/Basic/OpenMPKinds.def"
90 };
91 
92 /// OpenMP mapping kind for 'map' clause.
94 #define OPENMP_MAP_KIND(Name) \
95  OMPC_MAP_##Name,
96 #include "clang/Basic/OpenMPKinds.def"
98 };
99 
100 /// OpenMP modifier kind for 'map' clause.
103 #define OPENMP_MAP_MODIFIER_KIND(Name) \
104  OMPC_MAP_MODIFIER_##Name,
105 #include "clang/Basic/OpenMPKinds.def"
107 };
108 
109 /// OpenMP modifier kind for 'to' clause.
111 #define OPENMP_TO_MODIFIER_KIND(Name) \
112  OMPC_TO_MODIFIER_##Name,
113 #include "clang/Basic/OpenMPKinds.def"
115 };
116 
117 /// OpenMP modifier kind for 'from' clause.
119 #define OPENMP_FROM_MODIFIER_KIND(Name) \
120  OMPC_FROM_MODIFIER_##Name,
121 #include "clang/Basic/OpenMPKinds.def"
123 };
124 
125 /// OpenMP attributes for 'dist_schedule' clause.
127 #define OPENMP_DIST_SCHEDULE_KIND(Name) OMPC_DIST_SCHEDULE_##Name,
128 #include "clang/Basic/OpenMPKinds.def"
130 };
131 
132 /// OpenMP attributes for 'defaultmap' clause.
134 #define OPENMP_DEFAULTMAP_KIND(Name) \
135  OMPC_DEFAULTMAP_##Name,
136 #include "clang/Basic/OpenMPKinds.def"
138 };
139 
140 /// OpenMP modifiers for 'defaultmap' clause.
143 #define OPENMP_DEFAULTMAP_MODIFIER(Name) \
144  OMPC_DEFAULTMAP_MODIFIER_##Name,
145 #include "clang/Basic/OpenMPKinds.def"
147 };
148 
149 /// OpenMP attributes for 'atomic_default_mem_order' clause.
151 #define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \
152  OMPC_ATOMIC_DEFAULT_MEM_ORDER_##Name,
153 #include "clang/Basic/OpenMPKinds.def"
155 };
156 
157 /// OpenMP device type for 'device_type' clause.
159 #define OPENMP_DEVICE_TYPE_KIND(Name) \
160  OMPC_DEVICE_TYPE_##Name,
161 #include "clang/Basic/OpenMPKinds.def"
163 };
164 
165 /// Scheduling data for loop-based OpenMP directives.
166 struct OpenMPScheduleTy final {
170 };
171 
172 OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str);
174 
175 OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str);
177 
178 unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str);
180 
182  OpenMPClauseKind CKind);
183 
184 /// Checks if the specified directive is a directive with an associated
185 /// loop construct.
186 /// \param DKind Specified directive.
187 /// \return true - the directive is a loop-associated directive like 'omp simd'
188 /// or 'omp for' directive, otherwise - false.
190 
191 /// Checks if the specified directive is a worksharing directive.
192 /// \param DKind Specified directive.
193 /// \return true - the directive is a worksharing directive like 'omp for',
194 /// otherwise - false.
196 
197 /// Checks if the specified directive is a taskloop directive.
198 /// \param DKind Specified directive.
199 /// \return true - the directive is a worksharing directive like 'omp taskloop',
200 /// otherwise - false.
202 
203 /// Checks if the specified directive is a parallel-kind directive.
204 /// \param DKind Specified directive.
205 /// \return true - the directive is a parallel-like directive like 'omp
206 /// parallel', otherwise - false.
208 
209 /// Checks if the specified directive is a target code offload directive.
210 /// \param DKind Specified directive.
211 /// \return true - the directive is a target code offload directive like
212 /// 'omp target', 'omp target parallel', 'omp target xxx'
213 /// otherwise - false.
215 
216 /// Checks if the specified directive is a target data offload directive.
217 /// \param DKind Specified directive.
218 /// \return true - the directive is a target data offload directive like
219 /// 'omp target data', 'omp target update', 'omp target enter data',
220 /// 'omp target exit data'
221 /// otherwise - false.
223 
224 /// Checks if the specified composite/combined directive constitutes a teams
225 /// directive in the outermost nest. For example
226 /// 'omp teams distribute' or 'omp teams distribute parallel for'.
227 /// \param DKind Specified directive.
228 /// \return true - the directive has teams on the outermost nest, otherwise -
229 /// false.
231 
232 /// Checks if the specified directive is a teams-kind directive. For example,
233 /// 'omp teams distribute' or 'omp target teams'.
234 /// \param DKind Specified directive.
235 /// \return true - the directive is a teams-like directive, otherwise - false.
237 
238 /// Checks if the specified directive is a simd directive.
239 /// \param DKind Specified directive.
240 /// \return true - the directive is a simd directive like 'omp simd',
241 /// otherwise - false.
243 
244 /// Checks if the specified directive is a distribute directive.
245 /// \param DKind Specified directive.
246 /// \return true - the directive is a distribute-directive like 'omp
247 /// distribute',
248 /// otherwise - false.
250 
251 /// Checks if the specified composite/combined directive constitutes a
252 /// distribute directive in the outermost nest. For example,
253 /// 'omp distribute parallel for' or 'omp distribute'.
254 /// \param DKind Specified directive.
255 /// \return true - the directive has distribute on the outermost nest.
256 /// otherwise - false.
258 
259 /// Checks if the specified clause is one of private clauses like
260 /// 'private', 'firstprivate', 'reduction' etc..
261 /// \param Kind Clause kind.
262 /// \return true - the clause is a private clause, otherwise - false.
264 
265 /// Checks if the specified clause is one of threadprivate clauses like
266 /// 'threadprivate', 'copyin' or 'copyprivate'.
267 /// \param Kind Clause kind.
268 /// \return true - the clause is a threadprivate clause, otherwise - false.
270 
271 /// Checks if the specified directive kind is one of tasking directives - task,
272 /// taskloop, taksloop simd, master taskloop, parallel master taskloop or master
273 /// taskloop simd.
275 
276 /// Checks if the specified directive kind is one of the composite or combined
277 /// directives that need loop bound sharing across loops outlined in nested
278 /// functions
280 
281 /// Return the captured regions of an OpenMP directive.
284  OpenMPDirectiveKind DKind);
285 }
286 
287 #endif
288 
OpenMPFromModifierKind
OpenMP modifier kind for 'from' clause.
Definition: OpenMPKinds.h:118
Scheduling data for loop-based OpenMP directives.
Definition: OpenMPKinds.h:166
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
Definition: OpenMPKinds.h:133
bool isOpenMPNestingDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified composite/combined directive constitutes a distribute directive in the outerm...
bool isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a target data offload directive.
The base class of the type hierarchy.
Definition: Type.h:1436
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind, OpenMPClauseKind CKind)
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
Definition: OpenMPKinds.h:141
OpenMPMapModifierKind
OpenMP modifier kind for 'map' clause.
Definition: OpenMPKinds.h:101
const char * getOpenMPClauseName(OpenMPClauseKind Kind)
Definition: OpenMPKinds.cpp:63
bool isOpenMPTaskingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of tasking directives - task, taskloop, taksloop simd, master taskloop, parallel master taskloop or master taskloop simd.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
Definition: OpenMPKinds.h:85
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
Definition: OpenMPKinds.h:126
OpenMPScheduleClauseKind Schedule
Definition: OpenMPKinds.h:167
bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a teams-kind directive.
OpenMPScheduleClauseModifier M2
Definition: OpenMPKinds.h:169
OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str)
bool isOpenMPTargetExecutionDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a target code offload directive.
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
bool isOpenMPPrivate(OpenMPClauseKind Kind)
Checks if the specified clause is one of private clauses like 'private', 'firstprivate', 'reduction' etc.
bool isOpenMPParallelDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a parallel-kind directive.
OpenMPClauseKind
OpenMP clauses.
Definition: OpenMPKinds.h:32
OpenMPDeviceType
OpenMP device type for 'device_type' clause.
Definition: OpenMPKinds.h:158
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
Definition: OpenMPKinds.h:52
Kind
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Definition: OpenMPKinds.h:77
OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:22
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
Definition: OpenMPKinds.h:68
Dataflow Directional Tag Classes.
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
Definition: OpenMPKinds.h:150
OpenMPScheduleClauseModifier M1
Definition: OpenMPKinds.h:168
bool isOpenMPSimdDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a simd directive.
bool isOpenMPThreadPrivate(OpenMPClauseKind Kind)
Checks if the specified clause is one of threadprivate clauses like 'threadprivate', 'copyin' or 'copyprivate'.
OpenMPToModifierKind
OpenMP modifier kind for 'to' clause.
Definition: OpenMPKinds.h:110
void getOpenMPCaptureRegions(llvm::SmallVectorImpl< OpenMPDirectiveKind > &CaptureRegions, OpenMPDirectiveKind DKind)
Return the captured regions of an OpenMP directive.
unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str)
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
OpenMPScheduleClauseKind
OpenMP attributes for &#39;schedule&#39; clause.
Definition: OpenMPKinds.h:60
OpenMPDefaultClauseKind
OpenMP attributes for &#39;default&#39; clause.
Definition: OpenMPKinds.h:44
OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str)
const char * getOpenMPDirectiveName(OpenMPDirectiveKind Kind)
Definition: OpenMPKinds.cpp:30
OpenMPMapClauseKind
OpenMP mapping kind for &#39;map&#39; clause.
Definition: OpenMPKinds.h:93
bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a directive with an associated loop construct.
bool isOpenMPNestingTeamsDirective(OpenMPDirectiveKind DKind)
Checks if the specified composite/combined directive constitutes a teams directive in the outermost n...