-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Account for whether artificial subclasses are skipped on type caching #68404
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
Conversation
@swift-ci smoke 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.
I wonder if there's any point to making skipArtificialSubclasses
optional. Seems like we should probably just always do it. But that can be a task for another day.
Actually in LLDB there is at least one place where we want to not skip artificial subclasses, since we iterate over a type's superclasses ourselves, and if metadata reader silently skipped over them our results would be off. I do agree that this should've probably be defaulted to true instead of false though. |
@swift-ci smoke test |
MetadataReader caches types only with the metadata address as the key. However a type lookup can be requested skipping artificial subclasses or not. This makes the cached results incorrect if two requests for the same type, but skipping subclasses on one and not on the other, are made. Fix this by adding a second dimension to the cache key. rdar://101519300
64f4854
to
9151305
Compare
@swift-ci smoke test |
/// A cache of built types, keyed by the address of the type and whether the | ||
/// request ignored articial superclasses or not. | ||
std::unordered_map<std::pair<StoredPointer, bool>, BuiltType, | ||
TypeCacheKeyHash> |
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.
Just curious: If we are using the LLVM libraries anyway, why not use a DenseMap?
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.
Looks like we can, I'll change this in a separate patch.
@augusto2112 You will probably also want to cherry-pick this to |
MetadataReader caches types only with the metadata address as the key. However a type lookup can be requested skipping artificial subclasses or not. This makes the cached results incorrect if two requests for the same type, but skipping subclasses on one and not on the other, are made. Fix this by adding a second dimension to the cache key.
rdar://101519300