Structure Alignment

struct xfirstStru
{
    int var1;
    double var2;
    int var3;
    char *var4;
};
%FIRSTSTRU_PLUSPLUS_TOTVS. = type { i32, double, i32, i8* }

Hi,

I had not applied the layout at run time, only during the emission of the .bc.
Now it's running ok when I allocate the structure point at LLVM side, but, when I allocate the structure pointer in the C side, the LLVM function does not acquire the double value correctly.
Manoel Teixeira

Hello,

I had not applied the layout at run time, only during the emission of the .bc.
Now it's running ok when I allocate the structure point at LLVM side, but, when
I allocate the structure pointer in the C side,
the LLVM function does not acquire the double value correctly.

LLVM has no idea about any weird requirements of struct fields padding /
alignment. You have to insert necessary padding fields by yourself (as
all frontends do).