Commit Graph

557 Commits

Author SHA1 Message Date
Robert Widmann
a337b67f69 Stage In Flags To Fall Back To Manual Tracking
Request-based incremental dependencies are enabled by default. For the time being, add a flag that will turn them off and switch back to manual dependency tracking.
2020-03-31 16:16:53 -07:00
Dan Zheng
e5cb871428 [AutoDiff upstream] Add flag-gated AdditiveArithmetic derivation. (#30628)
Add `AdditiveArithmetic` derived conformances for structs, gated by the
`-enable-experimential-additive-arithmetic-derivation` flag.

Structs whose stored properties all conform to `AdditiveArithmetic` can derive
`AdditiveArithmetic`:
- `static var zero: Self`
- `static func +(lhs: Self, rhs: Self) -> Self`
- `static func -(lhs: Self, rhs: Self) -> Self`
- An "effective memberwise initializer":
  - Either a synthesized memberwise initializer or a user-defined initializer
    with the same type.

Effective memberwise initializers are used only by derived conformances for
`Self`-returning protocol requirements like `AdditiveArithmetic.+`, which
require memberwise initialization.

Resolves TF-844.
Unblocks TF-845: upstream `Differentiable` derived conformances.
2020-03-25 10:31:50 -07:00
Argyrios Kyrtzidis
791309155d [Parse] Fix issue with incremental re-parsing for SwiftSyntax emitting bogus parsing error
rdar://60232712
2020-03-18 16:00:04 -07:00
Ben Langmuir
f6662a8c9a Merge pull request #30437 from benlangmuir/more-stringref
Update for llvm StringRef string conversion
2020-03-17 08:48:57 -07:00
Ben Langmuir
cb7b64a3fe Update for llvm StringRef string conversion
rdar://60514063
2020-03-16 16:07:48 -07:00
Fred Riss
259d78a350 Adapt to llvm.org StringRef API change 2020-03-13 19:08:22 +01:00
Joe Groff
d06b839c03 Add -verify-all-substitution-maps frontend flag 2020-03-11 16:19:30 -07:00
Kuba (Brecka) Mracek
0d400ca310 Merge branch 'master' into mracek/arm64e 2020-03-04 09:36:25 -08:00
Slava Pestov
3904fe83fb AST: Centralize ABI-related deployment target checks
There were a couple of methods in LangOptions and some related ones in
Availability and ASTContext that were added more recently.

Refactor the three older checks to the newer scheme.
2020-03-03 22:49:19 -05:00
Kuba Mracek
84c4864911 [arm64e] Add Swift compiler support for arm64e pointer authentication 2020-02-27 16:10:31 -08:00
Joe Groff
dcd432a1bc Turn on substituted SILFunctionTypes by default 2020-02-24 12:14:21 -08:00
Brent Royal-Gordon
7c0859d7f8 Add frontend flags for staging cross-import overlays 2020-02-18 11:06:12 -08:00
David Ungar
38f599dcb7 Turn type-body-fingerprints on-by-default 2020-01-30 11:48:13 -08:00
David Ungar
7b0cdc48a7 off-off-off! 2020-01-27 18:08:52 -08:00
David Ungar
4510c2f531 type body prints-on-by-default 2020-01-27 15:14:46 -08:00
David Ungar
d61f6f2f66 Changes to support per-type-body fingerprints. 2020-01-27 15:14:46 -08:00
David Ungar
0852a1bbe6 Default to enabling fine-grained-dependencies. 2020-01-23 15:02:01 -08:00
David Ungar
98b86c63d1 Use the initial value of EnableFineGrainedDependencies as the default. 2020-01-23 12:12:17 -08:00
Devin Coughlin
8c5c5ec802 [Parse] Support macCatalyst conditional compilation
Add support for conditional compilation under macCatalyst

Developers can now detect whether they are compiling for macCatalyst at
compile time with:

  #if targetEnvironment(macCatalyst)
    // Code only compiled under macCatalyst.
  #end
2020-01-21 18:28:17 -08:00
Devin Coughlin
655d89b146 [Driver/Frontend] Add Driver support for macCatalyst and library search paths
Add support in the driver and frontend for macCatalyst target
targets and library search paths.

The compiler now adds two library search paths for overlays when compiling
for macCatalyst: one for macCatalyst libraries and one for zippered macOS
libraries. The macCatalyst path must take priority over the normal macOS path
so that in the case of 'unzippered twins' the macCatalyst library is
found instead of the macOS library.

To support 'zippered' builds, also add support for a new -target-variant
flag. For zippered libraries, the driver invocation takes both a -target and a
-target-variant flag passes them along to the frontend. We support builds both
when the target is a macOS triple and the target variant is macCatalyst and
also the 'reverse zippered' configuration where the target is macCatalyst and the
target-variant is macOS.
2020-01-21 18:28:17 -08:00
David Ungar
cc89dad526 Fine-grained and driver fixes.
Restructure fine-grained-dependencies to enable unit testing

Get frontend to emit correct swiftdeps file (fine-grained when needed) and only emit dot file for -emit-fine-grained-dependency-sourcefile-dot-files

Use deterministic order for more information outputs.

Set EnableFineGrainedDependencies consistently in frontend.

Tolerate errors that result in null getExtendedNominal()

Fix memory issue by removing node everywhere.

Break up print routine

Be more verbose so it will compile on Linux.

Sort batchable jobs, too.
2020-01-11 21:57:14 -08:00
Saleem Abdulrasool
b483047afe Revert "[Incremental] Dependency fixes in preparation for fine-grained dependencies" 2020-01-09 19:14:47 -08:00
Slava Pestov
724ccf0f67 Merge pull request #29088 from slavapestov/request-eval-perf-hack
Fix some low-hanging request evaluator performance fruit
2020-01-09 08:47:43 -05:00
Slava Pestov
0eb2484a93 AST: Only build request dependency graph if frontend is run with -build-request-dependency-graph
This adds a measurable amount of runtime overhead, but it's only
needed for debugging.
2020-01-08 22:35:55 -05:00
David Ungar
6fffe724f2 Fine-grained and driver fixes.
Restructure fine-grained-dependencies to enable unit testing

Get frontend to emit correct swiftdeps file (fine-grained when needed) and only emit dot file for -emit-fine-grained-dependency-sourcefile-dot-files

Use deterministic order for more information outputs.

Set EnableFineGrainedDependencies consistently in frontend.

Tolerate errors that result in null getExtendedNominal()

Fix memory issue by removing node everywhere.

Break up print routine

Be more verbose so it will compile on Linux.

Sort batchable jobs, too.
2020-01-04 14:37:06 -08:00
Brent Royal-Gordon
63ec1cf5af Introduce a separate #filePath, remove -pound-file
This makes the path behavior more first-class. The feature is now hidden behind an experimental flag, -enable-experimental-concise-pound-file.
2019-12-04 16:35:13 -08:00
Brent Royal-Gordon
44a2f67f4b Turn new #file behavior off by default 2019-12-04 16:33:25 -08:00
Brent Royal-Gordon
789d38eb04 Control #file behavior with a command line option 2019-12-04 16:33:25 -08:00
David Ungar
380d0d973e Merge pull request #28563 from davidungar/renaming-dependencies
[Incremental compilation] Rename "experimental dependencies" to "fine-grained dependencies"
2019-12-04 10:47:24 -08:00
David Ungar
6a6e9357ef Change "experimental" to "fine-grained". 2019-12-04 08:50:44 -08:00
Varun Gandhi
e7be41d0cb Merge pull request #27479 from varungandhi-apple/vg-track-clang-function-types
Track Clang function types in the AST
2019-12-04 08:47:35 -08:00
Saleem Abdulrasool
851f877390 Basic: default platform version to 0.0.0
The platform versions are really only used on Darwin platforms.
Simplify the path by defaulting to `0.0.0` on all platforms, and
handling the version number on supported platforms.
2019-11-24 10:12:07 -08:00
Varun Gandhi
196f358dec [AST] Add ClangTypeConverter, computing C types for FunctionTypes.
Note: The change in ASTBuilder::createFunctionType is functionally minor,
but we need the FunctionType::Params computed _before_ the ExtInfo, so we
need to shuffle a bunch of code around.
2019-11-22 12:42:36 -08:00
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