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 OMPD_unknown = 0, 25 #define OPENMP_DIRECTIVE(Name) \ 26 OMPD_##Name, 27 #include "clang/Basic/OpenMPKinds.def" 28 NUM_OPENMP_DIRECTIVES 29 }; 30 31 /// \brief OpenMP clauses. 32 enum OpenMPClauseKind { 33 OMPC_unknown = 0, 34 #define OPENMP_CLAUSE(Name, Class) \ 35 OMPC_##Name, 36 #include "clang/Basic/OpenMPKinds.def" 37 OMPC_threadprivate, 38 NUM_OPENMP_CLAUSES 39 }; 40 41 /// \brief OpenMP attributes for 'default' clause. 42 enum OpenMPDefaultClauseKind { 43 OMPC_DEFAULT_unknown = 0, 44 #define OPENMP_DEFAULT_KIND(Name) \ 45 OMPC_DEFAULT_##Name, 46 #include "clang/Basic/OpenMPKinds.def" 47 NUM_OPENMP_DEFAULT_KINDS 48 }; 49 50 OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str); 51 const char *getOpenMPDirectiveName(OpenMPDirectiveKind Kind); 52 53 OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str); 54 const char *getOpenMPClauseName(OpenMPClauseKind Kind); 55 56 unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str); 57 const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type); 58 59 bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind, 60 OpenMPClauseKind CKind); 61 62 } 63 64 #endif 65 66