Add a C++11 ThreadPool implementation in LLVM
[oota-llvm.git] / include / llvm / Support / UnicodeCharRanges.h
index 734d323047c97faeae52c6f42d485ca6172a0a90..134698c3ec6b394c2b41910f251e3e0715741b87 100644 (file)
@@ -21,6 +21,8 @@
 namespace llvm {
 namespace sys {
 
+#define DEBUG_TYPE "unicode"
+
 /// \brief Represents a closed range of Unicode code points [Lower, Upper].
 struct UnicodeCharRange {
   uint32_t Lower;
@@ -48,9 +50,18 @@ public:
   /// the UnicodeCharSet instance, and should not change. Array is validated by
   /// the constructor, so it makes sense to create as few UnicodeCharSet
   /// instances per each array of ranges, as possible.
+#ifdef NDEBUG
+
+  // FIXME: This could use constexpr + static_assert. This way we
+  // may get rid of NDEBUG in this header. Unfortunately there are some
+  // problems to get this working with MSVC 2013. Change this when
+  // the support for MSVC 2013 is dropped.
+  LLVM_CONSTEXPR UnicodeCharSet(CharRanges Ranges) : Ranges(Ranges) {}
+#else
   UnicodeCharSet(CharRanges Ranges) : Ranges(Ranges) {
     assert(rangesAreValid());
   }
+#endif
 
   /// \brief Returns true if the character set contains the Unicode code point
   /// \p C.
@@ -88,6 +99,8 @@ private:
   const CharRanges Ranges;
 };
 
+#undef DEBUG_TYPE // "unicode"
+
 } // namespace sys
 } // namespace llvm