LLVMSwift
                                
                                 LLVMSwift copied to clipboard
                                
                                    LLVMSwift copied to clipboard
                            
                            
                            
                        DIBuilder builds types with wrong size and alignment
All of the buildXXXType methods in DIBuilder use the size of a pointer as a radix:
let radix = UInt32(self.module.dataLayout.intPointerType().width)
...
/* size = */ size.valueInBits(radix: UInt64(radix))
/* alignment = */ alignment.rawValue * radix
Because Size stores sizes in bytes, and that on 64 bit platforms a pointer is 64 bits, instead of emitting a C char as 8 bits, it is emitted as 64 bits, and a 64-bit type is emitted as a 512 bit type.
As LLVM considers 1 byte to always be 8 bits, I don't understand why the size in bytes isn't just multiplied by a constant 8?
I see that in the unit tests an int32_t has an expected size of 512, but clang correctly outputs a size of 32 for it...