-
Notifications
You must be signed in to change notification settings - Fork 344
[lldb] Use reflection metadata to find the value type of an existential #3508
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] Use reflection metadata to find the value type of an existential #3508
Conversation
Please test with following pull request: @swift-ci test |
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.
This is generally good, just a few stylistic suggestions inside!
lldb::addr_t existential_address; | ||
bool use_local_buffer = false; | ||
|
||
if (in_value.GetValueType() == eValueTypeConstResult && |
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 could do with a few comments explaining what's happening here.
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.
For example, what does use_local_buffer
mean?
if (use_local_buffer) | ||
PopLocalBuffer(); | ||
|
||
if (maybe_is_inlined) { |
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 a bit confusing because maybe_is_inlined is both a bool and an optional and both the value and wrapper behave like a bool, and the "maybe" sounds like it's part of the value rather than the wrapper. How about:
if (!is_inlined.HasValue()) {
// An error occurred, default to address.
return Value::ValueType::LoadAddress;
}
if (*is_inlined) {
// Inlined data, same as static data.
return static_value_type;
}
HasValue makes it more obvious that we are checking the optional container. What do you think?
46fd880
to
83a8378
Compare
Please test with following pull request: @swift-ci test |
@swift-ci test |
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.
Thanks!
No description provided.