clang  8.0.0svn
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.
24 #define OPENMP_DIRECTIVE(Name) \
25  OMPD_##Name,
26 #define OPENMP_DIRECTIVE_EXT(Name, Str) \
27  OMPD_##Name,
28 #include "clang/Basic/OpenMPKinds.def"
30 };
31 
32 /// OpenMP clauses.
34 #define OPENMP_CLAUSE(Name, Class) \
35  OMPC_##Name,
36 #include "clang/Basic/OpenMPKinds.def"
40 };
41 
42 /// OpenMP attributes for 'default' clause.
44 #define OPENMP_DEFAULT_KIND(Name) \
45  OMPC_DEFAULT_##Name,
46 #include "clang/Basic/OpenMPKinds.def"
48 };
49 
50 /// OpenMP attributes for 'proc_bind' clause.
52 #define OPENMP_PROC_BIND_KIND(Name) \
53  OMPC_PROC_BIND_##Name,
54 #include "clang/Basic/OpenMPKinds.def"
56 };
57 
58 /// OpenMP attributes for 'schedule' clause.
60 #define OPENMP_SCHEDULE_KIND(Name) \
61  OMPC_SCHEDULE_##Name,
62 #include "clang/Basic/OpenMPKinds.def"
64 };
65 
66 /// OpenMP modifiers for 'schedule' clause.
69 #define OPENMP_SCHEDULE_MODIFIER(Name) \
70  OMPC_SCHEDULE_MODIFIER_##Name,
71 #include "clang/Basic/OpenMPKinds.def"
73 };
74 
75 /// OpenMP attributes for 'depend' clause.
77 #define OPENMP_DEPEND_KIND(Name) \
78  OMPC_DEPEND_##Name,
79 #include "clang/Basic/OpenMPKinds.def"
81 };
82 
83 /// OpenMP attributes for 'linear' clause.
85 #define OPENMP_LINEAR_KIND(Name) \
86  OMPC_LINEAR_##Name,
87 #include "clang/Basic/OpenMPKinds.def"
89 };
90 
91 /// OpenMP mapping kind for 'map' clause.
93 #define OPENMP_MAP_KIND(Name) \
94  OMPC_MAP_##Name,
95 #include "clang/Basic/OpenMPKinds.def"
97 };
98 
99 /// OpenMP attributes for 'dist_schedule' clause.
101 #define OPENMP_DIST_SCHEDULE_KIND(Name) OMPC_DIST_SCHEDULE_##Name,
102 #include "clang/Basic/OpenMPKinds.def"
104 };
105 
106 /// OpenMP attributes for 'defaultmap' clause.
108 #define OPENMP_DEFAULTMAP_KIND(Name) \
109  OMPC_DEFAULTMAP_##Name,
110 #include "clang/Basic/OpenMPKinds.def"
112 };
113 
114 /// OpenMP modifiers for 'defaultmap' clause.
117 #define OPENMP_DEFAULTMAP_MODIFIER(Name) \
118  OMPC_DEFAULTMAP_MODIFIER_##Name,
119 #include "clang/Basic/OpenMPKinds.def"
121 };
122 
123 /// OpenMP attributes for 'atomic_default_mem_order' clause.
125 #define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \
126  OMPC_ATOMIC_DEFAULT_MEM_ORDER_##Name,
127 #include "clang/Basic/OpenMPKinds.def"
129 };
130 
131 /// Scheduling data for loop-based OpenMP directives.
132 struct OpenMPScheduleTy final {
136 };
137 
138 OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str);
140 
141 OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str);
143 
144 unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str);
146 
148  OpenMPClauseKind CKind);
149 
150 /// Checks if the specified directive is a directive with an associated
151 /// loop construct.
152 /// \param DKind Specified directive.
153 /// \return true - the directive is a loop-associated directive like 'omp simd'
154 /// or 'omp for' directive, otherwise - false.
156 
157 /// Checks if the specified directive is a worksharing directive.
158 /// \param DKind Specified directive.
159 /// \return true - the directive is a worksharing directive like 'omp for',
160 /// otherwise - false.
162 
163 /// Checks if the specified directive is a taskloop directive.
164 /// \param DKind Specified directive.
165 /// \return true - the directive is a worksharing directive like 'omp taskloop',
166 /// otherwise - false.
168 
169 /// Checks if the specified directive is a parallel-kind directive.
170 /// \param DKind Specified directive.
171 /// \return true - the directive is a parallel-like directive like 'omp
172 /// parallel', otherwise - false.
174 
175 /// Checks if the specified directive is a target code offload directive.
176 /// \param DKind Specified directive.
177 /// \return true - the directive is a target code offload directive like
178 /// 'omp target', 'omp target parallel', 'omp target xxx'
179 /// otherwise - false.
181 
182 /// Checks if the specified directive is a target data offload directive.
183 /// \param DKind Specified directive.
184 /// \return true - the directive is a target data offload directive like
185 /// 'omp target data', 'omp target update', 'omp target enter data',
186 /// 'omp target exit data'
187 /// otherwise - false.
189 
190 /// Checks if the specified composite/combined directive constitutes a teams
191 /// directive in the outermost nest. For example
192 /// 'omp teams distribute' or 'omp teams distribute parallel for'.
193 /// \param DKind Specified directive.
194 /// \return true - the directive has teams on the outermost nest, otherwise -
195 /// false.
197 
198 /// Checks if the specified directive is a teams-kind directive. For example,
199 /// 'omp teams distribute' or 'omp target teams'.
200 /// \param DKind Specified directive.
201 /// \return true - the directive is a teams-like directive, otherwise - false.
203 
204 /// Checks if the specified directive is a simd directive.
205 /// \param DKind Specified directive.
206 /// \return true - the directive is a simd directive like 'omp simd',
207 /// otherwise - false.
209 
210 /// Checks if the specified directive is a distribute directive.
211 /// \param DKind Specified directive.
212 /// \return true - the directive is a distribute-directive like 'omp
213 /// distribute',
214 /// otherwise - false.
216 
217 /// Checks if the specified composite/combined directive constitutes a
218 /// distribute directive in the outermost nest. For example,
219 /// 'omp distribute parallel for' or 'omp distribute'.
220 /// \param DKind Specified directive.
221 /// \return true - the directive has distribute on the outermost nest.
222 /// otherwise - false.
224 
225 /// Checks if the specified clause is one of private clauses like
226 /// 'private', 'firstprivate', 'reduction' etc..
227 /// \param Kind Clause kind.
228 /// \return true - the clause is a private clause, otherwise - false.
230 
231 /// Checks if the specified clause is one of threadprivate clauses like
232 /// 'threadprivate', 'copyin' or 'copyprivate'.
233 /// \param Kind Clause kind.
234 /// \return true - the clause is a threadprivate clause, otherwise - false.
236 
237 /// Checks if the specified directive kind is one of tasking directives - task,
238 /// taskloop or taksloop simd.
240 
241 /// Checks if the specified directive kind is one of the composite or combined
242 /// directives that need loop bound sharing across loops outlined in nested
243 /// functions
245 
246 /// Return the captured regions of an OpenMP directive.
249  OpenMPDirectiveKind DKind);
250 }
251 
252 #endif
253 
Scheduling data for loop-based OpenMP directives.
Definition: OpenMPKinds.h:132
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
Definition: OpenMPKinds.h:107
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:1415
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind, OpenMPClauseKind CKind)
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
Definition: OpenMPKinds.h:115
const char * getOpenMPClauseName(OpenMPClauseKind Kind)
Definition: OpenMPKinds.cpp:62
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:84
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
Definition: OpenMPKinds.h:100
OpenMPScheduleClauseKind Schedule
Definition: OpenMPKinds.h:133
bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a teams-kind directive.
OpenMPScheduleClauseModifier M2
Definition: OpenMPKinds.h:135
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:33
bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a taskloop directive.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
Definition: OpenMPKinds.h:51
Kind
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Definition: OpenMPKinds.h:76
OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:23
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:67
Dataflow Directional Tag Classes.
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
Definition: OpenMPKinds.h:124
OpenMPScheduleClauseModifier M1
Definition: OpenMPKinds.h:134
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:59
OpenMPDefaultClauseKind
OpenMP attributes for &#39;default&#39; clause.
Definition: OpenMPKinds.h:43
OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str)
const char * getOpenMPDirectiveName(OpenMPDirectiveKind Kind)
Definition: OpenMPKinds.cpp:31
OpenMPMapClauseKind
OpenMP mapping kind for &#39;map&#39; clause.
Definition: OpenMPKinds.h:92
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...