OCHyams wrote:

Breaking out of the inline comments - I've realised this patch doesn't always 
give us the expected `byte_size`. E.g. For `_BitInt(23)` GCC gives us:

```
0x000000a1:   DW_TAG_base_type
                DW_AT_byte_size (0x04)
                DW_AT_encoding  (DW_ATE_signed)
                DW_AT_bit_size  (0x17)
                DW_AT_name      ("_BitInt(23)")
```

Whereas this patch gives us:
```
0x00000042:   DW_TAG_base_type
                DW_AT_name      ("_BitInt")
                DW_AT_encoding  (DW_ATE_signed)
                DW_AT_byte_size (0x03)
                DW_AT_bit_size  (0x17)
```
Notice Clang says it's 3 bytes (because it's just finding the next byte size 
that 0x17 bits fits into) whereas GCC says it's 4 bytes (which reflects the 
`sizeof` size).

It's probably cleanest to pass both byte_size and bit_size down from the front 
end. I'll have a go at that later/tomorrow if others agree.

https://github.com/llvm/llvm-project/pull/164372
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to