Skip to content

DebugInfo: emit DW_AT_alignment for all types. #38357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dimitry- mannequin opened this issue Sep 19, 2018 · 3 comments
Open

DebugInfo: emit DW_AT_alignment for all types. #38357

dimitry- mannequin opened this issue Sep 19, 2018 · 3 comments
Labels
bugzilla Issues migrated from bugzilla debuginfo

Comments

@dimitry-
Copy link
Mannequin

dimitry- mannequin commented Sep 19, 2018

Bugzilla Link 39009
Version unspecified
OS All
CC @dwblaikie

Extended Description

DWARF5 introduced DW_AT_alignment attribute.

As far as I can see this is currently mostly unused by clang/llvm. It would be helpful to have this attribute emitted for all base types as well as structure/union/class types.

@dwblaikie
Copy link
Collaborator

Worth measuring the impact - I'd expect to only put alignment on types that have non-standard alignment (ones where the user has specified a custom different alignment - like LLVM's habit of overaligning data structures so it can use low bits in pointers for other things).

If the impact is low enough to put it everywhere, I guess that'd be OK and save consumers from having to compute the alignment in many complex cases.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@llvmbot
Copy link
Member

llvmbot commented Jul 5, 2024

@llvm/issue-subscribers-debuginfo

Author: None (c1ed623a-df99-497b-81ca-bca6dae737a4)

| | | | --- | --- | | Bugzilla Link | [39009](https://llvm.org/bz39009) | | Version | unspecified | | OS | All | | CC | @dwblaikie |

Extended Description

DWARF5 introduced DW_AT_alignment attribute.

As far as I can see this is currently mostly unused by clang/llvm. It would be helpful to have this attribute emitted for all base types as well as structure/union/class types.

@Michael137
Copy link
Member

Michael137 commented Jul 5, 2024

The scope of when this attribute is to be emitted was narrowed in https://reviews.llvm.org/D24426

Discussions where this came up in LLDB:

But in both cases the solution was for LLDB to be less fragile against lack of alignment information.

(FWIW, GCC doesn't do this either last time I checked)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla debuginfo
Projects
None yet
Development

No branches or pull requests

4 participants