]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.h
Update clang to trunk r256633.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Basic / OpenMPKinds.h
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 /// \brief 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 /// \brief 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 /// \brief 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_unknown
39 };
40
41 /// \brief OpenMP attributes for 'default' clause.
42 enum OpenMPDefaultClauseKind {
43 #define OPENMP_DEFAULT_KIND(Name) \
44   OMPC_DEFAULT_##Name,
45 #include "clang/Basic/OpenMPKinds.def"
46   OMPC_DEFAULT_unknown
47 };
48
49 /// \brief OpenMP attributes for 'proc_bind' clause.
50 enum OpenMPProcBindClauseKind {
51 #define OPENMP_PROC_BIND_KIND(Name) \
52   OMPC_PROC_BIND_##Name,
53 #include "clang/Basic/OpenMPKinds.def"
54   OMPC_PROC_BIND_unknown
55 };
56
57 /// \brief OpenMP attributes for 'schedule' clause.
58 enum OpenMPScheduleClauseKind {
59 #define OPENMP_SCHEDULE_KIND(Name) \
60   OMPC_SCHEDULE_##Name,
61 #include "clang/Basic/OpenMPKinds.def"
62   OMPC_SCHEDULE_unknown
63 };
64
65 /// \brief OpenMP modifiers for 'schedule' clause.
66 enum OpenMPScheduleClauseModifier {
67   OMPC_SCHEDULE_MODIFIER_unknown = OMPC_SCHEDULE_unknown,
68 #define OPENMP_SCHEDULE_MODIFIER(Name) \
69   OMPC_SCHEDULE_MODIFIER_##Name,
70 #include "clang/Basic/OpenMPKinds.def"
71   OMPC_SCHEDULE_MODIFIER_last
72 };
73
74 /// \brief OpenMP attributes for 'depend' clause.
75 enum OpenMPDependClauseKind {
76 #define OPENMP_DEPEND_KIND(Name) \
77   OMPC_DEPEND_##Name,
78 #include "clang/Basic/OpenMPKinds.def"
79   OMPC_DEPEND_unknown
80 };
81
82 /// \brief OpenMP attributes for 'linear' clause.
83 enum OpenMPLinearClauseKind {
84 #define OPENMP_LINEAR_KIND(Name) \
85   OMPC_LINEAR_##Name,
86 #include "clang/Basic/OpenMPKinds.def"
87   OMPC_LINEAR_unknown
88 };
89
90 /// \brief OpenMP mapping kind for 'map' clause.
91 enum OpenMPMapClauseKind {
92 #define OPENMP_MAP_KIND(Name) \
93   OMPC_MAP_##Name,
94 #include "clang/Basic/OpenMPKinds.def"
95   OMPC_MAP_unknown
96 };
97
98 OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str);
99 const char *getOpenMPDirectiveName(OpenMPDirectiveKind Kind);
100
101 OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str);
102 const char *getOpenMPClauseName(OpenMPClauseKind Kind);
103
104 unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str);
105 const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type);
106
107 bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind,
108                                  OpenMPClauseKind CKind);
109
110 /// \brief Checks if the specified directive is a directive with an associated
111 /// loop construct.
112 /// \param DKind Specified directive.
113 /// \return true - the directive is a loop-associated directive like 'omp simd'
114 /// or 'omp for' directive, otherwise - false.
115 bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind);
116
117 /// \brief Checks if the specified directive is a worksharing directive.
118 /// \param DKind Specified directive.
119 /// \return true - the directive is a worksharing directive like 'omp for',
120 /// otherwise - false.
121 bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind);
122
123 /// \brief Checks if the specified directive is a taskloop directive.
124 /// \param DKind Specified directive.
125 /// \return true - the directive is a worksharing directive like 'omp taskloop',
126 /// otherwise - false.
127 bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind);
128
129 /// \brief Checks if the specified directive is a parallel-kind directive.
130 /// \param DKind Specified directive.
131 /// \return true - the directive is a parallel-like directive like 'omp
132 /// parallel', otherwise - false.
133 bool isOpenMPParallelDirective(OpenMPDirectiveKind DKind);
134
135 /// \brief Checks if the specified directive is a target-kind directive.
136 /// \param DKind Specified directive.
137 /// \return true - the directive is a target-like directive like 'omp target',
138 /// otherwise - false.
139 bool isOpenMPTargetDirective(OpenMPDirectiveKind DKind);
140
141 /// \brief Checks if the specified directive is a teams-kind directive.
142 /// \param DKind Specified directive.
143 /// \return true - the directive is a teams-like directive like 'omp teams',
144 /// otherwise - false.
145 bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind);
146
147 /// \brief Checks if the specified directive is a simd directive.
148 /// \param DKind Specified directive.
149 /// \return true - the directive is a simd directive like 'omp simd',
150 /// otherwise - false.
151 bool isOpenMPSimdDirective(OpenMPDirectiveKind DKind);
152
153 /// \brief Checks if the specified directive is a distribute directive.
154 /// \param DKind Specified directive.
155 /// \return true - the directive is a distribute-directive like 'omp
156 /// distribute',
157 /// otherwise - false.
158 bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind);
159
160 /// \brief Checks if the specified clause is one of private clauses like
161 /// 'private', 'firstprivate', 'reduction' etc..
162 /// \param Kind Clause kind.
163 /// \return true - the clause is a private clause, otherwise - false.
164 bool isOpenMPPrivate(OpenMPClauseKind Kind);
165
166 /// \brief Checks if the specified clause is one of threadprivate clauses like
167 /// 'threadprivate', 'copyin' or 'copyprivate'.
168 /// \param Kind Clause kind.
169 /// \return true - the clause is a threadprivate clause, otherwise - false.
170 bool isOpenMPThreadPrivate(OpenMPClauseKind Kind);
171
172 }
173
174 #endif
175