-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[rebranch] Manually merge main to rebranch #75727
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
bnbarham
merged 55 commits into
swiftlang:rebranch
from
bnbarham:manually-merge-main-to-rebranch
Aug 6, 2024
Merged
[rebranch] Manually merge main to rebranch #75727
bnbarham
merged 55 commits into
swiftlang:rebranch
from
bnbarham:manually-merge-main-to-rebranch
Aug 6, 2024
Conversation
This file contains hidden or 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
This concrete implementation of the BuildConfiguration allows the use of the SwiftIfConfig library's APIs where the build configuration comes from the compiler itself.
The SwiftIfConfig library provides APIs for evaluating and extracting the active #if regions in source code. Use its "configured regions" API along with the ASTContext-backed build configuration to reimplement the extraction of active/inactive regions from the source. This approach has the benefit of being effectively stateless: where the existing solution relies on the C++ parser recording all of the `#if` clauses it sees as it is parsing (and then might have to sort them later), this version does a scan of source to collect the list without requiring any other state. The newer implementation is also conceptually cleaner, and can be shared with other clients that have their own take on the build configuration. The primary client of this information is the SourceKit request that identifies "inactive" regions within the source file, which IDEs can use to grey out inactive code within the current build configuration. There is also some profiling information that uses it. Those clients should be unaffected by this under-the-hood change. For the moment, I'm leaving the old code path in place for compiler builds that don't have swift-syntax. This should be considered temporary, and that code should be removed in favor of request'ifying this function and removing the incrementally-built state entirely.
…SwiftIfConfig The SIL coverage map generation depends on the locations of the `#endif` directives, but the mapping from SwiftIfConfig's configured regions wasn't producing them. The information is implicitly available in the SwiftIfConfig configured regions, so reconstitute it as we translate regions.
This implementation depends on ASTGen, which isn't linked as part of the AST library.
…d is enabled This warning is designed to be an early report of name conflicts in swiftinterfaces caused by a type having the same name as a module. Make sure we silence this warning when the workaround -alias-module-names-in-module-interface is enabled. This is what we already do for -module-interface-preserve-types-as-written. rdar://132990400
…equest` This is always `false`.
We already maintain a stack of parent expressions which is sufficient.
This is no longer needed now that we fold SequenceExpr during the pre-walk.
We only need to consider the ExprPattern case here, everything else should be skipped.
And use it for walking the SyntacticElementTarget such that patterns for uninitialized vars are walked too.
Use `preCheckTarget` to pre-check the body, allowing us to replace `PreCheckResultBuilderRequest` with a request that only checks the brace for ReturnStmts.
…dConfiguration Unlike all of the other build configuration checks, `canImport` has side effects including the emission of various diagnostics. Thread a source location through here so the diagnostics end up on the right line.
No intended behavior change.
Fixes: third_party/swift/include/swift/Demangling/Demangler.h:228:11: error: declaration of ‘swift::Demangle::NodeFactory::Slab* swift::Demangle::NodeFactory::Checkpoint::Slab’ changes meaning of ‘Slab’ [-fpermissive] 228 | Slab *Slab; | ^~~~ third_party/swift/include/swift/Demangling/Demangler.h:47:10: note: ‘Slab’ declared here as ‘struct swift::Demangle::NodeFactory::Slab’ 47 | struct Slab { | ^~~~ No intended behavior change.
Embedded Swift has a minimal runtime, some type metadata is not available. This patch works around a crash that tries to emit C++ briding to this non-existent Swift metadata. It is very likely that there will be more fallout in reverse interop, but this patch should fix the most glaring issue, crashing on an empty Embedded Swift project. rdar://129030521
We don't have to take deinit effects into acount for a `destroy_value [dead_end]`. Such destroys are lowered to no-ops and will not call any deinit.
A small refactoring. NFC
Handle `apply` and `try_apply`. Also, improve test cases
…s base Makes e.g. alias analysis more precise in the early stage of the pass pipeline where addressor calls are not inlined, yet.
wording. Splitting up the diagnostic into separate diagnostics based on the reference kind is easier for me to read. The wording of the error message now puts the problem -- crossing an isolation boundary -- at the center of the message, and attempts to clarify how the value crosses an isolation boundary. E.g. for the witness diagnostics, the value crosses an isolation boundary when calling the witness through the protocol requirement in generic code. This change does not add any additional information to the diagnostics, but it'd be valuable to show both the source and destination isolation.
[cxx-interop] Fix crash with reverse interop in Embedded Swift
In anticipation of adding a new kind of missing import record to `SourceFile`, clarify the purpose of the existing "missing imports" record with more specific naming and documentation.
This will make it possible to use type checking APIs to determine the appropriate access level for suggested imports. NFC.
Expose a ImportPrivateDependencies LangOpt for LLDB (NFC).
…ovements Optimizer: some improvements for alias analysis in several utilities
…d-configuration
[Sema] A couple of pre-checking cleanups
…-note [Concurrency] Emit a better note when an isolated stored property initializer cannot be used.
Test: try to re-enable
…o-rebranch Conflicts: - `lib/PrintAsClang/PrintSwiftToClangCoreScaffold.cpp` not positive what the cause here was, just took main.
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.
Conflicts:
lib/PrintAsClang/PrintSwiftToClangCoreScaffold.cpp
not positive what the cause here was, just took main.