Skip to content

Support statically initializing globals which are or contain inline arrays #79298

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
merged 3 commits into from
Feb 13, 2025

Conversation

eeckstein
Copy link
Contributor

@eeckstein eeckstein commented Feb 11, 2025

For example:

struct S {
  static let slab: InlineArray = [1, 2, 3, 4]
}

rdar://143005996

@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein requested review from kubamracek and Azoy and removed request for rjmccall February 11, 2025 18:56
@eeckstein eeckstein force-pushed the static-init-inline-arrays branch from 12d9cd4 to e802649 Compare February 11, 2025 20:50
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein force-pushed the static-init-inline-arrays branch from e802649 to bf1fb14 Compare February 12, 2025 06:37
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test macos

@eeckstein
Copy link
Contributor Author

@swift-ci test macos

@eeckstein eeckstein force-pushed the static-init-inline-arrays branch from bf1fb14 to df06025 Compare February 12, 2025 16:12
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@rauhul
Copy link
Member

rauhul commented Feb 12, 2025

Note: Waiting for #79294 to be merged first

…bal initializer

So far it was only possible that `vector` is the top-level instruction in an initializer.
…h are or contain inline arrays

For example:

```
struct S {
  static let slab: Slab = [1, 2, 3, 4]
}
```

rdar://143005996
@eeckstein eeckstein force-pushed the static-init-inline-arrays branch from df06025 to 57a236e Compare February 12, 2025 21:38
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test linux

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test windows

@eeckstein eeckstein enabled auto-merge February 13, 2025 06:01
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test linux

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test windows

@eeckstein eeckstein merged commit 48a4013 into swiftlang:main Feb 13, 2025
3 checks passed
@eeckstein eeckstein deleted the static-init-inline-arrays branch February 13, 2025 16:06
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