如何在LLVM中派生联合类型
LLVM编译成这样如何在LLVM中派生联合类型,llvm,unions,Llvm,Unions,LLVM编译成这样 union u{ char ch[41]; int b[10]; }un; union un{ struct s{ int a; float f; double d; }st; int intArr[10]; }uno; 还有这个 %union.u = type { [10 x i32], [4 x i8] } 编译成这样 union u{ char ch[41]; int b[10]; }un; union un
union u{
char ch[41];
int b[10];
}un;
union un{
struct s{
int a;
float f;
double d;
}st;
int intArr[10];
}uno;
还有这个
%union.u = type { [10 x i32], [4 x i8] }
编译成这样
union u{
char ch[41];
int b[10];
}un;
union un{
struct s{
int a;
float f;
double d;
}st;
int intArr[10];
}uno;
有人能解释联合类型是如何派生的吗?第一个成员只是联合中最对齐的成员(如果有多个这样的成员,它会任意选择一个),并附加一个i8数组以使其大小正确。最对齐的成员是什么意思?是指其对齐数值大于或等于什么的构件?在下列情况下,什么应该是并集double或int数组并集def{int x[2][2];double d;}中最对齐的成员;