[PATCH] D47953: [builtin] Add bitfield support for __builtin_dump_struct

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 29 11:35:41 PDT 2018


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 <
reviews at 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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180629/6cf0290b/attachment.html>


More information about the cfe-commits mailing list