Hi all,
this is my first contribution to the LLVM project.
The patch adds support for generating the tbaa.struct metadata for structs containing bitfields. The current implementation does not support bitfields and even generates wrong tbaa.struct metadata ... see https://github.com/llvm/llvm-project/issues/59328 .
The patch is not yet finished. I need some help to create an appropriate test case. My first test case looks like that
struct a { int : 8; int b1 : 4; int b2 : 8; }; a i1,i2; void c() { i1 = i2; }
and should generate the following metadata
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 bitcast (%struct.a* @i1 to i8*), i8* align 4 bitcast (%struct.a* @i2 to i8*), i64 4, i1 false), !tbaa.struct !3 ... !3 = !{i64 1, i64 2, !4}
Furthermore, I am unsure what Type should be used for adding bitfields to tbaa.struct. The original type or char? The current implementation uses the original type (if not alias).