[PATCH] D23384: Use a byte array as an internal buffer of BitVector.

bryant via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 17:37:04 PDT 2016


bryant added inline comments.

================
Comment at: include/llvm/ADT/BitVector.h:486
@@ -531,1 +485,3 @@
+      Word, support::little, false>;
+    return *(WordLE *)&W;
   }
----------------
zturner wrote:
> ruiu wrote:
> > I think it is, but we are doing this at so many places to read and convert values in different endianness.
> If the type of Word is `support::ulittle32_t`, then you don't have to worry about this, as you can just delete this entire function.
not sure if ub is good, regardless. maybe `return WordLE(WW);` and let `packed_endian_specific_integral::operator value_type` do the potential conversion for you through `void *`, which is one of two exceptions to strict aliasing.


https://reviews.llvm.org/D23384





More information about the llvm-commits mailing list