-
Notifications
You must be signed in to change notification settings - Fork 353
[DRAFT] [LLDB] Add ObjC object typeref support to SwiftRuntimeTypeVisitor #11929
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
base: swift/release/6.3
Are you sure you want to change the base?
Conversation
0e52023 to
646d2f3
Compare
|
@swift-ci test |
646d2f3 to
29e2381
Compare
|
Updated the test, the previous one didn't actually exercise the new code m-( |
|
@swift-ci test |
This patch moves the disjunct implementations for TypeSystemTypeRef::GetNumFields and GetIndexOfChildMemberWithName into the TypeRef visitor, so they behave consistently. rdar://154450536
29e2381 to
072a092
Compare
|
|
||
| ExecutionContext exe_ctx(valobj.GetExecutionContextRef()); | ||
| if (is_imported && type.GetNumFields(&exe_ctx) == 0) | ||
| CompilerType clang_type; |
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.
You can move this to under the early return
| type.GetTypeSystem().dyn_cast_or_null<TypeSystemSwift>(); | ||
| if (ts && | ||
| ts->IsImportedType(type.GetOpaqueQualType(), &clang_type)) | ||
| is_imported = 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.
if (!ts)
return false
CompilerType clang_type;
bool is_imported = ts->IsImportedType(type.GetOpaqueQualType(), &clang_type);
| g_formatters.push_back( | ||
| [](lldb_private::ValueObject &valobj, lldb::DynamicValueType dyn_type, | ||
| FormatManager &format_manager) -> lldb::SyntheticChildrenSP { | ||
| struct IsEligible { |
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 know this isn't your code, but it's hard to understand what "IsEligible" is checking for. Could you comment this function, either on top or inside it explaining what the eligibility criteria are?
Also, this structure with static function could be replaced by a lambda.
This is done by defering to the Objective-C runtime. This functionality is implemented in the visitor because ObjC object typerefs are fully valid reference types in the Swift reflection descriptors already and only LLDB wants to look inside them.
rdar://154450536