Introduce a macro that can stamp out wrapper
classes for underlying C++ pointers, and use
it to define BridgedDiagnosticEngine in
ASTBridging. Then, migrate users of
BridgedDiagEngine onto it.
For nullable nodes, introduce both a non-null and
nullable variant of the bridging wrapper. This
allows us to annotate the necessary parameters
as nullable, but keep the returns of the bridged
`createParsed` methods non-null.
Always null-terminate `BridgedString` by `allocateBridgedString()`.
It had `nullTerminated: Bool` option, but allocating one extra byte
doesn't harm anything. Always null-terminate the string just for
client's convenience.
rdar://117205829
Instead of emitting an warning to the diagnostic engine, return the
plugin loading error as the result of the request. So that the user
can decide to emit it as a warning or an error.
* BridgedString for ASTGen -> C++ string returnings
* Null terminated C-strings for C++ -> ASTGen string arguments
* UnsafeMutableRawPointer for C++ -> ASTGen diagnostic engine arguments
For whatever reason, using standard headers in modules imported from
Swift code (i.e. depending on Darwin overlay) is no longer an issue.
rdar://115438609
Parse typed throw specifiers as `throws(X)` in every place where there
are effects specified, and record the resulting thrown error type in
the AST except the type system. This includes:
* `FunctionTypeRepr`, for the parsed representation of types
* `AbstractFunctionDecl`, for various function-like declarations
* `ClosureExpr`, for closures
* `ArrowExpr`, for parsing of types within expression context
This also introduces some serialization logic for the thrown error
type of function-like declarations, along with an API to extract the
thrown interface type from one of those declarations, although right
now it will either be `Error` or empty.
Use FetchContent to include swift-syntax directly in swift. This can be
thought of as an `add_subdirectory` for a directory outside the root.
The default build directory will be `_deps/swiftsyntax-subbuild/`, though
the modules and shared libraries will be built in `lib/swift/host` by
passing down `SWIFT_HOST_LIBRARIES_DEST_DIR` to avoid copying them as we
were doing previously.