Yeah, doesn't look like this code handles a value crossing the boundary of
the size of the bitfield type (it's reading only the low bit).

I suspect looking at the code that generates bitfield accesses would be
useful - and/or maybe actually calling into that very code, rather than
reimplementing it here? CodeGenFunction::EmitLoadOfBitfieldLValue seems to
be the place to go (I found this by writing a short example that loads one
of these strided bitfield values & then breaking in
llvm::BinaryOperator::BinaryOperator until I found the 'and' operation,
since that seemed like the more interesting one).



On Fri, Jun 29, 2018 at 9:47 AM Paul Semel via Phabricator <
revi...@reviews.llvm.org> wrote:

> paulsemel added a comment.
>
> In https://reviews.llvm.org/D47953#1143044, @dblaikie wrote:
>
> > This doesn't seem to build for me - so hard to debug/probe it:
> >
> > llvm/src/tools/clang/lib/CodeGen/CGBuiltin.cpp:1264:65: error: no viable
> conversion from 'clang::QualType' to 'llvm::Type *'
> >
> >   CGF.CGM.getDataLayout().getTypeSizeInBits(CanonicalType),
> >                                             ^~~~~~~~~~~~~
> >
> > llvm/src/include/llvm/IR/DataLayout.h:560:53: note: passing argument to
> parameter 'Ty' here
> >  inline uint64_t DataLayout::getTypeSizeInBits(Type *Ty) const {
> >
> >   ^
> >
> > 1 error generated.
>
>
> Very sorry about it, I should have paid more attention..
>
>
> Repository:
>   rC Clang
>
> https://reviews.llvm.org/D47953
>
>
>
>
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to