This removes the eating of the error in Archive::Child::getSize() when the characters
[oota-llvm.git] / include / llvm / Support / UnicodeCharRanges.h
index 734d323047c97faeae52c6f42d485ca6172a0a90..9f738dff11075287bb9f6e8a0f93b731823cbbcf 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,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.
@@ -88,6 +94,8 @@ private:
   const CharRanges Ranges;
 };
 
+#undef DEBUG_TYPE // "unicode"
+
 } // namespace sys
 } // namespace llvm