llvm-swift / LLVMSwift

A Swift wrapper for the LLVM C API (version 11.0)
MIT License
744 stars 55 forks source link

Fix wrong type sizes in DIBuilder #241

Closed Snowy1803 closed 1 year ago

Snowy1803 commented 1 year ago

I don't understand why radix was used in DIBuilder. One byte is always 8 bits, and LLVM already assumes that, so there is no point in making it variable. And there definitely isn't 64 bits in a byte (the width of an intptr). This means the width of types was 8 times larger than they should be: an int32_t was considered 256 bits instead of 32 bits (cf the unit tests, where its size was also erroneously set to 8 bytes).

Fixes #239