diff options
Diffstat (limited to 'include/clang/Basic/OpenMPKinds.h')
| -rw-r--r-- | include/clang/Basic/OpenMPKinds.h | 64 |
1 files changed, 58 insertions, 6 deletions
diff --git a/include/clang/Basic/OpenMPKinds.h b/include/clang/Basic/OpenMPKinds.h index 5b4573124f21f..526cbb26cf151 100644 --- a/include/clang/Basic/OpenMPKinds.h +++ b/include/clang/Basic/OpenMPKinds.h @@ -21,30 +21,45 @@ namespace clang { /// \brief OpenMP directives. enum OpenMPDirectiveKind { - OMPD_unknown = 0, #define OPENMP_DIRECTIVE(Name) \ OMPD_##Name, +#define OPENMP_DIRECTIVE_EXT(Name, Str) \ + OMPD_##Name, #include "clang/Basic/OpenMPKinds.def" - NUM_OPENMP_DIRECTIVES + OMPD_unknown }; /// \brief OpenMP clauses. enum OpenMPClauseKind { - OMPC_unknown = 0, #define OPENMP_CLAUSE(Name, Class) \ OMPC_##Name, #include "clang/Basic/OpenMPKinds.def" OMPC_threadprivate, - NUM_OPENMP_CLAUSES + OMPC_unknown }; /// \brief OpenMP attributes for 'default' clause. enum OpenMPDefaultClauseKind { - OMPC_DEFAULT_unknown = 0, #define OPENMP_DEFAULT_KIND(Name) \ OMPC_DEFAULT_##Name, #include "clang/Basic/OpenMPKinds.def" - NUM_OPENMP_DEFAULT_KINDS + OMPC_DEFAULT_unknown +}; + +/// \brief OpenMP attributes for 'proc_bind' clause. +enum OpenMPProcBindClauseKind { +#define OPENMP_PROC_BIND_KIND(Name) \ + OMPC_PROC_BIND_##Name, +#include "clang/Basic/OpenMPKinds.def" + OMPC_PROC_BIND_unknown +}; + +/// \brief OpenMP attributes for 'schedule' clause. +enum OpenMPScheduleClauseKind { +#define OPENMP_SCHEDULE_KIND(Name) \ + OMPC_SCHEDULE_##Name, +#include "clang/Basic/OpenMPKinds.def" + OMPC_SCHEDULE_unknown }; OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str); @@ -59,6 +74,43 @@ const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type); bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind, OpenMPClauseKind CKind); +/// \brief Checks if the specified directive is a directive with an associated +/// loop construct. +/// \param DKind Specified directive. +/// \return true - the directive is a loop-associated directive like 'omp simd' +/// or 'omp for' directive, otherwise - false. +bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind); + +/// \brief Checks if the specified directive is a worksharing directive. +/// \param DKind Specified directive. +/// \return true - the directive is a worksharing directive like 'omp for', +/// otherwise - false. +bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind); + +/// \brief Checks if the specified directive is a parallel-kind directive. +/// \param DKind Specified directive. +/// \return true - the directive is a parallel-like directive like 'omp +/// parallel', otherwise - false. +bool isOpenMPParallelDirective(OpenMPDirectiveKind DKind); + +/// \brief Checks if the specified directive is a simd directive. +/// \param DKind Specified directive. +/// \return true - the directive is a simd directive like 'omp simd', +/// otherwise - false. +bool isOpenMPSimdDirective(OpenMPDirectiveKind DKind); + +/// \brief Checks if the specified clause is one of private clauses like +/// 'private', 'firstprivate', 'reduction' etc.. +/// \param Kind Clause kind. +/// \return true - the clause is a private clause, otherwise - false. +bool isOpenMPPrivate(OpenMPClauseKind Kind); + +/// \brief Checks if the specified clause is one of threadprivate clauses like +/// 'threadprivate', 'copyin' or 'copyprivate'. +/// \param Kind Clause kind. +/// \return true - the clause is a threadprivate clause, otherwise - false. +bool isOpenMPThreadPrivate(OpenMPClauseKind Kind); + } #endif |
