It's possible that each LanguageRuntime could have its own DeclVendor,
so let's hoist that out of ObjCLanguageRuntime into LanguageRuntime.
Additionally, this gives the opportunity to remove SBTarget's dependency
on ObjCLanguageRuntime.
Differential D63622
[Target] Hoist LanguageRuntime::GetDeclVendor xiaobai on Jun 20 2019, 1:45 PM. Authored by
Details It's possible that each LanguageRuntime could have its own DeclVendor, Additionally, this gives the opportunity to remove SBTarget's dependency
Diff Detail
Event TimelineComment Actions This change makes it clear that SBTarget::FindFirstType should take a language, but that is orthogonal to this change.
Comment Actions Yep, it definitely should.
Comment Actions The runtime DeclVendor gives runtimes a way to produce type information from runtime metadata. For instance, the ObjC runtime tables actually have fairly good type information for all ObjC classes - both instance variables, properties and methods. It is a little lossy, but for instance it knows the return types of methods so with this augmentation users can call ObjC methods without requiring casting... This is just the code to query the runtime's DeclVendors to see if they know anything about a given typename. ObjC is a bit obnoxious, because you can define instance variables and methods in the implementation of a class as well as its interface. So even though you might have a debug info definition for the type - gotten from including the interface header file - that may not be as good as what you can get from the runtime. But the runtime type info is, as I said, lossy so if you DO have debug info it will be better. That means for ObjC you have to do some kind of merge operation to get the best information for a type. That complexity doesn't affect this patch, but I couldn't resist the opportunity to moan about it a bit since it's given US so much grief over the years!
Comment Actions Thanks for the explanation/background. :)
|
Can this not be const? Seems like retrieving the vendor should not mutate the runtime.