Generate all entries, and ensure we introduce a
PatternBindingInitializer context for non-local
cases. Also use this opportunity to cleanup
`PatternBindingDecl::create`.
Follow the feature flag convention for capitalization and be
consistent with the related NoncopyableGenerics feature.
This is a new feature that no wild Swift code has used it yet:
commit e99ce1cc5d
Author: Kavon Farvardin <kfarvardin@apple.com>
Date: Tue Dec 5 23:25:09 2023
[NCGenerics] add `~Escapable`
Basic implementation of `~Escapable` in the type system.
We need a `SourceLocationConverter` every time we create a `PluginMessage.Syntax` to know the source location of that syntax node within the source file. This means that we needed to re-build the line table of the entire source file multiple times for every macro that we expand. Cache it to improve performance.
rdar://119047550
Refactor `addSyntacticRenameRanges`, adding comments to make it easier to follow and remove its dependency on the `IsFunctionLike` parameter in `RenameLoc`.
`llvm::None` is deprecated, but still being used in Swift until we have
fewer 5.10 cherry-picks. Add the `SWIFT_TARGET` definition to ignore the
deprecation.
* Remove 'public' from the functions, those werr remnants of when
ASTGenVisitor conformed to SyntaxTransformVisitor.
* Remove an unreachable `default:` from a switch.
* Remove unused `UnsafePointer.raw`.
`TokenSyntax.text` causes intiation of heap allocated `Swift.String` for
each access. `TokenSyntax.rawText` is faster than that because it's just
a reference to the pre-allocated buffer. Also, converting to
`BridgedString` is simplar, and guaranteed to be free, unlike bridging
via `String.withUTF8(_:)`
Declare `BridgedNullable` protocol for `ExpressibleByNilLiteral`.
Simplify `HasNullable` implementation using `BridgedNullable`, and
rename it to `BridgedHasNullable`.
Function body macros allow one to introduce a function body for a
particular function, either providing a body for a function that
doesn't have one, or wholesale replacing the body of a function that
was written with a new one.
This was causing build issues on Linux with Swift 5.8. Instead, wrap the `std::vector` in a `BridgedResolvedLocVector` that has a pointer to a heap-allocated `std::vector`
ASTGen always builds with the host Swift compiler, without requiring
bootstrapping, and is enabled in more places. Move the regex literal
parsing logic there so it is enabled in more host environments, and
makes use of CMake's Swift support. Enable all of the regex literal
tests when ASTGen is built, to ensure everything is working.
Remove the "AST" and "Parse" Swift modules from SwiftCompilerSources,
because they are no longer needed.
Defining `generate(_: XXXSyntax?) -> BridgedXXX` for each node kind is too
much boilerplate.
self.generate(optional: optionalXXXNode).asNullable
is now:
self.map(optionalXXXNode, generate(xxx:))