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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 18:23:29 PDT 2016


ruiu added inline comments.

================
Comment at: include/llvm/ADT/BitVector.h:480
@@ +479,3 @@
+    return sys::getSwappedBytes(W);
+#endif
+    return W;
----------------
bryant wrote:
> ruiu wrote:
> > ruiu wrote:
> > > I used getSwappedBytes instead.
> > How does it work? What is `WW`?
> typo. i meant `W`. as for how it works:
> 
> ```
>   explicit packed_endian_specific_integral(value_type val) { *this = val; }
> 
>   operator value_type() const {
>     return endian::read<value_type, endian, alignment>(
>       (const void*)Value.buffer);
>   }
> ```
Is it different from

  return *(WordLE *)((void *)&W)

?


https://reviews.llvm.org/D23384





More information about the llvm-commits mailing list