-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Store the type parameters of bound generics in the debug info. #31118
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
Store the type parameters of bound generics in the debug info. #31118
Conversation
@swift-ci test |
Build failed |
Build failed |
@swift-ci test |
Build failed |
Build failed |
assert(!DbgTy.isContextArchetype() && "type metadata cannot contain an archetype"); | ||
return DbgTy; | ||
} | ||
|
||
DebugTypeInfo DebugTypeInfo::getForwardDecl(swift::Type Ty) { | ||
DebugTypeInfo DbgTy(Ty.getPointer(), nullptr, {}, Alignment(1), true, |
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.
Wdyt of making StorageType
private in DebugTypeInfo and add a getter for it? This could assert if the field is null and the size is known?
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.
Done in the second commit.
This is needed to anchor any typedefs that appear in bound generic parameters so they can be resolved in the typeref-based part of the debugger without needing to query the Swift module.
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 think this is fine, if Vedant is happy with it.
68d52af
to
8ef2178
Compare
@swift-ci test |
Build failed |
Build failed |
LGTM! I hear from Mishal that CI is having some trouble today though.. |
@swift-ci smoke test |
1 similar comment
@swift-ci smoke test |
@swift-ci test |
Build failed |
@swift-ci smoke test |
TemplateParams.push_back(DBuilder.createTemplateTypeParameter( | ||
TheCU, "", getOrCreateType(DebugTypeInfo::getForwardDecl(Param)))); |
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.
On master-next
createTemplateTypeParameter
has a fourth parameter IsDefault
(added in https://reviews.llvm.org/D73462 / swiftlang/llvm-project@7a42bab).
What's the right value to pass there to fix the master-next
build?
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.
false
. Sorry!
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.
No worries. Thanks for the confirmation. :-)
This is needed to anchor any type aliases that appear in bound generic parameters in the debug info so they can be resolved in the typeref-based part of the debugger without needing to query the Swift module.
This fixes the TestSwiftBridgedArray.py test in swiftlang/llvm-project#1090.