[Sema] Don't parse skipped bodies when computing discriminators #75421
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.
The refactoring in #68760 accidentally caused us to start parsing skipped function bodies if they have parameters when emitting modules, as the local discriminator request kicks parsing through
getBody()
. Cherry-pick part of 47ff956 which was never landed, ensuring we don't callgetBody
for a skipped function body.This is meant to be a minimal low-risk change that fixes the issue in question, restoring the behavior we had in 5.10 (and currently have in Xcode 16b3). Fixing the parser skipping behavior for
#sourceLocation
will be done in a follow-up. We also ought to see if there's a better way we can enforce that skipped function bodies don't end up getting parsed, for now I've added a test.rdar://131726797
Resolves #74561