diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h b/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h --- a/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h +++ b/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h @@ -41,12 +41,12 @@ #include "llvm/Frontend/OpenMP/OMPKinds.def" enum class ICVInitValue { -#define ICV_DATA_ENV(Enum, Name, EnvVar, Init) Init, +#define ICV_INIT_VALUE(Enum, Name) Enum, #include "llvm/Frontend/OpenMP/OMPKinds.def" }; -#define ICV_DATA_ENV(Enum, Name, EnvVar, Init) \ - constexpr auto Init = omp::ICVInitValue::Init; +#define ICV_INIT_VALUE(Enum, Name) \ + constexpr auto Enum = omp::ICVInitValue::Enum; #include "llvm/Frontend/OpenMP/OMPKinds.def" /// IDs for all omp runtime library (RTL) functions. diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def --- a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def +++ b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def @@ -228,6 +228,20 @@ /// ///{ +#ifndef ICV_INIT_VALUE +#define ICV_INIT_VALUE(Enum, Name) +#endif + +#define __ICV_INIT_VALUE(Name) ICV_INIT_VALUE(ICV_##Name, #Name) + +__ICV_INIT_VALUE(ZERO) +__ICV_INIT_VALUE(FALSE) +__ICV_INIT_VALUE(IMPLEMENTATION_DEFINED) +__ICV_INIT_VALUE(LAST) + +#undef __ICV_INIT_VALUE +#undef ICV_INIT_VALUE + #ifndef ICV_DATA_ENV #define ICV_DATA_ENV(Enum, Name, EnvVarName, Init) #endif @@ -238,6 +252,7 @@ __ICV_DATA_ENV(nthreads, OMP_NUM_THREADS, ICV_IMPLEMENTATION_DEFINED) __ICV_DATA_ENV(active_levels, NONE, ICV_ZERO) __ICV_DATA_ENV(cancel, OMP_CANCELLATION, ICV_FALSE) +__ICV_DATA_ENV(proc_bind, OMP_PROC_BIND, ICV_IMPLEMENTATION_DEFINED) __ICV_DATA_ENV(__last, last, ICV_LAST) #undef __ICV_DATA_ENV