clang  9.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"
39 };
40 
41 /// OpenMP attributes for 'default' clause.
43 #define OPENMP_DEFAULT_KIND(Name) \
44  OMPC_DEFAULT_##Name,
45 #include "clang/Basic/OpenMPKinds.def"
47 };
48 
49 /// OpenMP attributes for 'proc_bind' clause.
51 #define OPENMP_PROC_BIND_KIND(Name) \
52  OMPC_PROC_BIND_##Name,
53 #include "clang/Basic/OpenMPKinds.def"
55 };
56 
57 /// OpenMP attributes for 'schedule' clause.
59 #define OPENMP_SCHEDULE_KIND(Name) \
60  OMPC_SCHEDULE_##Name,
61 #include "clang/Basic/OpenMPKinds.def"
63 };
64 
65 /// OpenMP modifiers for 'schedule' clause.
68 #define OPENMP_SCHEDULE_MODIFIER(Name) \
69  OMPC_SCHEDULE_MODIFIER_##Name,
70 #include "clang/Basic/OpenMPKinds.def"
72 };
73 
74 /// OpenMP attributes for 'depend' clause.
76 #define OPENMP_DEPEND_KIND(Name) \
77  OMPC_DEPEND_##Name,
78 #include "clang/Basic/OpenMPKinds.def"
80 };
81 
82 /// OpenMP attributes for 'linear' clause.
84 #define OPENMP_LINEAR_KIND(Name) \
85  OMPC_LINEAR_##Name,
86 #include "clang/Basic/OpenMPKinds.def"
88 };
89 
90 /// OpenMP mapping kind for 'map' clause.
92 #define OPENMP_MAP_KIND(Name) \
93  OMPC_MAP_##Name,
94 #include "clang/Basic/OpenMPKinds.def"
96 };
97 
98 /// OpenMP modifier kind for 'map' clause.
101 #define OPENMP_MAP_MODIFIER_KIND(Name) \
102  OMPC_MAP_MODIFIER_##Name,
103 #include "clang/Basic/OpenMPKinds.def"
105 };
106 
107 /// OpenMP attributes for 'dist_schedule' clause.
109 #define OPENMP_DIST_SCHEDULE_KIND(Name) OMPC_DIST_SCHEDULE_##Name,
110 #include "clang/Basic/OpenMPKinds.def"
112 };
113 
114 /// OpenMP attributes for 'defaultmap' clause.
116 #define OPENMP_DEFAULTMAP_KIND(Name) \
117  OMPC_DEFAULTMAP_##Name,
118 #include "clang/Basic/OpenMPKinds.def"
120 };
121 
122 /// OpenMP modifiers for 'defaultmap' clause.
125 #define OPENMP_DEFAULTMAP_MODIFIER(Name) \
126  OMPC_DEFAULTMAP_MODIFIER_##Name,
127 #include "clang/Basic/OpenMPKinds.def"
129 };
130 
131 /// OpenMP attributes for 'atomic_default_mem_order' clause.
133 #define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \
134  OMPC_ATOMIC_DEFAULT_MEM_ORDER_##Name,
135 #include "clang/Basic/OpenMPKinds.def"
137 };
138 
139 /// Scheduling data for loop-based OpenMP directives.
140 struct OpenMPScheduleTy final {
144 };
145 
146 OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str);
148 
149 OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str);
151 
152 unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str);
154 
156  OpenMPClauseKind CKind);
157 
158 /// Checks if the specified directive is a directive with an associated
159 /// loop construct.
160 /// \param DKind Specified directive.
161 /// \return true - the directive is a loop-associated directive like 'omp simd'
162 /// or 'omp for' directive, otherwise - false.
164 
165 /// Checks if the specified directive is a worksharing directive.
166 /// \param DKind Specified directive.
167 /// \return true - the directive is a worksharing directive like 'omp for',
168 /// otherwise - false.
170 
171 /// Checks if the specified directive is a taskloop directive.
172 /// \param DKind Specified directive.
173 /// \return true - the directive is a worksharing directive like 'omp taskloop',
174 /// otherwise - false.
176 
177 /// Checks if the specified directive is a parallel-kind directive.
178 /// \param DKind Specified directive.
179 /// \return true - the directive is a parallel-like directive like 'omp
180 /// parallel', otherwise - false.
182 
183 /// Checks if the specified directive is a target code offload directive.
184 /// \param DKind Specified directive.
185 /// \return true - the directive is a target code offload directive like
186 /// 'omp target', 'omp target parallel', 'omp target xxx'
187 /// otherwise - false.
189 
190 /// Checks if the specified directive is a target data offload directive.
191 /// \param DKind Specified directive.
192 /// \return true - the directive is a target data offload directive like
193 /// 'omp target data', 'omp target update', 'omp target enter data',
194 /// 'omp target exit data'
195 /// otherwise - false.
197 
198 /// Checks if the specified composite/combined directive constitutes a teams
199 /// directive in the outermost nest. For example
200 /// 'omp teams distribute' or 'omp teams distribute parallel for'.
201 /// \param DKind Specified directive.
202 /// \return true - the directive has teams on the outermost nest, otherwise -
203 /// false.
205 
206 /// Checks if the specified directive is a teams-kind directive. For example,
207 /// 'omp teams distribute' or 'omp target teams'.
208 /// \param DKind Specified directive.
209 /// \return true - the directive is a teams-like directive, otherwise - false.
211 
212 /// Checks if the specified directive is a simd directive.
213 /// \param DKind Specified directive.
214 /// \return true - the directive is a simd directive like 'omp simd',
215 /// otherwise - false.
217 
218 /// Checks if the specified directive is a distribute directive.
219 /// \param DKind Specified directive.
220 /// \return true - the directive is a distribute-directive like 'omp
221 /// distribute',
222 /// otherwise - false.
224 
225 /// Checks if the specified composite/combined directive constitutes a
226 /// distribute directive in the outermost nest. For example,
227 /// 'omp distribute parallel for' or 'omp distribute'.
228 /// \param DKind Specified directive.
229 /// \return true - the directive has distribute on the outermost nest.
230 /// otherwise - false.
232 
233 /// Checks if the specified clause is one of private clauses like
234 /// 'private', 'firstprivate', 'reduction' etc..
235 /// \param Kind Clause kind.
236 /// \return true - the clause is a private clause, otherwise - false.
238 
239 /// Checks if the specified clause is one of threadprivate clauses like
240 /// 'threadprivate', 'copyin' or 'copyprivate'.
241 /// \param Kind Clause kind.
242 /// \return true - the clause is a threadprivate clause, otherwise - false.
244 
245 /// Checks if the specified directive kind is one of tasking directives - task,
246 /// taskloop or taksloop simd.
248 
249 /// Checks if the specified directive kind is one of the composite or combined
250 /// directives that need loop bound sharing across loops outlined in nested
251 /// functions
253 
254 /// Return the captured regions of an OpenMP directive.
257  OpenMPDirectiveKind DKind);
258 }
259 
260 #endif
261 
Scheduling data for loop-based OpenMP directives.
Definition: OpenMPKinds.h:140
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
Definition: OpenMPKinds.h:115
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:1403
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind, OpenMPClauseKind CKind)
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
Definition: OpenMPKinds.h:123
OpenMPMapModifierKind
OpenMP modifier kind for 'map' clause.
Definition: OpenMPKinds.h:99
const char * getOpenMPClauseName(OpenMPClauseKind Kind)
Definition: OpenMPKinds.cpp:61
bool isOpenMPTaskingDirective(OpenMPDirectiveKind Kind)
Checks if the specified directive kind is one of tasking directives - task, taskloop or taksloop simd...
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
Definition: OpenMPKinds.h:83
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
Definition: OpenMPKinds.h:108
OpenMPScheduleClauseKind Schedule
Definition: OpenMPKinds.h:141
bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a teams-kind directive.
OpenMPScheduleClauseModifier M2
Definition: OpenMPKinds.h:143
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
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
Definition: OpenMPKinds.h:50
Kind
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Definition: OpenMPKinds.h:75
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:66
Dataflow Directional Tag Classes.
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
Definition: OpenMPKinds.h:132
OpenMPScheduleClauseModifier M1
Definition: OpenMPKinds.h:142
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'.
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:58
OpenMPDefaultClauseKind
OpenMP attributes for &#39;default&#39; clause.
Definition: OpenMPKinds.h:42
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:91
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...