De-duplicate TypeCheckingFlags, TypeChecker's Options, and the TypeChecker-Oriented FrontendOptions into a dedicated TypeCheckerOptions type. This moves a bunch of configuration state out of the type checker and into the ASTContext where it belongs.
Diagnose ephemeral conversions that are passed to @_nonEphemeral
parameters. Currently, this defaults to a warning with a frontend flag
to upgrade to an error. Hopefully this will become an error by default
in a future language version.
This flag will enable all experimental differentiable programming features.
The default will be `true` on tensorflow branch but `false` on master branch.
Features will first be updated on tensorflow branch to use this flag, before
being upstreamed to master. The goal is to achieve a minimal code diff between
the two branches.
The [TF-820](https://bugs.swift.org/browse/TF-820) master issue tracks upstreaming differentiable programming.
---
Rationale: we chose to add a frontend flag rather than a `build-script`/CMake flag for easier testing. Differentiable programming `lit` tests can be run by specifying this additional flag without recompiling the compiler and standard library.
[Forum discussion on upstreaming differentiable programming.](https://forums.swift.org/t/upstreaming-differentiable-attribute-and-differentiable-protocol/26821)
- No need to hash input values first
- Pass many values to a single hash_combine to save on intermediates
- Use hash_combine_range instead of a loop of hash_combines
No functionality change.
For example, for "#if os(simulator)", offer a fixit to change
"os" to "targetEnvironment", instead of offering to change "simulator".
Resolves SR-11037.
This refactors DWARFImporter to become a part of ClangImporter, since
it needs access to many of its implementation details anyway. The
DWARFImporterDelegate is just another mechanism for deserializing
Clang ASTs and once we have a Clang AST, the processing is effectively
the same.
When we transform each expression or statement in a function builder,
introduce a one-way constraint so that type information does not flow
backwards from the context into that statement or expression. This
more closely mimics the behavior of normal code, where type inference
is per-statement, flowing from top to bottom.
This also allows us to isolate different expressions and statements
within a closure that's passed into a function builder parameter,
reducing the search space and (hopefully) improving compile times for
large function builder closures.
For now, put this functionality behind the compiler flag
`-enable-function-builder-one-way-constraints` for testing purposes;
we still have both optimization and correctness work to do to turn
this on by default.
Typo-correction can be so expensive that it can slow down typechecking over 10x.
It can be a significant productivity drain for developing on large projects.
Unfortunately it is best that we disable it until we can dedicate the time to address its performance issues
and we are certain it works within acceptable performance bounds.
rdar://51966070
Add the command line option -require-explicit-availability to detect public
or `@usableFromInline` declarations and warn if they don't declare
an introduction OS version. This option should catch forgotten `@available`
attributes in frameworks where all services are expected to be introduced
by an OS version.
The option -require-explicit-availability-target "macOS 10.14, iOS 12.0"
can be specified for the compiler to suggest fix-its with the missing
attributes `@available(macOS 10.14, iOS 12.0, *)`.
rdar://51001662
Check the availability of decls that declare an opaque return type to ensure they deploy to a
runtime that supports opaque types.
rdar://problem/50731151
If a class does not have a custom @objc name, objc_getClass() can find
it at runtime by calling the Swift runtime's metadata demangler hook.
This avoids the static initializer on startup. If the class has a
custom runtime name we still need the static initializer unfortunately.
Fixes <rdar://problem/49660515>.
form SerializedModuleLoader into its own ModuleLoader class. (NFC-ish)
This gives better control over the order in which the various module
load mechanisms are applied.