-
Notifications
You must be signed in to change notification settings - Fork 330
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] Adjust module name for types with @_originallyDefinedIn #9401
base: stable/20240723
Are you sure you want to change the base?
Conversation
The compiler generates types with @_originallyDefinedIn as a child of the original module, but with the ABI module in the mangled name. Before looking up types in reflection metadata, adjust the type's mangled name to use the original module name, since that's what's stored in reflection metadata. rdar://137146961
// Find the type's module node. | ||
while (child && child->getKind() != Node::Kind::Module && | ||
child->hasChildren()) { | ||
parent = child; | ||
child = child->getFirstChild(); | ||
} |
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.
what about a concrete generic type, would its type parameters need to have their modules replaced?
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.
Yeah you're right, this won't work if the type parameters are annotated with originallyDefinedIn
ts->GetTypeSystemSwiftTypeRef().GetCachedType(type.GetMangledTypeName()); | ||
|
||
if (!lldb_type) { | ||
LLDB_LOGV(GetLog(LLDBLog::Types), |
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 log is verbose but the following ones are not. Should this be non-verbose?
let a = A() | ||
let b = Alias() | ||
let d = C.D() | ||
let e = E<Prop>.t(Prop()) |
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.
re my comment about concrete generic types, could you add one ore more generic variables? Ex:
let f: A? = A()
let g = [A()]
let h: E<A> .t(A())
The compiler generates types with @_originallyDefinedIn as a child of the original module, but with the ABI module in the mangled name. Before looking up types in reflection metadata, adjust the type's mangled name to use the original module name, since that's what's stored in reflection metadata.
rdar://137146961