-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CIR][CIRGen] Achieve union's bitfields additionally. #742
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
When I try to build the testcase, I get a crash in a place that doesn't seem related to the changes here:
for (const auto *Field : recordDecl->fields()) {
if (Field->isBitField()) {
if (Field->isZeroLengthBitField(astContext))
continue;
llvm_unreachable("NYI");
}
Can you elaborate a bit more on the approach and what are you trying to achieve? @gitoleg can you also review this PR?
Hi, I have met the scene that codegen union with bitfields with clangir once, and it reported 'NYI' yet. I think this PR just reuse infrastructure of struct bitfields to explain union bitfiels type. I try locally and it seems work, and new union type has carried bitfield info I think.
and the output
|
looks reasonable ... though frankly speaking I didn't know that it's somehow possible (and useful!) to use bit fields in unions. But anyways, looks ok so far. |
sorry, my bad, pushed wrong button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies on the delay, this LGTM. Thanks a bunch for working on this
Achieve union's bitfields additionally.
Achieve union's bitfields additionally.
Achieve union's bitfields additionally.
Achieve union's bitfields additionally.
Achieve union's bitfields additionally.
Achieve union's bitfields additionally.
Achieve union's bitfields additionally.