clang  3.7.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 attributes for 'depend' clause.
67 #define OPENMP_DEPEND_KIND(Name) \
68  OMPC_DEPEND_##Name,
69 #include "clang/Basic/OpenMPKinds.def"
71 };
72 
73 OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str);
75 
76 OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str);
78 
79 unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str);
80 const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type);
81 
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.
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.
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.
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.
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.
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.
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.
127 
128 }
129 
130 #endif
131 
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind, OpenMPClauseKind CKind)
const char * getOpenMPClauseName(OpenMPClauseKind Kind)
Definition: OpenMPKinds.cpp:61
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
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
Definition: OpenMPKinds.h:50
Kind
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Definition: OpenMPKinds.h:66
OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:23
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)
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
bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a directive with an associated loop construct.