[lldb] Don't invent an alignment if not encoded - #13566
Open
augusto2112 wants to merge 2 commits into
Open
Conversation
augusto2112
force-pushed
the
embed-multipayload-enum-alignment
branch
from
July 29, 2026 20:43
902841c to
e33db20
Compare
Author
The compiler only emits non-standard alignments into DWARF. RemoteMirror's TypeLowering knows how to calculate an enum's alignment from its payloads. If we don't know the type's alignment, let it do it. Assisted-by: Claude
augusto2112
force-pushed
the
embed-multipayload-enum-alignment
branch
from
July 30, 2026 01:02
e33db20 to
c41d460
Compare
Author
|
@swift-ci test |
Author
| // in DWARF? That's what reflection metadata does. | ||
| unsigned stride = ((byte_size + alignment - 1) & ~(alignment - 1)); | ||
| // If the alignment is unknown, so is the stride. | ||
| unsigned stride = alignment ? llvm::alignTo(byte_size, alignment) : 0; |
There was a problem hiding this comment.
Still confused by the logic here:
- on 603 we do
byte_size?:8but not on 606. I guess becuase 0 is still a valid value - what's the semantics of
alignTo(0, x)?
I think this all gets clearer if you have an if (byte_size == 0) block that handles that case separately?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The compiler only emits non-standard alignments into DWARF. RemoteMirror's TypeLowering knows how to calculate an enum's alignment from its payloads. If we don't know the type's alignment, let it do it.
Assisted-by: Claude