-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[6.2, SE-0456] enable span properties for the small-String representation #80742
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
Open
glessard
wants to merge
319
commits into
swiftlang:release/6.2
Choose a base branch
from
glessard:rdar137710901-addressable-utf8view-span
base: release/6.2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[6.2, SE-0456] enable span properties for the small-String representation #80742
glessard
wants to merge
319
commits into
swiftlang:release/6.2
from
glessard:rdar137710901-addressable-utf8view-span
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AST/Sema] Add `@extensible` attribute on `enum` declarations
…-generic-parameters Canonicalize different spellings of the same integer generic parameter.
…le-free SILGen: Correct ownership forwarding of `Builtin.emplace`.
…meinout Revert "Add support for inout lifetime dependence"
embedded: fix two problems in the SILLinker
If we're using the macro-specific local discriminator, we need to make sure we avoid mangling the regular local discriminator in `appendDeclName`, since that could prematurely kick local discriminator assignment before type-checking has finished. rdar://143834482
[xcodegen] Print the time taken to generate
Followup fix to swiftlang#80009. We can still get ambiguities from colliding decls across modules with the deserialization filtering. Bring back calling the general lookup shadowing after the filtering. This way it won't use filtered out decls to hide potential candidates. rdar://148286345
…instantiate cyclical metadata. The metadata creation system detects cycles where metadata depends on other metadata which depends on the first one again and raises a fatal error if the cycle can't be fulfilled. Some cycles can be fulfilled. The cycle may involve a requirement for a metadata state less than full transitive completeness which can be reached without resolving the entire cycle. We only want to raise a fatal error when we detect a cycle that can't be fulfilled. Normally this happens because the cycle checking in `blockOnMetadataDependency` only sees a cycle when it can't be fulfilled. Metadata initialization is advanced as far as it can be at each stage, so a cycle that can be fulfilled will see a fulfilling state and won't generate the dependency in the first place, since we only generate dependencies that haven't yet been met. However, when two threads race to create types in a cycle, we can end up with such a dependency, because the dependency may be generated before another thread fulfilled yet. The cycle checker doesn't account for this and incorrectly raises a fatal error in that case. Fix this by checking the cyclic dependency against the metadata's current state. If we have a dependency that's already been fulfilled, then there isn't really a dependency cycle. In that case, don't raise a fatal error. rdar://135036243
This reverts commit 7b03593.
This reverts commit e5c7dfc.
…ch-flag [cxx-interop] Switch to non-experimental flag in tests
…250403/1 [CoroutineAccessors] Use async bit in descriptors.
…windows Tests: Use `#include` instead of `#import` for compatibility on Windows
The `yield_once_2` adds an extra result at the end, the deallocation. Fix the indexing for the token and yielded results.
It was previously erroneously an async function pointer. Also fix the name.
When a C enum has multiple constants with the same value, ClangImporter selects one of them to import as an `EnumElementDecl` and imports the others as `VarDecl` “aliases” of that one. This helps preserve the invariant that each case of an enum has a unique raw value and is distinct for exhaustiveness checking. However, a bug in that logic could sometimes cause the canonical case to be imported *twice*—once as an `EnumElementDecl` and again as a `VarDecl` alias. In this situation, the `EnumElementDecl` was not added to the enum’s member list, resulting in a malformed AST. This bug has apparently been present since early 2017 (!), but it seems to have been harmless until recently, when the `ComputeSideEffects` SIL pass recently became sensitive to it (probably because of either swiftlang#79872 or swiftlang#80263). Correct this problem by modifying the memoization logic to retrieve the canonical case’s clang-side constant so the subsequent check will succeed. Additionally change a variable name and add comments to help clarify this code for future maintainers. In lieu of adding new unit tests, this commit adds a (slightly expensive) conditional assertion to catch this kind of AST malformation. There are actually about twenty tests that will fail with just the assertion and not the fix, but I’ve updated one of them to enable the assertion even in release mode. Fixes rdar://148213237. Followup to swiftlang#80487, which added related assertions to the SIL layer.
Returns true if the conformance is not isolated or if its isolation matches the isolation `inFunction`.
…ad of the module decl NFC
Check the isolation of conformances to avoid wrong folding of dynamic casts rdar://147417762
…type casts rdar://147417762
Just noticed this as I was looking at making other changes.
[Mangler] Avoid mangling local discriminator for attached macros
…rina [NFC] Sema: Factor out some sources into subdirectories
DiagnosticEngine: Support `TypeAttribute` diagnostic arguments
[Runtime] Add function_cast, switch from std::bit_cast.
[Test][Concurrency] Fix isIsolatingCurrentContext tests.
…s-in-prod [cxx-interop] Make safe interop wrapper accessible in production compilers
…ng C++20 rdar://148840350
…cy-for-non-darwin [embedded] Start building Concurrency.swiftmodule/.a for non-Darwin target triples too
LocalVariableUtils: fix data flow propagation of escapes.
Because `TaskAllocator` is not a round multiple of the machine word size on 64-bit platforms, I think we end up with padding before the `TaskLocal::Storage` following it, which makes the `PrivateStorage` structure larger than the calculation in `ABI/Task.h`. rdar://149067144
…ble contexts. Potential unavailability of a declaration has always been diagnosed in contexts that do not have a sufficient platform introduction constraint, even when those contexts are also unavailable on the target platform. This behavior is overly strict, since the potential unavailability will never matter, but it's a longstanding quirk of availability checking. As a result, some source code has been written to work around this quirk by marking declarations as simultaneously unavailable and introduced for a given platform: ``` @available(macOS, unavailable, introduced: 15) func unavailableAndIntroducedInMacOS15() { // ... allowed to call functions introduced in macOS 15. } ``` When availability checking was refactored to be based on a constraint engine in swiftlang#79260, the compiler started effectively treating `@available(macOS, unavailable, introduced: 15)` as just `@available(macOS, unavailable)` because the introduction constraint was treated as lower priority and therefore superseded by the unavailability constraint. This caused a regression for the code that was written to work around the availability checker's strictness. We could try to match the behavior from previous releases, but it's actually tricky to match the behavior well enough in the new availability checking architecture to fully fix source compatibility. Consequently, it seems like the best fix is actually to address this long standing issue and stop diagnosing potential unavailability in unavailable contexts. The main risk of this approach is source compatibility for regions of unavailable code. It's theoretically possible that restricting available declarations by introduction version in unavailable contexts is important to prevent ambiguities during overload resolution in some codebases. If we find that is a problem that is too prevalent, we may have to take a different approach. Resolves rdar://147945883.
Wasm is not an acronym, thus it's not uppercased [per the spec](https://webassembly.github.io/spec/core/intro/introduction.html#wasm).
…-cxx20 [cxx-interop] Add a test for interface generation of a module requiring C++20
When DCE deletes instructions as dead, if the instruction ends one of its operands lifetimes, it must insert a compensating lifetime end. When the def block of the value and the parent block of the instruction are different, it uses lifetime completion. Lifetime completion relies on complete liveness, which doesn't and can't exist for values with pointer escapes. The result is ending lifetimes too early. Avoid this scenario by marking such instructions live. In the fullness of time, it may be possible to track the deleted instruction's "location" even in the face of deletions of adjacent instructions and parent blocks and to insert the lifetime end at that location. rdar://149007151
Add support for UTF8Span Also, refactor validation and grapheme breaking
When the output is directly redirected, the output is re-encoded. This is particularly important as `Write-PList` uses `Invoke-Program` to invoke `python.exe` to write the plist. However, because it is writing to a file, while the output from Python is in UTF-8, the redirection re-encodes the output to UTF16LE (BOM). Adjust the invocation to use PS7+ `2|` and pipe both stdout and stderr as appropriate into files with UTF-8 encoding restoring the encoding for the file.
…dy-disabled [CSStep] Overload pruning should skip previously disabled choices
…oduced AST: Stop diagnosing potentially unavailable declarations in unavailable contexts
Handle a special case of borrowed from instruction in CopyToBorrowOptimization
utils: avoid redirection and use pipes for output redirection
[Concurrency] Fix size of AsyncTask::PrivateStorage.
[DCE] Don't delete instructions which consume escaping values.
This reverts commit ea44ff9.
- The move-only checker has issues with the existence of autoclosures. - These `borrowing` accessors are within the purview of the move-only checker.
501e3c7
to
ee50c3e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Enables the small-string code path for the
UTF8View.span
properties. This completes SE-0456.Addresses rdar://147500261
This is a cherry-pick of #80684