-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Debug info] Retain all type aliases in asttypes mode #78901
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
@swift-ci test |
7a69490
to
fab120c
Compare
@swift-ci test |
// mode, so we need to artificially keep typealiases alive, since they can | ||
// appear in reflection metadata. | ||
if (Opts.DebugInfoLevel < IRGenDebugInfoLevel::DwarfTypes) | ||
DBuilder.retainType(TypeDef); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought retainType
would retain the type in the IR but not in DWARF, am I wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, does dsymutil keep them too? I think maybe that's what I was remembering. LGTM if yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not, that's a great point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a better solution that builds on top of #78965.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if dsymutil keeps the retained types.
This cleanup allows for more consistent debug info emission since we depend less on IRGen magic to emit debug info for types.
fab120c
to
057ccfe
Compare
@swift-ci test |
…ST types This ensures that debug info for these types is emitted even if this is the only way they are references in the input program. rdar://143595521
057ccfe
to
f213289
Compare
@swift-ci test |
Bound generic types don't reference their type parameters in ASTTypes mode, so we need to artificially keep typealiases alive, since they can appear in reflection metadata.
rdar://143595521