Include missing Compiler.h for using LLVM_ENUM_INT_TYPE.
[oota-llvm.git] / include / llvm / Support / Compiler.h
index c32a48546ce2515db78bbed9b935d81e1fac70cd..13920fcc5a89b7105ac01e2ff15f615c314a9d41 100644 (file)
 # define LLVM_STATIC_ASSERT(expr, msg)
 #endif
 
+/// \macro LLVM_ENUM_INT_TYPE
+/// \brief Expands to colon followed by the given integral type on compilers
+/// which support C++11 strong enums.  This can be used to make enums unsigned
+/// with MSVC.
+#if __has_feature(cxx_strong_enums)
+# define LLVM_ENUM_INT_TYPE(intty) : intty
+#elif defined(_MSC_VER) && _MSC_VER >= 1600  // Added in MSVC 2010.
+# define LLVM_ENUM_INT_TYPE(intty) : intty
+#else
+# define LLVM_ENUM_INT_TYPE(intty)
+#endif
+
 #endif