-
Notifications
You must be signed in to change notification settings - Fork 354
[lldb][swift] Fix GetParentIfClosure for Struct/Enum constructors #10922
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
[lldb][swift] Fix GetParentIfClosure for Struct/Enum constructors #10922
Conversation
We had a `class` called `MY_STRUCT`.
|
@swift-ci test please |
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 are two possible variants of constructors: allocating (Kind::Allocator) | |
| /// There are two possible variants of constructors: allocating (Kind::Allocator) |
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.
We already do so many demangle operations when resolving types that I would rather demangle again here rather than hardcode details of the mangling scheme.
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's not so much about demangling again, it's about reconstructing the entire demangle tree.
There is no "node.setKind", we are forced to rebuild everything, and I don't think there are any APIs today to do this
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 I found a way to do it.
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 would write this as
print("break_ctor_enum")
return $0
for more breakpoint stability
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'll update it, but note that this will be different from all other entries in this file.
There are two possible variants of constructors: allocating (Kind::Allocator) and initializing (Kind::Constructor). When mangling a closure, the "context" is arbitrarily chosen to be the initializing variant. As such, we need to check both when looking for the parent of a closure. If both exist, `Kind::Constructor` is the one containing user code, so it is always checked first. rdar://154309468
bc68c1e to
b42c7f0
Compare
|
@swift-ci test |
Uh oh!
There was an error while loading. Please reload this page.