Make VTs and UnicodeCharSet ctors constexpr if the compiler supports it.
[oota-llvm.git] / include / llvm / Support / UnicodeCharRanges.h
index 79137bf353633787c31489af22e14df96656e226..9f738dff11075287bb9f6e8a0f93b731823cbbcf 100644 (file)
@@ -50,9 +50,13 @@ 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
+  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.