LLVM lowerDebugType: Lower union types without a layout into an empty namespace - #19182
Merged
Conversation
Contributor
|
Nice! A test would be neat, maybe the one from #19145 could be added here (if it's valid)? |
antlilja
force-pushed
the
llvm-unresolved-union
branch
from
March 5, 2024 12:58
dc6abbf to
1179575
Compare
Contributor
Author
|
Good point, I've added a test case |
antlilja
force-pushed
the
llvm-unresolved-union
branch
from
March 14, 2024 12:31
1179575 to
a70aa53
Compare
Vexu
approved these changes
Mar 14, 2024
Vexu
left a comment
Member
There was a problem hiding this comment.
Did the test from the previous pr not cause a crash without this fix or why did you change it into a check output test?
Contributor
Author
I think it did cause a crash. I moved it as it didn't seem like a union behavior test. But maybe I'm misinterpreting how the tests are organized and the use of the term "behavior". |
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.
Fixes #18518
I think the bug is actually in the llvm backend and not the frontend as the union type actually isn't used at runtime, only the field type is referenced and thus the union does not get a layout. The fix implemented here just emits an empty namespace as a debug type for unions without layout. I don't think this fix should have any real consequences on the debugability of programs as there won't ever be values with that debug type.