When the frontend option `-abi-comments-in-module-interface` is provided
during interface printing, the printed interface will contain
additional comments that provide the mangled names for public symbols.
This is an experiment in seeing how much information we can
meaningfully extract from a printed Swift interface for the purpose of
bridging with other languages.
When we print types in the AST printer if for some reason we cannot find the
appropriate type to print or if the user explicitly asks, we fall back and use a
type repr instead.
This behavior causes a problem due to the implementation of sending results
using a sending type repr to communicate that the relevant function has a
sending result, but we actually do not use the sending type repr from that point
on. So as a result, in this fallback case, we put in one too many sending on the
result.
rdar://135594964
The option to print #ifs defaulted to "on", but was disabled in most of
the actual compiler inputs that mattered, and the results weren't ever
actually used. Remove the option so we never print #ifs.
`visitBinaryExpr` wasn't handling `UnresolvedDeclRefExpr` nodes, which the
synthesized `==` implementation uses to compare fields/payloads. Also fixed
the test that wasn't catching it since it also left out the operators.
Previously, the opaque types in patterns were printed using their full stable
reference which cannot be resolved when parsing a swiftinterface.
Resolves rdar://127771885.
Some requirement machine work
Rename requirement to Value
Rename more things to Value
Fix integer checking for requirement
some docs and parser changes
Minor fixes
Replace the existing C++ implementation of extractInlinableText with
a new implementation based on swift-syntax. It uses SwiftIfConfig to
remove inactive regions (with a special mode), and a new compiler-only
entrypoint in the library to remove comments and `#sourceLocation`.
Allow any declaration to be marked with `@unsafe`, meaning that it
involves unsafe code. This also extends to C declarations marked with
the `swift_attr("unsafe")` attribute.
Under a separate experimental flag (`DisallowUnsafe`), diagnose any
attempt to use an `@unsafe` declaration or any unsafe language feature
(such as `unowned(unsafe)`, `@unchecked Sendable`). This begins to
define a "safe" mode in Swift that prohibits memory-unsafe constructs.