[PATCH] D11890: Fixed Visual Studio warnings.

James Touton via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 10:21:55 PDT 2015


jtouton updated this revision to Diff 34167.
jtouton added a comment.

- Fixed formatting issues.


http://reviews.llvm.org/D11890

Files:
  include/llvm/ADT/SmallBitVector.h

Index: include/llvm/ADT/SmallBitVector.h
===================================================================
--- include/llvm/ADT/SmallBitVector.h
+++ include/llvm/ADT/SmallBitVector.h
@@ -553,17 +553,15 @@
 private:
   template<bool AddBits, bool InvertMask>
   void applyMask(const uint32_t *Mask, unsigned MaskWords) {
-    if (NumBaseBits == 64 && MaskWords >= 2) {
-      uint64_t M = Mask[0] | (uint64_t(Mask[1]) << 32);
-      if (InvertMask) M = ~M;
-      if (AddBits) setSmallBits(getSmallBits() | M);
-      else         setSmallBits(getSmallBits() & ~M);
-    } else {
-      uint32_t M = Mask[0];
-      if (InvertMask) M = ~M;
-      if (AddBits) setSmallBits(getSmallBits() | M);
-      else         setSmallBits(getSmallBits() & ~M);
+    uintptr_t M = Mask[0];
+    if (MaskWords != 1) {
+      assert(NumBaseBits == 64 && MaskWords == 2 &&
+             "Mask is larger than base!");
+      M |= uintptr_t(Mask[1]) << 32;
     }
+    if (InvertMask) M = ~M;
+    if (AddBits) setSmallBits(getSmallBits() | M);
+    else         setSmallBits(getSmallBits() & ~M);
   }
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11890.34167.patch
Type: text/x-patch
Size: 1092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150907/0dd763ee/attachment.bin>


More information about the llvm-commits mailing list