Skip to content
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

[clang][CGRecordLayout] Remove dependency on isZeroSize #96422

Merged
merged 20 commits into from
Jul 16, 2024

Commits on Jul 15, 2024

  1. [clang][CGRecordLayout] Remove dependency on isZeroSize

    This is a follow-up from the conversation starting at
    llvm#93809 (comment)
    
    The root problem that motivated the change are external AST
    sources that compute `ASTRecordLayout`s themselves instead of
    letting Clang compute them from the AST. One such examples is
    LLDB using DWARF to get the definitive offsets and sizes of C++
    structures. Such layouts should be considered correct (modulo
    buggy DWARF), but various assertions and lowering logic around
    the `CGRecordLayoutBuilder` relies on the AST having
    `[[no_unique_address]]` attached to them. This is a layout-altering
    attribute which is not encoded in DWARF. This causes us LLDB to trip
    over the various LLVM<->Clang layout consistency checks. There has been
    precedent for avoiding such layout-altering attributes to affect
    lowering with externally-provided layouts (e.g., packed structs).
    
    This patch proposes to replace the `isZeroSize` checks in
    `CGRecordLayoutBuilder` (which roughly means "empty field
    with [[no_unique_address]]") with checks for
    `CodeGen::isEmptyField`/`CodeGen::isEmptyRecord`.
    Michael137 committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    46d1543 View commit details
    Browse the repository at this point in the history
  2. fixup! add missing header

    Michael137 committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    23f298d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a24099d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a008bae View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7ea1b50 View commit details
    Browse the repository at this point in the history
  6. fixup! clang-format

    Michael137 committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    0ef2c88 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5936851 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3afa138 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    dd38db8 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2d97ced View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9041aa7 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2097deb View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    f6693e4 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    2d22773 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    f6c64fe View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    4e5002d View commit details
    Browse the repository at this point in the history
  17. fixup! add missing test

    Michael137 committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    c7e6468 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    5312be4 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    02165f5 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    a4b15f0 View commit details
    Browse the repository at this point in the history