]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.h
Merge OpenBSM 1.2 alpha 4.
[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 attributes for 'depend' clause.
66 enum OpenMPDependClauseKind {
67 #define OPENMP_DEPEND_KIND(Name) \
68   OMPC_DEPEND_##Name,
69 #include "clang/Basic/OpenMPKinds.def"
70   OMPC_DEPEND_unknown
71 };
72
73 OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str);
74 const char *getOpenMPDirectiveName(OpenMPDirectiveKind Kind);
75
76 OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str);
77 const char *getOpenMPClauseName(OpenMPClauseKind Kind);
78
79 unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str);
80 const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type);
81
82 bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind,
83                                  OpenMPClauseKind CKind);
84
85 /// \brief Checks if the specified directive is a directive with an associated
86 /// loop construct.
87 /// \param DKind Specified directive.
88 /// \return true - the directive is a loop-associated directive like 'omp simd'
89 /// or 'omp for' directive, otherwise - false.
90 bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind);
91
92 /// \brief Checks if the specified directive is a worksharing directive.
93 /// \param DKind Specified directive.
94 /// \return true - the directive is a worksharing directive like 'omp for',
95 /// otherwise - false.
96 bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind);
97
98 /// \brief Checks if the specified directive is a parallel-kind directive.
99 /// \param DKind Specified directive.
100 /// \return true - the directive is a parallel-like directive like 'omp
101 /// parallel', otherwise - false.
102 bool isOpenMPParallelDirective(OpenMPDirectiveKind DKind);
103
104 /// \brief Checks if the specified directive is a teams-kind directive.
105 /// \param DKind Specified directive.
106 /// \return true - the directive is a teams-like directive like 'omp teams',
107 /// otherwise - false.
108 bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind);
109
110 /// \brief Checks if the specified directive is a simd directive.
111 /// \param DKind Specified directive.
112 /// \return true - the directive is a simd directive like 'omp simd',
113 /// otherwise - false.
114 bool isOpenMPSimdDirective(OpenMPDirectiveKind DKind);
115
116 /// \brief Checks if the specified clause is one of private clauses like
117 /// 'private', 'firstprivate', 'reduction' etc..
118 /// \param Kind Clause kind.
119 /// \return true - the clause is a private clause, otherwise - false.
120 bool isOpenMPPrivate(OpenMPClauseKind Kind);
121
122 /// \brief Checks if the specified clause is one of threadprivate clauses like
123 /// 'threadprivate', 'copyin' or 'copyprivate'.
124 /// \param Kind Clause kind.
125 /// \return true - the clause is a threadprivate clause, otherwise - false.
126 bool isOpenMPThreadPrivate(OpenMPClauseKind Kind);
127
128 }
129
130 #endif
131