[AVX512] add PSRAD and PSRAQ Intrinsic
[oota-llvm.git] / include / llvm / Support / UnicodeCharRanges.h
index aadca8684683aec181e53b377668b28985b2b44b..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;
@@ -39,7 +41,7 @@ inline bool operator<(UnicodeCharRange Range, uint32_t Value) {
 /// array.
 class UnicodeCharSet {
 public:
-  typedef llvm::ArrayRef<UnicodeCharRange> CharRanges;
+  typedef ArrayRef<UnicodeCharRange> CharRanges;
 
   /// \brief Constructs a UnicodeCharSet instance from an array of
   /// UnicodeCharRanges.
@@ -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.
@@ -66,17 +77,17 @@ private:
     for (CharRanges::const_iterator I = Ranges.begin(), E = Ranges.end();
          I != E; ++I) {
       if (I != Ranges.begin() && Prev >= I->Lower) {
-        DEBUG(llvm::dbgs() << "Upper bound 0x");
-        DEBUG(llvm::dbgs().write_hex(Prev));
-        DEBUG(llvm::dbgs() << " should be less than succeeding lower bound 0x");
-        DEBUG(llvm::dbgs().write_hex(I->Lower) << "\n");
+        DEBUG(dbgs() << "Upper bound 0x");
+        DEBUG(dbgs().write_hex(Prev));
+        DEBUG(dbgs() << " should be less than succeeding lower bound 0x");
+        DEBUG(dbgs().write_hex(I->Lower) << "\n");
         return false;
       }
       if (I->Upper < I->Lower) {
-        DEBUG(llvm::dbgs() << "Upper bound 0x");
-        DEBUG(llvm::dbgs().write_hex(I->Lower));
-        DEBUG(llvm::dbgs() << " should not be less than lower bound 0x");
-        DEBUG(llvm::dbgs().write_hex(I->Upper) << "\n");
+        DEBUG(dbgs() << "Upper bound 0x");
+        DEBUG(dbgs().write_hex(I->Lower));
+        DEBUG(dbgs() << " should not be less than lower bound 0x");
+        DEBUG(dbgs().write_hex(I->Upper) << "\n");
         return false;
       }
       Prev = I->Upper;
@@ -88,6 +99,8 @@ private:
   const CharRanges Ranges;
 };
 
+#undef DEBUG_TYPE // "unicode"
+
 } // namespace sys
 } // namespace llvm