[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 18:30:49 PDT 2016
bryant added inline comments.
================
Comment at: include/llvm/ADT/BitVector.h:480
@@ +479,3 @@
+ return sys::getSwappedBytes(W);
+#endif
+ return W;
----------------
ruiu wrote:
> 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)
>
> ?
unfortunately, that would also be ub.
https://reviews.llvm.org/D23384
More information about the llvm-commits
mailing list