[PATCH] D122248: [clang][CodeGen]Fix clang crash and add bitfield support in __builtin_dump_struct
Wang Yihan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 23 13:43:30 PDT 2022
yihanaa added a comment.
In D122248#3403698 <https://reviews.llvm.org/D122248#3403698>, @erichkeane wrote:
>> I'm sorry I misunderstood what you meant @aaron.ballman.
>>
>> Can we follow the lead of LLVM IR?it use 'undef'
>> for example:
>>
>> struct T6A {
>> unsigned a : 1;
>> unsigned : 0;
>> unsigned c : 1;
>> };
>>
>> @__const.foo.a = private unnamed_addr constant %struct.T6A { i8 1, [3 x i8] undef, i8 1, [3 x i8] undef }, align 4
>
> I misunderstood him too, he told me off line :)
>
> I guess I would be 'ok' with `undef`, though that has a different meaning (it means, this has an arbitrary value). In this case, it has NO value, which is somewhat different.
What if we don't emit '=' for zero-width bitfield, like this:
struct Bar {
unsigned c : 1;
unsigned : 3;
unsigned : 0;
unsigned b;
};
struct Bar {
unsigned int c : 1 = 0
unsigned int : 3 = 0
unsigned int : 0
unsigned int b = 0
}
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122248/new/
https://reviews.llvm.org/D122248
More information about the cfe-commits
mailing list