Skip to content

[cherry-pick][stable/20230725] [clang][ASTImporter] Only reorder fields of RecordDecls #7945

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

Conversation

Michael137
Copy link

Prior to e9536698720ec524cc8b72599363622bc1a31558 (https://reviews.llvm.org/D154764) we only re-ordered the fields of RecordDecls. The change refactored this logic to make sure FieldDecls are imported before other member decls. However, this change also widened the types of DeclContexts we consider for re-ordering from RecordDecl to anything that's a DeclContext. This seems to have been just a drive-by cleanup.

Internally we've seen numerous crashes in LLDB where we try to perform this re-ordering on fields of ObjCInterfaceDecls.

This patch restores old behaviour where we limit the re-ordering to just RecordDecls.

rdar://119343184
rdar://119636274
rdar://119832131

…rect layout"

This relands e953669, because
a follow-up fix (f8e2effc3aff8077ad301a5a3956c514a2e604a9) will
be cherry-picked that fixes the issue that motivated the original
revert.
Prior to `e9536698720ec524cc8b72599363622bc1a31558`
(https://reviews.llvm.org/D154764) we only re-ordered the fields of
`RecordDecl`s. The change refactored this logic to make sure
`FieldDecl`s are imported before other member decls. However, this
change also widened the types of `DeclContext`s we consider for
re-ordering from `RecordDecl` to anything that's a `DeclContext`. This
seems to have been just a drive-by cleanup.

Internally we've seen numerous crashes in LLDB where we try to perform
this re-ordering on fields of `ObjCInterfaceDecl`s.

This patch restores old behaviour where we limit the re-ordering to just
`RecordDecl`s.

rdar://119343184
rdar://119636274
rdar://119832131
(cherry picked from commit 34dbadd)
@Michael137
Copy link
Author

@swift-ci test

@Michael137 Michael137 merged commit 8f2c0c3 into swiftlang:stable/20230725 Jan 9, 2024
@Michael137 Michael137 deleted the bugfix/astimporter-field-order-fix-to-20230725 branch January 9, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants