clang 8.0.0

OpenMPKinds.h
Go to the documentation of this file.
1 //===--- OpenMPKinds.h - OpenMP enums ---------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// Defines some OpenMP-specific enums and functions.
12 ///
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CLANG_BASIC_OPENMPKINDS_H
16 #define LLVM_CLANG_BASIC_OPENMPKINDS_H
17
18 #include "llvm/ADT/StringRef.h"
19
20 namespace clang {
21
22 /// OpenMP directives.
23 enum OpenMPDirectiveKind {
24 #define OPENMP_DIRECTIVE(Name) \
25 OMPD_##Name,
26 #define OPENMP_DIRECTIVE_EXT(Name, Str) \
27 OMPD_##Name,
28 #include "clang/Basic/OpenMPKinds.def"
29 OMPD_unknown
30 };
31
32 /// OpenMP clauses.
33 enum OpenMPClauseKind {
34 #define OPENMP_CLAUSE(Name, Class) \
35 OMPC_##Name,
36 #include "clang/Basic/OpenMPKinds.def"
37 OMPC_threadprivate,
38 OMPC_uniform,
39 OMPC_unknown
40 };
41
42 /// OpenMP attributes for 'default' clause.
43 enum OpenMPDefaultClauseKind {
44 #define OPENMP_DEFAULT_KIND(Name) \
45 OMPC_DEFAULT_##Name,
46 #include "clang/Basic/OpenMPKinds.def"
47 OMPC_DEFAULT_unknown
48 };
49
50 /// OpenMP attributes for 'proc_bind' clause.
51 enum OpenMPProcBindClauseKind {
52 #define OPENMP_PROC_BIND_KIND(Name) \
53 OMPC_PROC_BIND_##Name,
54 #include "clang/Basic/OpenMPKinds.def"
55 OMPC_PROC_BIND_unknown
56 };
57
58 /// OpenMP attributes for 'schedule' clause.
59 enum OpenMPScheduleClauseKind {
60 #define OPENMP_SCHEDULE_KIND(Name) \
61 OMPC_SCHEDULE_##Name,
62 #include "clang/Basic/OpenMPKinds.def"
63 OMPC_SCHEDULE_unknown
64 };
65
66 /// OpenMP modifiers for 'schedule' clause.
67 enum OpenMPScheduleClauseModifier {
68 OMPC_SCHEDULE_MODIFIER_unknown = OMPC_SCHEDULE_unknown,
69 #define OPENMP_SCHEDULE_MODIFIER(Name) \
70 OMPC_SCHEDULE_MODIFIER_##Name,
71 #include "clang/Basic/OpenMPKinds.def"
72 OMPC_SCHEDULE_MODIFIER_last
73 };
74
75 /// OpenMP attributes for 'depend' clause.
76 enum OpenMPDependClauseKind {
77 #define OPENMP_DEPEND_KIND(Name) \
78 OMPC_DEPEND_##Name,
79 #include "clang/Basic/OpenMPKinds.def"
80 OMPC_DEPEND_unknown
81 };
82
83 /// OpenMP attributes for 'linear' clause.
84 enum OpenMPLinearClauseKind {
85 #define OPENMP_LINEAR_KIND(Name) \
86 OMPC_LINEAR_##Name,
87 #include "clang/Basic/OpenMPKinds.def"
88 OMPC_LINEAR_unknown
89 };
90
91 /// OpenMP mapping kind for 'map' clause.
92 enum OpenMPMapClauseKind {
93 #define OPENMP_MAP_KIND(Name) \
94 OMPC_MAP_##Name,
95 #include "clang/Basic/OpenMPKinds.def"
96 OMPC_MAP_unknown
97 };
98
99 /// OpenMP modifier kind for 'map' clause.
100 enum OpenMPMapModifierKind {
101 OMPC_MAP_MODIFIER_unknown = OMPC_MAP_unknown,
102 #define OPENMP_MAP_MODIFIER_KIND(Name) \
103 OMPC_MAP_MODIFIER_##Name,
104 #include "clang/Basic/OpenMPKinds.def"
105 OMPC_MAP_MODIFIER_last
106 };
107
108 /// OpenMP attributes for 'dist_schedule' clause.
109 enum OpenMPDistScheduleClauseKind {
110 #define OPENMP_DIST_SCHEDULE_KIND(Name) OMPC_DIST_SCHEDULE_##Name,
111 #include "clang/Basic/OpenMPKinds.def"
112 OMPC_DIST_SCHEDULE_unknown
113 };
114
115 /// OpenMP attributes for 'defaultmap' clause.
116 enum OpenMPDefaultmapClauseKind {
117 #define OPENMP_DEFAULTMAP_KIND(Name) \
118 OMPC_DEFAULTMAP_##Name,
119 #include "clang/Basic/OpenMPKinds.def"
120 OMPC_DEFAULTMAP_unknown
121 };
122
123 /// OpenMP modifiers for 'defaultmap' clause.
124 enum OpenMPDefaultmapClauseModifier {
125 OMPC_DEFAULTMAP_MODIFIER_unknown = OMPC_DEFAULTMAP_unknown,
126 #define OPENMP_DEFAULTMAP_MODIFIER(Name) \
127 OMPC_DEFAULTMAP_MODIFIER_##Name,
128 #include "clang/Basic/OpenMPKinds.def"
129 OMPC_DEFAULTMAP_MODIFIER_last
130 };
131
132 /// OpenMP attributes for 'atomic_default_mem_order' clause.
133 enum OpenMPAtomicDefaultMemOrderClauseKind {
134 #define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \
135 OMPC_ATOMIC_DEFAULT_MEM_ORDER_##Name,
136 #include "clang/Basic/OpenMPKinds.def"
137 OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown
138 };
139
140 /// Scheduling data for loop-based OpenMP directives.
141 struct OpenMPScheduleTy final {
142 OpenMPScheduleClauseKind Schedule = OMPC_SCHEDULE_unknown;
143 OpenMPScheduleClauseModifier M1 = OMPC_SCHEDULE_MODIFIER_unknown;
144 OpenMPScheduleClauseModifier M2 = OMPC_SCHEDULE_MODIFIER_unknown;
145 };
146
147 OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str);
148 const char *getOpenMPDirectiveName(OpenMPDirectiveKind Kind);
149
150 OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str);
151 const char *getOpenMPClauseName(OpenMPClauseKind Kind);
152
153 unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str);
154 const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type);
155
156 bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind,
157 OpenMPClauseKind CKind);
158
159 /// Checks if the specified directive is a directive with an associated
160 /// loop construct.
161 /// \param DKind Specified directive.
162 /// \return true - the directive is a loop-associated directive like 'omp simd'
163 /// or 'omp for' directive, otherwise - false.
164 bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind);
165
166 /// Checks if the specified directive is a worksharing directive.
167 /// \param DKind Specified directive.
168 /// \return true - the directive is a worksharing directive like 'omp for',
169 /// otherwise - false.
170 bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind);
171
172 /// Checks if the specified directive is a taskloop directive.
173 /// \param DKind Specified directive.
174 /// \return true - the directive is a worksharing directive like 'omp taskloop',
175 /// otherwise - false.
176 bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind);
177
178 /// Checks if the specified directive is a parallel-kind directive.
179 /// \param DKind Specified directive.
180 /// \return true - the directive is a parallel-like directive like 'omp
181 /// parallel', otherwise - false.
182 bool isOpenMPParallelDirective(OpenMPDirectiveKind DKind);
183
184 /// Checks if the specified directive is a target code offload directive.
185 /// \param DKind Specified directive.
186 /// \return true - the directive is a target code offload directive like
187 /// 'omp target', 'omp target parallel', 'omp target xxx'
188 /// otherwise - false.
189 bool isOpenMPTargetExecutionDirective(OpenMPDirectiveKind DKind);
190
191 /// Checks if the specified directive is a target data offload directive.
192 /// \param DKind Specified directive.
193 /// \return true - the directive is a target data offload directive like
194 /// 'omp target data', 'omp target update', 'omp target enter data',
195 /// 'omp target exit data'
196 /// otherwise - false.
197 bool isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind);
198
199 /// Checks if the specified composite/combined directive constitutes a teams
200 /// directive in the outermost nest. For example
201 /// 'omp teams distribute' or 'omp teams distribute parallel for'.
202 /// \param DKind Specified directive.
203 /// \return true - the directive has teams on the outermost nest, otherwise -
204 /// false.
205 bool isOpenMPNestingTeamsDirective(OpenMPDirectiveKind DKind);
206
207 /// Checks if the specified directive is a teams-kind directive. For example,
208 /// 'omp teams distribute' or 'omp target teams'.
209 /// \param DKind Specified directive.
210 /// \return true - the directive is a teams-like directive, otherwise - false.
211 bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind);
212
213 /// Checks if the specified directive is a simd directive.
214 /// \param DKind Specified directive.
215 /// \return true - the directive is a simd directive like 'omp simd',
216 /// otherwise - false.
217 bool isOpenMPSimdDirective(OpenMPDirectiveKind DKind);
218
219 /// Checks if the specified directive is a distribute directive.
220 /// \param DKind Specified directive.
221 /// \return true - the directive is a distribute-directive like 'omp
222 /// distribute',
223 /// otherwise - false.
224 bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind);
225
226 /// Checks if the specified composite/combined directive constitutes a
227 /// distribute directive in the outermost nest. For example,
228 /// 'omp distribute parallel for' or 'omp distribute'.
229 /// \param DKind Specified directive.
230 /// \return true - the directive has distribute on the outermost nest.
231 /// otherwise - false.
232 bool isOpenMPNestingDistributeDirective(OpenMPDirectiveKind DKind);
233
234 /// Checks if the specified clause is one of private clauses like
235 /// 'private', 'firstprivate', 'reduction' etc..
236 /// \param Kind Clause kind.
237 /// \return true - the clause is a private clause, otherwise - false.
238 bool isOpenMPPrivate(OpenMPClauseKind Kind);
239
240 /// Checks if the specified clause is one of threadprivate clauses like
241 /// 'threadprivate', 'copyin' or 'copyprivate'.
242 /// \param Kind Clause kind.
243 /// \return true - the clause is a threadprivate clause, otherwise - false.
244 bool isOpenMPThreadPrivate(OpenMPClauseKind Kind);
245
246 /// Checks if the specified directive kind is one of tasking directives - task,
247 /// taskloop or taksloop simd.
248 bool isOpenMPTaskingDirective(OpenMPDirectiveKind Kind);
249
250 /// Checks if the specified directive kind is one of the composite or combined
251 /// directives that need loop bound sharing across loops outlined in nested
252 /// functions
253 bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind);
254
255 /// Return the captured regions of an OpenMP directive.
256 void getOpenMPCaptureRegions(
257 llvm::SmallVectorImpl<OpenMPDirectiveKind> &CaptureRegions,
258 OpenMPDirectiveKind DKind);
259 }
260
261 #endif
262
clang::OMPD_unknown
Definition: OpenMPKinds.h:29
clang::OpenMPScheduleTy
Scheduling data for loop-based OpenMP directives.
Definition: OpenMPKinds.h:141
clang::OpenMPDefaultmapClauseKind
OpenMPDefaultmapClauseKind
OpenMP attributes for &#39;defaultmap&#39; clause.
Definition: OpenMPKinds.h:116
clang::isOpenMPNestingDistributeDirective
bool isOpenMPNestingDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified composite/combined directive constitutes a distribute directive in the outerm...
Definition: OpenMPKinds.cpp:877
clang::isOpenMPTargetDataManagementDirective
bool isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a target data offload directive.
Definition: OpenMPKinds.cpp:845
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1407
clang::OMPC_DIST_SCHEDULE_unknown
Definition: OpenMPKinds.h:112
clang::getOpenMPSimpleClauseTypeName
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
Definition: OpenMPKinds.cpp:189
clang::isAllowedClauseForDirective
bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind, OpenMPClauseKind CKind)
Definition: OpenMPKinds.cpp:348
clang::OpenMPDefaultmapClauseModifier
OpenMPDefaultmapClauseModifier
OpenMP modifiers for &#39;defaultmap&#39; clause.
Definition: OpenMPKinds.h:124
clang::OMPC_DEFAULTMAP_unknown
Definition: OpenMPKinds.h:120
clang::OpenMPMapModifierKind
OpenMPMapModifierKind
OpenMP modifier kind for &#39;map&#39; clause.
Definition: OpenMPKinds.h:100
clang::OMPC_DEPEND_unknown
Definition: OpenMPKinds.h:80
clang::getOpenMPClauseName
const char * getOpenMPClauseName(OpenMPClauseKind Kind)
Definition: OpenMPKinds.cpp:62
clang::OMPC_DEFAULT_unknown
Definition: OpenMPKinds.h:47
clang::isOpenMPTaskingDirective
bool isOpenMPTaskingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of tasking directives - task, taskloop or taksloop simd...
Definition: OpenMPKinds.cpp:906
clang::OpenMPLinearClauseKind
OpenMPLinearClauseKind
OpenMP attributes for &#39;linear&#39; clause.
Definition: OpenMPKinds.h:84
clang::OMPC_MAP_MODIFIER_last
Definition: OpenMPKinds.h:105
clang::OMPC_DEFAULTMAP_MODIFIER_unknown
Definition: OpenMPKinds.h:125
llvm::SmallVectorImpl
Definition: LLVM.h:37
clang::OpenMPDistScheduleClauseKind
OpenMPDistScheduleClauseKind
OpenMP attributes for &#39;dist_schedule&#39; clause.
Definition: OpenMPKinds.h:109
clang::OMPC_uniform
Definition: OpenMPKinds.h:38
clang::OpenMPScheduleTy::Schedule
OpenMPScheduleClauseKind Schedule
Definition: OpenMPKinds.h:142
clang::isOpenMPTeamsDirective
bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a teams-kind directive.
Definition: OpenMPKinds.cpp:857
clang::OpenMPScheduleTy::M2
OpenMPScheduleClauseModifier M2
Definition: OpenMPKinds.h:144
clang::getOpenMPClauseKind
OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str)
clang::isOpenMPTargetExecutionDirective
bool isOpenMPTargetExecutionDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a target code offload directive.
Definition: OpenMPKinds.cpp:835
clang::isOpenMPWorksharingDirective
bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a worksharing directive.
Definition: OpenMPKinds.cpp:803
clang::isOpenMPPrivate
bool isOpenMPPrivate(OpenMPClauseKind Kind)
Checks if the specified clause is one of private clauses like &#39;private&#39;, &#39;firstprivate&#39;, &#39;reduction&#39; etc.
Definition: OpenMPKinds.cpp:895
clang::OMPC_MAP_MODIFIER_unknown
Definition: OpenMPKinds.h:101
clang::OMPC_SCHEDULE_MODIFIER_unknown
Definition: OpenMPKinds.h:68
clang::isOpenMPParallelDirective
bool isOpenMPParallelDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a parallel-kind directive.
Definition: OpenMPKinds.cpp:822
clang::OMPC_threadprivate
Definition: OpenMPKinds.h:37
clang::OMPC_SCHEDULE_MODIFIER_last
Definition: OpenMPKinds.h:72
clang::OpenMPClauseKind
OpenMPClauseKind
OpenMP clauses.
Definition: OpenMPKinds.h:33
clang::isOpenMPTaskLoopDirective
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
Definition: OpenMPKinds.cpp:818
clang::OpenMPProcBindClauseKind
OpenMPProcBindClauseKind
OpenMP attributes for &#39;proc_bind&#39; clause.
Definition: OpenMPKinds.h:51
Kind
Kind
Definition: ChrootChecker.cpp:29
clang::OpenMPDependClauseKind
OpenMPDependClauseKind
OpenMP attributes for &#39;depend&#39; clause.
Definition: OpenMPKinds.h:76
clang::OpenMPDirectiveKind
OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:23
clang::OMPC_DEFAULTMAP_MODIFIER_last
Definition: OpenMPKinds.h:129
clang::isOpenMPLoopBoundSharingDirective
bool isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of the composite or combined directives that need loop ...
Definition: OpenMPKinds.cpp:910
clang::OMPC_SCHEDULE_unknown
Definition: OpenMPKinds.h:63
clang::OpenMPScheduleClauseModifier
OpenMPScheduleClauseModifier
OpenMP modifiers for &#39;schedule&#39; clause.
Definition: OpenMPKinds.h:67
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::OpenMPAtomicDefaultMemOrderClauseKind
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for &#39;atomic_default_mem_order&#39; clause.
Definition: OpenMPKinds.h:133
clang::OpenMPScheduleTy::M1
OpenMPScheduleClauseModifier M1
Definition: OpenMPKinds.h:143
clang::isOpenMPSimdDirective
bool isOpenMPSimdDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a simd directive.
Definition: OpenMPKinds.cpp:865
clang::isOpenMPThreadPrivate
bool isOpenMPThreadPrivate(OpenMPClauseKind Kind)
Checks if the specified clause is one of threadprivate clauses like &#39;threadprivate&#39;, &#39;copyin&#39; or &#39;copyprivate&#39;.
Definition: OpenMPKinds.cpp:902
clang::getOpenMPCaptureRegions
void getOpenMPCaptureRegions(llvm::SmallVectorImpl< OpenMPDirectiveKind > &CaptureRegions, OpenMPDirectiveKind DKind)
Return the captured regions of an OpenMP directive.
Definition: OpenMPKinds.cpp:919
clang::getOpenMPSimpleClauseType
unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str)
clang::isOpenMPDistributeDirective
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
Definition: OpenMPKinds.cpp:884
clang::OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown
Definition: OpenMPKinds.h:137
clang::OMPC_LINEAR_unknown
Definition: OpenMPKinds.h:88
clang::OpenMPScheduleClauseKind
OpenMPScheduleClauseKind
OpenMP attributes for &#39;schedule&#39; clause.
Definition: OpenMPKinds.h:59
clang::OpenMPDefaultClauseKind
OpenMPDefaultClauseKind
OpenMP attributes for &#39;default&#39; clause.
Definition: OpenMPKinds.h:43
clang::getOpenMPDirectiveKind
OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str)
clang::getOpenMPDirectiveName
const char * getOpenMPDirectiveName(OpenMPDirectiveKind Kind)
Definition: OpenMPKinds.cpp:31
clang::OpenMPMapClauseKind
OpenMPMapClauseKind
OpenMP mapping kind for &#39;map&#39; clause.
Definition: OpenMPKinds.h:92
clang::OMPC_unknown
Definition: OpenMPKinds.h:39
clang::OMPC_MAP_unknown
Definition: OpenMPKinds.h:96
clang::OMPC_PROC_BIND_unknown
Definition: OpenMPKinds.h:55
clang::isOpenMPLoopDirective
bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a directive with an associated loop construct.
Definition: OpenMPKinds.cpp:784
clang::isOpenMPNestingTeamsDirective
bool isOpenMPNestingTeamsDirective(OpenMPDirectiveKind DKind)
Checks if the specified composite/combined directive constitutes a teams directive in the outermost n...
Definition: OpenMPKinds.cpp:850