Commit Graph

374 Commits

Author SHA1 Message Date
Robert Widmann
f4d333d066 Sink a bunch of semantic options into TypeCheckerOptions
Sink
- DebugConstraintSolver
- DebugConstraintSolverAttempt
- DebugConstraintSolverOnLines
- DebugGenericSignatures
- DebugForbidTypecheckPrefix
- SolverMemoryThreshold
- SolverBindingThreshold
- SolverShrinkUnsolvedThreshold
- SolverDisableShrink
- EnableOperatorDesignatedTypes
- DisableConstraintSolverPerformanceHacks
- SolverEnableOperatorDesignatedTypes
2019-11-12 22:39:49 -08:00
Robert Widmann
097726717e Absorb the TypeCheckerFlags into the Frontend
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.
2019-11-12 09:54:06 -08:00
Joe Groff
4d6392b8ad Add an option to stage in substituted type lowering for function values 2019-11-05 11:32:34 -08:00
Hamish Knight
7077a68b83 [Sema] Diagnose unsound pointer conversions
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.
2019-11-03 08:42:25 -08:00
Doug Gregor
43da5c9744 Remove dead flag disable-tsan-inout-instrumentation 2019-10-14 21:42:33 -07:00
Doug Gregor
14be78d54d Remove -(enable|disable)-function-builder-one-way-constraints
Remove the staging flags for unidirectional constraints in function
builders. We're not going back!
2019-10-14 21:22:28 -07:00
Dan Zheng
f6226d926c [AutoDiff upstream] Add -enable-experimental-differentiable-programming frontend flag. (#27446)
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)
2019-10-07 19:17:40 -07:00
Jordan Rose
b32e82c720 More idiomatic use of llvm::hash_combine in many places (#27497)
- 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.
2019-10-04 13:08:24 -07:00
David Ungar
4a265a91d7 Turn on ASTScopes 2019-09-22 19:17:49 -07:00
David Ungar
a9a9069591 change compare-to-astScope-lookup to crosscheck-unqualified-lookup 2019-09-22 17:59:39 -07:00
David Ungar
3afd6a7146 add flag to stress scope creation 2019-09-13 22:30:49 -07:00
David Ungar
1415f2f7f9 LazyASTScopes only matters when ASTScopes are enabled 2019-08-28 11:31:17 -07:00
Roopesh Chander
b75711c2d2 Make a .def file for PlatformConditionKind 2019-08-21 19:52:00 +00:00
Roopesh Chander
34fec7f1d4 [Parser][QoI] Offer fixit for changing the platform condition kind
For example, for "#if os(simulator)", offer a fixit to change
"os" to "targetEnvironment", instead of offering to change "simulator".

Resolves SR-11037.
2019-08-21 19:51:47 +00:00
Doug Gregor
b4e80cfd90 [Constraint graph] Enable one-way constraints in function builders.
Enable one-way constraints by default for function builders, finishing
rdar://problem/50150793.
2019-08-19 22:49:15 -07:00
adrian-prantl
7a62165e09 Merge pull request #26648 from adrian-prantl/rm-dwarfimporter
Move DWARFImporterDelegate into ClangImporter and remove DWARFImporter.
2019-08-14 11:31:05 -07:00
Adrian Prantl
c08a62764a Move DWARFImporterDelegate into ClangImporter and remove DWARFImporter.
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.
2019-08-14 10:28:50 -07:00
Doug Gregor
7697611c15 Merge pull request #25983 from DougGregor/one-way-constraints
[Constraint solver] Introduce one-way binding constraints.
2019-08-14 09:19:11 -07:00
David Ungar
b02b4b00ef Cleanup and fixes, also 1st cut at lazy. 2019-08-13 17:48:06 -07:00
Doug Gregor
be73a9d641 [Function builders] Add one-way constraints when applying function builders
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.
2019-08-13 12:38:46 -07:00
David Ungar
09342dfa47 Add frontend flag -warn-if-astscope-lookup w/ test 2019-08-06 23:17:49 -07:00
pschuh
4fd0671e54 Merge pull request #25870 from pschuh/cpp-1
Add -enable-cxx-interop flag and support for extern "C" {}
2019-07-09 11:37:31 -07:00
Parker Schuh
fa69a73ee4 Add -enable-cxx-interop flag and support for extern "C" {} 2019-07-08 11:43:35 -07:00
Doug Gregor
d0c5b6a4e1 Drop the unused -enable-opaque-result-types command-line option 2019-07-05 11:34:10 -07:00
David Ungar
200eb30371 Merge pull request #25692 from davidungar/A-6-14
[Name Lookup, ASTScope] simplified and debugged
2019-06-27 20:07:41 -07:00
David Ungar
33204e1519 Fixes 2019-06-27 16:17:13 -07:00
David Ungar
be4151eadf set default 2019-06-27 15:32:47 -07:00
David Ungar
d11b572d97 Default ASTEnableScopeLookup to false. 2019-06-27 15:27:01 -07:00
David Ungar
3a3145c0f4 Alternate SelfDC computation, fixes, and cleanups.
ASTScopeLookup by default
Create empty fn bodies for IDE tests.
Include initializer source range for property wrappers.
Add -disable-astscope-lookup
2019-06-23 09:17:09 -07:00
Argyrios Kyrtzidis
cf65b8f952 Disable typo-correction by default until we can make it work within acceptable performance bounds
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
2019-06-22 17:02:03 -07:00
Alexis Laferrière
36e5b5ae78 Merge pull request #25152 from xymus/explicit-intro-version
Add CLI option to warn when a public decl has no introduction version
2019-06-17 15:01:41 -07:00
Alexis Laferrière
c44cff7c97 Add a CLI option to warn when a public decl has no availability
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
2019-06-17 10:32:58 -07:00
David Ungar
06527db4ab Merge pull request #24594 from davidungar/A5-7-ASTOOScope-rebased
[NameLookup] ASTOOScope ontology
2019-06-14 08:03:09 -07:00
David Ungar
6cfcabd8e5 add -disable-parser-lookup 2019-06-11 09:08:10 -07:00
mishal_shah
1e38fc3030 Update master to build with Xcode 11 beta, macOS 10.15, iOS 13, tvOS 13, and watchOS 6 SDKs 2019-06-03 22:50:02 -07:00
David Ungar
663760e3b7 ASTOOScope ontology 2019-05-28 10:48:22 -07:00
Joe Groff
cec9e9e33a Opaque types require a newer Swift runtime.
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
2019-05-15 11:39:53 -07:00
Slava Pestov
6d7d13fceb IRGen: Disable eager initialization of NSCoding adopters on newer targets
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>.
2019-05-01 17:43:58 -04:00
Slava Pestov
3b6ec6c651 IRGen: Move some deployment target checks to LangOptions 2019-05-01 15:13:12 -04:00
Slava Pestov
3f5a06bc3e AST: Always diagnose request evaluator cycles 2019-04-22 22:22:23 -04:00
Brent Royal-Gordon
814d50c7e6 Merge pull request #24163 from brentdax/line-line-line-line
Add -debug-constraints-on-line flag
2019-04-22 16:54:00 -07:00
Brent Royal-Gordon
79cee8daad Add -debug-constraints-on-line flag 2019-04-22 13:59:50 -07:00
Adrian Prantl
b244b0928e Factor out the pre-registered MemoryBuffer functionality
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.
2019-04-22 09:17:08 -07:00
Joe Groff
a82b9929a9 Enable opaque result types. 2019-04-17 14:43:32 -07:00
Joe Groff
5e1497967a Parse opaque types. 2019-04-17 14:43:32 -07:00
Slava Pestov
583c0d9ebe Frontend: Add -enable-resilient-objc-class-stubs command line flag 2019-03-26 18:43:00 -04:00
swift-ci
497e94e89d Merge pull request #23235 from mikeash/remove-stable-abi-bit-configuration 2019-03-15 15:31:58 -07:00
Slava Pestov
9626340d4b Sema: Remove unused -fix-string-to-substring-conversion flag 2019-03-14 22:08:43 -04:00
Mike Ash
597dcd8f3f [Stdlib][Frontend][CMake] Remove SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT option, make it permanently on. 2019-03-13 09:31:50 -04:00
David Ungar
2f65ac3735 Cosmetic cleanups 2019-01-30 17:16:49 -08:00