Skip to content

[6.2] RemoteInspection: Support for parameter packs #81379

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

Merged

Conversation

slavapestov
Copy link
Contributor

6.2 cherry-pick of #81299.

  • Description: Remote mirrors did not support types containing parameter packs. Add that support.

  • Scope of the issue: This meant that parameter packs defeat lldb's remote mirrors-based code path, forcing the ASTContext to be loaded. This should no longer be necessary.

  • Risk: There is a bunch of new code, and it might have bugs in it. However this doesn't change behavior of existing code.

  • Reviewed by: @adrian-prantl

@slavapestov slavapestov requested a review from a team as a code owner May 8, 2025 20:12
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

Fn handleComponent) {
// Substitute the shape using the baseline substitutions, not the
// current elementwise projections.
auto *substShape = origExpansion->getCount()->subst(Builder, Substitutions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this fail; do we need to nullptr-check the result of GetCount()?

Copy link
Contributor Author

@slavapestov slavapestov May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We assume throughout that the components of a TypeRef are themselves not null. This is an invariant at construction time. If we decide to add null checks, they would have to be scattered throughout the code on every call to a get*() method on TypeRef. I'd rather not do that.


auto *substPackShape = dyn_cast<PackTypeRef>(substShape);
if (!substPackShape) {
DEBUG_LOG(fprintf(stderr, "Replacement for pack must be another pack"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[We really should upgrade this library to llvm::Expected<> at some point]

@slavapestov slavapestov force-pushed the remote-mirrors-meet-packs-6.2 branch from 3263d13 to 8744493 Compare May 9, 2025 18:50
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit 8c2ee95 into swiftlang:release/6.2 May 10, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants