-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Michael137
merged 20 commits into
llvm:main
from
Michael137:clang/codegen/isZeroSize-dependency
Jul 16, 2024
Merged
[clang][CGRecordLayout] Remove dependency on isZeroSize #96422
Michael137
merged 20 commits into
llvm:main
from
Michael137:clang/codegen/isZeroSize-dependency
Jul 16, 2024
Commits on Jul 15, 2024
-
[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`.
Configuration menu - View commit details
-
Copy full SHA for 46d1543 - Browse repository at this point
Copy the full SHA 46d1543View commit details -
Configuration menu - View commit details
-
Copy full SHA for 23f298d - Browse repository at this point
Copy the full SHA 23f298dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a24099d - Browse repository at this point
Copy the full SHA a24099dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a008bae - Browse repository at this point
Copy the full SHA a008baeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ea1b50 - Browse repository at this point
Copy the full SHA 7ea1b50View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ef2c88 - Browse repository at this point
Copy the full SHA 0ef2c88View commit details -
fixup! adjust other parts of CodeGen to use isEmptyFieldForLayout/isE…
…mptyRecordForLayout
Configuration menu - View commit details
-
Copy full SHA for 5936851 - Browse repository at this point
Copy the full SHA 5936851View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3afa138 - Browse repository at this point
Copy the full SHA 3afa138View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd38db8 - Browse repository at this point
Copy the full SHA dd38db8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d97ced - Browse repository at this point
Copy the full SHA 2d97cedView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9041aa7 - Browse repository at this point
Copy the full SHA 9041aa7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2097deb - Browse repository at this point
Copy the full SHA 2097debView commit details -
Configuration menu - View commit details
-
Copy full SHA for f6693e4 - Browse repository at this point
Copy the full SHA f6693e4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d22773 - Browse repository at this point
Copy the full SHA 2d22773View commit details -
Configuration menu - View commit details
-
Copy full SHA for f6c64fe - Browse repository at this point
Copy the full SHA f6c64feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e5002d - Browse repository at this point
Copy the full SHA 4e5002dView commit details -
Configuration menu - View commit details
-
Copy full SHA for c7e6468 - Browse repository at this point
Copy the full SHA c7e6468View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5312be4 - Browse repository at this point
Copy the full SHA 5312be4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 02165f5 - Browse repository at this point
Copy the full SHA 02165f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for a4b15f0 - Browse repository at this point
Copy the full SHA a4b15f0View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.