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

2018-06-29 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a subscriber: paulsemel. dblaikie added a comment. 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

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

2018-06-29 Thread David Blaikie via cfe-commits
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

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

2018-06-29 Thread Paul Semel via Phabricator via cfe-commits
paulsemel updated this revision to Diff 153511. paulsemel added a comment. Fixed version problem. Now building. Repository: rC Clang https://reviews.llvm.org/D47953 Files: lib/CodeGen/CGBuiltin.cpp Index: lib/CodeGen/CGBuiltin.cpp

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

2018-06-29 Thread Paul Semel via Phabricator via cfe-commits
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 *' > >

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

2018-06-25 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. 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),

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

2018-06-22 Thread Paul Semel via Phabricator via cfe-commits
paulsemel added a comment. First thanks all for reviewing ! Basically, what's happening is that it works good with non-packed structures. Here is an example for packed structure (with unsigned signed short): c struct lol { unsigned short a:3; unsigned short b:2;

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

2018-06-21 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. Yeah, I know nothing about this dump feature or what's being fixed here - test cases would be great to help motivate/explain. Repository: rC Clang https://reviews.llvm.org/D47953 ___ cfe-commits mailing list

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

2018-06-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: echristo, rsmith, dblaikie. aaron.ballman added a comment. In https://reviews.llvm.org/D47953#1137375, @paulsemel wrote: > I will for sure add tests @lebedev.ri . Fact is that, for the moment, this is > not working as expected. > This is why I am asking for a bit

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

2018-06-20 Thread Paul Semel via Phabricator via cfe-commits
paulsemel added a comment. I will for sure add tests @lebedev.ri . Fact is that, for the moment, this is not working as expected. This is why I am asking for a bit of help about this bitfield handling :) Comment at: lib/CodeGen/CGBuiltin.cpp:1250 + if (Info.IsSigned) { +

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

2018-06-19 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:1250 + if (Info.IsSigned) { +unsigned HighBits = Info.StorageSize - Info.Offset - Info.Size; +if (HighBits) What happens if this overflows due to being < 0?

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

2018-06-14 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. This seems to be missing tests. 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

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

2018-06-14 Thread Paul Semel via Phabricator via cfe-commits
paulsemel added a comment. ping :) @aaron.ballman 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

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

2018-06-08 Thread Paul Semel via Phabricator via cfe-commits
paulsemel added a comment. This version is working for non packed structures. For packed structures, it might sometimes work, sometimes not. The resulting assembly code seems to be the right one. If someone went through bitfields manipulation, please do not hesitate to comment ! Requesting for

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

2018-06-08 Thread Paul Semel via Phabricator via cfe-commits
paulsemel created this revision. paulsemel added a reviewer: aaron.ballman. This is an attempt for adding bitfield support to __builtin_dump_struct. Repository: rC Clang https://reviews.llvm.org/D47953 Files: lib/CodeGen/CGBuiltin.cpp Index: lib/CodeGen/CGBuiltin.cpp