clang  3.8.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 /// \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.
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 /// \brief OpenMP clauses.
34 #define OPENMP_CLAUSE(Name, Class) \
35  OMPC_##Name,
36 #include "clang/Basic/OpenMPKinds.def"
39 };
40 
41 /// \brief OpenMP attributes for 'default' clause.
43 #define OPENMP_DEFAULT_KIND(Name) \
44  OMPC_DEFAULT_##Name,
45 #include "clang/Basic/OpenMPKinds.def"
47 };
48 
49 /// \brief 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 /// \brief OpenMP attributes for 'schedule' clause.
59 #define OPENMP_SCHEDULE_KIND(Name) \
60  OMPC_SCHEDULE_##Name,
61 #include "clang/Basic/OpenMPKinds.def"
63 };
64 
65 /// \brief 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 /// \brief OpenMP attributes for 'depend' clause.
76 #define OPENMP_DEPEND_KIND(Name) \
77  OMPC_DEPEND_##Name,
78 #include "clang/Basic/OpenMPKinds.def"
80 };
81 
82 /// \brief OpenMP attributes for 'linear' clause.
84 #define OPENMP_LINEAR_KIND(Name) \
85  OMPC_LINEAR_##Name,
86 #include "clang/Basic/OpenMPKinds.def"
88 };
89 
90 /// \brief 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 OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str);
100 
101 OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str);
103 
104 unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str);
105 const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type);
106 
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
171 
172 }
173 
174 #endif
175 
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind, OpenMPClauseKind CKind)
const char * getOpenMPClauseName(OpenMPClauseKind Kind)
Definition: OpenMPKinds.cpp:61
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
Definition: OpenMPKinds.h:83
bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a teams-kind directive.
OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str)
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:50
Kind
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Definition: OpenMPKinds.h:75
OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:23
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
Definition: OpenMPKinds.h:66
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'.
unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str)
bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a distribute directive.
bool isOpenMPTargetDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a target-kind directive.
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
Definition: OpenMPKinds.h:58
OpenMPDefaultClauseKind
OpenMP attributes for 'default' clause.
Definition: OpenMPKinds.h:42
OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str)
const char * getOpenMPDirectiveName(OpenMPDirectiveKind Kind)
Definition: OpenMPKinds.cpp:31
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Definition: OpenMPKinds.h:91
bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a directive with an associated loop construct.