diff options
Diffstat (limited to 'llvm/include/llvm/Frontend/OpenMP/OMPConstants.h')
-rw-r--r-- | llvm/include/llvm/Frontend/OpenMP/OMPConstants.h | 69 |
1 files changed, 28 insertions, 41 deletions
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h b/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h index 2f9a5ee71e67d..d171d0a2b6c44 100644 --- a/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h +++ b/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h @@ -15,29 +15,38 @@ #define LLVM_OPENMP_CONSTANTS_H #include "llvm/ADT/BitmaskEnum.h" -#include "llvm/ADT/StringRef.h" + +#include "llvm/Frontend/OpenMP/OMP.h.inc" namespace llvm { class Type; class Module; +class ArrayType; class StructType; class PointerType; +class StringRef; class FunctionType; namespace omp { LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE(); -/// IDs for all OpenMP directives. -enum class Directive { -#define OMP_DIRECTIVE(Enum, ...) Enum, +/// IDs for all Internal Control Variables (ICVs). +enum class InternalControlVar { +#define ICV_DATA_ENV(Enum, ...) Enum, +#include "llvm/Frontend/OpenMP/OMPKinds.def" +}; + +#define ICV_DATA_ENV(Enum, ...) \ + constexpr auto Enum = omp::InternalControlVar::Enum; +#include "llvm/Frontend/OpenMP/OMPKinds.def" + +enum class ICVInitValue { +#define ICV_DATA_ENV(Enum, Name, EnvVar, Init) Init, #include "llvm/Frontend/OpenMP/OMPKinds.def" }; -/// Make the enum values available in the llvm::omp namespace. This allows us to -/// write something like OMPD_parallel if we have a `using namespace omp`. At -/// the same time we do not loose the strong type guarantees of the enum class, -/// that is we cannot pass an unsigned as Directive without an explicit cast. -#define OMP_DIRECTIVE(Enum, ...) constexpr auto Enum = omp::Directive::Enum; +#define ICV_DATA_ENV(Enum, Name, EnvVar, Init) \ + constexpr auto Init = omp::ICVInitValue::Init; #include "llvm/Frontend/OpenMP/OMPKinds.def" /// IDs for all omp runtime library (RTL) functions. @@ -49,6 +58,16 @@ enum class RuntimeFunction { #define OMP_RTL(Enum, ...) constexpr auto Enum = omp::RuntimeFunction::Enum; #include "llvm/Frontend/OpenMP/OMPKinds.def" +/// IDs for the different default kinds. +enum class DefaultKind { +#define OMP_DEFAULT_KIND(Enum, Str) Enum, +#include "llvm/Frontend/OpenMP/OMPKinds.def" +}; + +#define OMP_DEFAULT_KIND(Enum, ...) \ + constexpr auto Enum = omp::DefaultKind::Enum; +#include "llvm/Frontend/OpenMP/OMPKinds.def" + /// IDs for the different proc bind kinds. enum class ProcBindKind { #define OMP_PROC_BIND_KIND(Enum, Str, Value) Enum = Value, @@ -70,38 +89,6 @@ enum class IdentFlag { #define OMP_IDENT_FLAG(Enum, ...) constexpr auto Enum = omp::IdentFlag::Enum; #include "llvm/Frontend/OpenMP/OMPKinds.def" -/// Parse \p Str and return the directive it matches or OMPD_unknown if none. -Directive getOpenMPDirectiveKind(StringRef Str); - -/// Return a textual representation of the directive \p D. -StringRef getOpenMPDirectiveName(Directive D); - -/// Forward declarations for LLVM-IR types (simple, function and structure) are -/// generated below. Their names are defined and used in OpenMP/OMPKinds.def. -/// Here we provide the forward declarations, the initializeTypes function will -/// provide the values. -/// -///{ -namespace types { - -#define OMP_TYPE(VarName, InitValue) extern Type *VarName; -#define OMP_FUNCTION_TYPE(VarName, IsVarArg, ReturnType, ...) \ - extern FunctionType *VarName; \ - extern PointerType *VarName##Ptr; -#define OMP_STRUCT_TYPE(VarName, StrName, ...) \ - extern StructType *VarName; \ - extern PointerType *VarName##Ptr; -#include "llvm/Frontend/OpenMP/OMPKinds.def" - -/// Helper to initialize all types defined in OpenMP/OMPKinds.def. -void initializeTypes(Module &M); - -/// Helper to uninitialize all types defined in OpenMP/OMPKinds.def. -void uninitializeTypes(); - -} // namespace types -///} - } // end namespace omp } // end namespace llvm |