Closed
Description
For example, we set size_in_bits on a bool to 1. But then later when making an array type we use this value and multiply by the array size. Is that right?
On structs when making the member debug type we set the alignment of members and calculate the offset in bits to each member. Are we doing it right?
We also set the alignment for structs and have the option to set alignment on local variables and parameters, and more.
Related, figure out exactly what is the difference between packed structs and normal structs. Will LLVM re-order fields to improve alignment? Or is that our job? If LLVM does it, how do we know which values to give to the debug info? If we do it then we need to add that to codegen.
- audit alignment of struct themselves, as well as fields within the struct
- audit alignment of parameters to functions
- audit alignment of local variable allocations, and of loads and stores. look at the llvm api what instructions take alignment parameters, and use clang to generate C code to make sure we're doing it correctly.
- search the lang ref for "align" and make sure we're setting the alignment of all the instructions that take alignment as an argument