Commit Graph

6090 Commits

Author SHA1 Message Date
Alex Hoppen
3b2372307c Merge pull request #37421 from ahoppen/pr/fix-crash-complete-in-result-builder-with-nil
[CodeComplete] Fix crash when completing inside a result builder containing a variable initialized with `nil`
2021-05-17 18:56:45 +02:00
Alex Hoppen
ad5dc2d76f [CodeComplete] Fix crash when completing inside a result builder containing a variable initialized with nil
Resolves rdar://78017503
2021-05-14 17:21:26 +02:00
Holly Borla
c305b57ba3 Merge pull request #37407 from hborla/wrapped-parameter-serialization
[Property Wrappers] Fix a crash in merge-modules with wrapped parameters.
2021-05-13 15:48:46 -07:00
Holly Borla
df43914406 [Property Wrappers] Return early from computing the backing property type
if the wrapped property came from a module file.
2021-05-13 09:16:38 -07:00
Eric Miotto
c3f8dacdf0 [Build] allow to generate symbols for a subset of binaries (#37120)
This would be needed to reduce overall build times in scenarios when
generating symbols for all binaries is too expensive and/or not needed.

At the same time, introduce tests around the logic that handles symbols.

Addresses rdar://76865276
2021-05-13 07:32:41 -07:00
Eric Miotto
1e5f790d06 [Build] allow to generate symbols for a subset of binaries
This would be needed to reduce overall build times in scenarios when
generating symbols for all binaries is too expensive and/or not needed.

Addresses rdar://76865276
2021-05-12 10:02:41 -07:00
Eric Miotto
b903a6cc65 Put symbol generation logic under test
...before adding the logic to filter paths

In particular:
* print the list of files that `cpio` copies, so we can test explicitly
  which files end up in the symroot (and also see those when asking for
  a toolchain in PR testing)
* use `find` instead of `grep` to filter files we want symbols generated
  for -- this is to avoid the script failing when there are no symbol to
  process, especially in lit tests
* remove an unnecessary check for `swift-api-digester` -- this is now a
  symlink to `swift-frontend` and we only process regular files.

Supports rdar://76865276
2021-05-12 09:52:30 -07:00
Alex Hoppen
420afdc415 Merge pull request #37344 from ahoppen/pr/no-unresolved-type-variables
[Sema] Remove `TypeCheckExprFlags::AllowUnresolvedTypeVariables`
2021-05-11 13:23:00 +02:00
Alex Hoppen
4566bf3136 [Sema] Remove TypeCheckExprFlags::AllowUnresolvedTypeVariables
Remove the `TypeCheckExprFlags::AllowUnresolvedTypeVariables` flag, fixing another occurance of rdar://76686564 (https://github.com/apple/swift/pull/37309)

This does not break anything in the test suite, so I think the removal of the flag is fine.

Resolves rdar://76686564 and rdar://77659417
2021-05-10 20:11:43 +02:00
Slava Pestov
3beb3529b4 Move test/Generics/explicit_requirements_perf.swift to validation-test/compiler_scale
All other scale-tests are in validation-test, so move this one there
too to speed up non-validation test runs.

Also this fixes the failure on Windows, where we don't run validation
tests yet.
2021-05-10 14:08:16 -04:00
Pavel Yaskevich
6126bc06e0 [TypeChecker] NFC: Complicate perf test-case expression by adding more operators
This test has become flaky in different configurations due to a varying
number of available operator overloads, let's use more operators to make
sure that it's "too complex" regardless of configuration.

Resolves: rdar://77656775
2021-05-07 11:04:19 -07:00
Artem Chikin
6f44ba4ff1 Merge pull request #37122 from artemcm/BringBackNewDriver
Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
2021-05-07 09:42:38 -07:00
Arnold Schwaighofer
b8b5edbf5c Disable test type_checker_perf/slow/rdar19737632.swift
It failed on a bot.

rdar://77656775
2021-05-07 08:10:05 -07:00
Alex Hoppen
759419190e Merge pull request #36992 from ahoppen/pr/wrapping-lvalue
[TypeChecker] Clear param specifiers before re-typechecking expression for completion
2021-05-07 14:10:45 +02:00
Alex Hoppen
6f46ba6899 Merge pull request #36943 from ahoppen/pr/conforming-methods-in-closure
[Sema] Don’t allow unresolved type variables if `LeaveBraceStmtBodyUnchecked` is `true`
2021-05-07 14:08:25 +02:00
Max Desiatov
7be99e4cbf Merge pull request #37084 from kateinoigakukun/katei/share-fatalerror-concurrency
Rename duplicated `swift::fatalError` in `swiftRuntime` and `swift_Concurrency`.

Both `swiftRuntime` and `swift_Concurrency` had `swift::fatalError` implementation, but it causes symbol conflict with the `-static-stdlib` flag.

This patch removes one of the implementations in `swift_Concurrency` to avoid conflicts. Also added a test case to ensure that linking the Concurrency module with `-static-stdlib` works.

This issue was found by SwiftWasm test cases.
2021-05-06 09:46:15 +01:00
Alex Hoppen
74ff6923a1 [Sema] Don’t allow unresolved type variables if LeaveBraceStmtBodyUnchecked is true
According to Pavel, we want to eliminate allowing unresolved variables as much as possible. Removing this flag doesn’t break any test cases (at least not in a meaningful way) and fixes a crasher, so it seems reasonable to remove it.

Fixes rdar://76686564
2021-05-06 10:19:05 +02:00
Alex Hoppen
b1a4708782 [TypeChecker] Clear param specifiers before re-typechecking expression for completion
Because we are completing inside a result builder, we are never calling into `typeCheckExpression` and thus never call into `typeCheckForCodeCompletion` before `fallbackTypeCheck` (SR-14601).

This works fine in most cases, but in the added test case, we are hitting an assertion because the specifiers are not correctly erased from the `ClosureExpr` before re-typechecking for completion. Erasing them before fixes the test case until the underlying issue described above is fixed.

Fixes rdar://76710904 [SR-14494]
2021-05-06 10:00:25 +02:00
Pavel Yaskevich
2898b50b7f Revert "Revert "[TypeChecker] PreCheck: Don't strip away tuple/paren from subscripts …"" 2021-05-04 11:19:33 -07:00
Pavel Yaskevich
b12d57afac Revert "[TypeChecker] PreCheck: Don't strip away tuple/paren from subscripts …" 2021-05-03 11:55:25 -07:00
Pavel Yaskevich
46bc3b672d Merge pull request #37115 from xedin/disable-only-in-perf
[CSSimplify] Allow overload choices with missing labels to be considered for diagnostics
2021-04-29 10:25:16 -07:00
Artem Chikin
ae2e856f9b Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
This reverts commit 937e1a365c, reversing
changes made to a5440a8abd.
2021-04-28 15:11:36 -07:00
Pavel Yaskevich
f36ecf2fa1 [CSSimplify] Allow overload choices with missing labels to be considered for diagnostics
Let's make use of a newly added "disable for performance" flag to
allow solver to consider overload choices where the only issue is
missing one or more labels - this makes it for a much better
diagnostic experience without any performance impact for valid code.
2021-04-28 12:04:57 -07:00
Artem Chikin
1e44ed00eb Revert "Always build SwiftDriver and use it as default compiler driver" 2021-04-28 11:20:21 -07:00
Yuta Saito
1719148588 Add test case to ensure working static link with concurrency module 2021-04-28 23:52:11 +09:00
Artem Chikin
23452d5bad Merge pull request #36377 from artemcm/NewDriverDefault
Always build SwiftDriver and use it as default compiler driver
2021-04-27 09:53:06 -07:00
Pavel Yaskevich
a21f323c16 Merge pull request #36946 from xedin/rdar-61749633
[TypeChecker] PreCheck: Don't strip away tuple/paren from subscripts …
2021-04-26 12:19:55 -07:00
Artem Chikin
c2dc8e3d07 Always build (and use) the new SwiftDriver as the default compiler driver.
This will make sure that compiler developers are using the new driver when they build the compiler locally and use it.

- Adds a new build-script product category: before_build_script_impl for products we wish to build before the impl products.
- Adds a new EarlySwiftDriver product to that category, which gets built with the host toolchain.
- Adds an escape hatch: --skip-early-swift-driver
- Adjusts the swift CMake configuration with an additional step: swift_create_early_driver_symlinks which (if one was built) creates symlinks in the swift build bin directory to the EarlySwiftDriver swift-driver and swift-help executables.
- Adds a new test subset : only_early_swiftdriver, which will get built into a corresponding CMake test target: check-swift-only_early_swiftdriver-* which runs a small subset of driver-related tests against the Early SwiftDriver.
  - This subset is run always when the compiler itself is tested (--test is specified)
  - With an escape disable-switch: --skip-test-early-swift-driver
  - All tests outside of only_early_swiftdriver are forced to run using the legacy C++ driver (to ensure it gets tested, still).

NOTE: SwiftDriver product (no 'Early') is still the main product used to build the driver for toolchain installation into and for executing the product's own tests. This change does not affect that.
2021-04-26 12:17:32 -07:00
Pavel Yaskevich
71372bce67 [Diagnostics] Switch to use contextual purpose associated with locator
`ContextualFailure` is the main beneficiary of additional information
associated with `ContextualType` element because it no longer has to
query solution for "purpose" of the contextual information.

Resolves: rdar://68795727
2021-04-26 09:51:25 -07:00
Strieker
72fc506612 "modified existing validation test after improving error handling for composed property werapper mismatches" 2021-04-22 22:08:03 -07:00
Alex Hoppen
b68443156a Merge pull request #36818 from ahoppen/pr/rdar76329083
[TypeChecker] Fix assertion failure when using Self in extension that’s not on top-level
2021-04-21 10:20:57 +02:00
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
Luciano Almeida
ddeb1929c4 [DiagnosticQol][SR-14505] Use DeclDescriptive kind in missing return data flow diagnostics (#36952)
* [Diagnostics] Use DeclDescriptiveKind on data flow diagnostics to improve diagnostic message

* [tests] Add regression tests to SILOptimizer/return.swift

* [tests] Adapt other tests to changes of SR-14505

* [Diagnostics] Adapt message for missing return diagnostics, remove article

* [Diagnostics] Adapt message for missing return diagnostics to have a note with fix

* [tests] Adjust tests in validation suit
2021-04-20 08:16:32 -03:00
Pavel Yaskevich
593bbab880 [TypeChecker] PreCheck: Don't strip away tuple/paren from subscripts and ObjC literals
`PreCheckExpression` already skips calls, make sure that invalid subscripts,
dynamic subscript, ObjC literals preserve paren/tuple for an index/argument.

Resolves: rdar://61749633
2021-04-16 11:40:19 -07:00
eeckstein
f53f80ff04 Merge pull request #36928 from eeckstein/module-build-error-message
ModuleInterfaceBuilder: give a more specific error message in case of a compiler mismatch
2021-04-16 08:55:32 +02:00
Doug Gregor
c1328bd83f Merge pull request #36857 from DougGregor/import-concurrency-by-default-take-2
Enable import of the _Concurrency module by default.
2021-04-15 13:12:45 -07:00
Eric Miotto
3a551f8fcc [build] allow to specify ninja targets to build for LLVM (#36910)
This is meant to support scenarios in which we need to build as little as
LLVM as possible for performance reasons (e.g. when enabling LTO).

While LLVM CMake build system offers options in this sense,
in our investigation they turned out not to be suitable,
since either they are not granular enough (`LLVM_INCLUDE/BUILD` flags)
or they require active opt out for any new tool added
(`*_BUILD_*_TOOL` flags)

When using this mechanism, there is the possibility to specify different
targets to use for cross-compile hosts.

Supports rdar://32019390
2021-04-15 12:45:00 -07:00
Erik Eckstein
d49de1a982 ModuleInterfaceBuilder: give a more specific error message in case of a compiler mismatch 2021-04-15 14:06:17 +02:00
Slava Pestov
8ed2a95926 Merge pull request #36918 from slavapestov/error-existential-metatype
Sema: Handle Error self-conformance in TypeChecker::containsProtocol()
2021-04-14 21:50:25 -04:00
Slava Pestov
508dc8c0d9 Sema: Handle Error self-conformance in TypeChecker::containsProtocol()
While ModuleDecl::lookupConformance() did the right thing here, we have
another entry point, TypeChecker::containsProtocol(), that also needs
to special-case Error.

Fixes https://bugs.swift.org/browse/SR-13734 / rdar://problem/70338670.
2021-04-14 17:55:43 -04:00
Nate Chandler
1e45d161ab [Test] Disable a test on Linux at swift_test_mode_optimize_none.
Per @xedin, it's fine to leave this test disabled here.
2021-04-14 13:58:03 -07:00
Doug Gregor
568e943115 Enable import of the _Concurrency module by default. 2021-04-13 23:14:06 -07:00
Pavel Yaskevich
cb3608e135 Merge pull request #36887 from xedin/adjust-perf-test-for-linux-2
[TypeChecker] NFC: Adjust "fast" test-case message to accommodate Ama…
2021-04-13 18:18:26 -07:00
swift-ci
fb55cedfbc Merge pull request #36892 from nate-chandler/wrangle/back_deployment_runtime 2021-04-13 18:00:54 -07:00
Nate Chandler
6efadb051d [Test] Disabled several Runtime tests for back_deployment_runtime.
rdar://76567759
2021-04-13 15:42:33 -07:00
Slava Pestov
cf646da193 Merge pull request #36888 from slavapestov/opaque-result-type-with-tuple
SIL: A tuple type can be lowered with an opaque result type as the original type
2021-04-13 17:27:56 -04:00
Slava Pestov
a0c215b7d2 SIL: A tuple type can be lowered with an opaque result type as the original type
AbstractionPattern::matchesTuple() is used by various assertions, and
the condition was too strict. Relax the condition to fix an assertion
failure in the case where an opaque result type has a tuple as its
underlying type.

Fixes https://bugs.swift.org/browse/SR-14426 / rdar://problem/76057095.
2021-04-13 14:46:58 -04:00
Pavel Yaskevich
a4ced48946 [TypeChecker] NFC: Adjust "fast" test-case message to accommodate Amazon Linux 2 2021-04-13 10:32:25 -07:00
Pavel Yaskevich
ceeee459b4 Merge pull request #36631 from xedin/conformance-perf-experiment
[Perf][CSSimplify] Transfer conformance requirements of a parameter to an argument
2021-04-12 13:13:56 -07:00
Mishal Shah
37aa203b75 Merge pull request #36836 from apple/update-the-tests-to-use-target-cpu
Use %target-cpu in the tests to support running on Apple Silicon hard…
2021-04-10 00:08:58 -07:00