Short-circuit GlobalActorAttributeRequest
attempting to get the Source Location of a serialized decl.
#38034
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When querying the attr from a serialized decl, dependning on deserialization order, getting its source-location may launch into arbitrary type-checking when querying interface types of such decls. Which, in turn, may do things like query (to print) USRs. This ends up being prone to request evaluator cycles.
Because this only applies to serialized decls, we can be confident that they already fell through this checking as primaries, so, for now, to avoid cycles, we simply ignore the source location on serialized decls only.
Long-term, we are planning to remove the
merge-modules
jobs, which will help with not having to deal with this scenario.Alternatively, we would need to ensure that at decl deserialization time we cache the
GlobalActorAttributeRequest
when we see this attribute, but this would require further surgery to either serialization format or theGlobalActorAttr
model, because such caching requires access to theDeclID
of the global actor being referenced, which is not currently easily accessible.Resolves rdar://79563942