Commit Graph

7628 Commits

Author SHA1 Message Date
Guillaume Lessard
8cc076000a Merge pull request #40116 from glessard/concurrency-assertions
[stdlib] replace uses of assert in the Concurrency module
2021-11-11 09:50:20 -07:00
Karoy Lorentey
4c28e823ef [test] Fix expected error message with backdeployed runtimes 2021-11-10 18:27:04 -08:00
Pavel Yaskevich
5422bb884c [TypeChecker] NFC: Allow perf test-case for rdar://74035425 to run only on macOS
Resolves: rdar://85267603
2021-11-10 14:59:11 -08:00
Guillaume Lessard
71f2d8e12d [test] disambiguate _internalInvariant
This test disables access controls, and it mistakenly used the Concurrency module's version of `_internalInvarant` instead of the Standard Library's version.
2021-11-10 11:59:04 -07:00
Karoy Lorentey
16d7525713 [test] Remove duplicate symmetricDifference tests 2021-11-09 21:39:03 -08:00
Alex Hoppen
60c78afb13 Merge pull request #40065 from ahoppen/pr/lexing-cutoff
[Parser] Don't modify the current token kind when cutting off parsing
2021-11-09 18:33:19 +01:00
Alex Hoppen
b888dc0e40 [Parser] Don't modify the current token kind when cutting off parsing
Previously, when we reached the maximum nesting level, we changed the current token’s kind to an EOF token. A lot of places in the parser are not set up to expect this token change. The intended workaround was to check whether pushing a structure marker failed (which would change the token kind) and bail out parsing if this happened. This was fragile and caused assertion failures in assert builds.

Instead of changing the current token’s kind, and failing to push the structure marker, let the lexer know that it should cut off lexing, essentially making the input buffer stop at the current position. The parser will continue to consume its current token (`Parser.Tok`) and the next token that’s already lexed in the lexer (`Lexer.NextToken`) before reaching the emulated EOF token. Thus two more tokens are parsed than before, but that shouldn’t make much of a difference.
2021-11-09 12:28:10 +01:00
Holly Borla
b3ad77f21c [Test] Add a few more + operands to a type checker perf test to exhibit
exponential behavior.

Binding value types early allows the previous version of this test
to compile, but the performance still doesn't scale with a few more
operands in the + chain.
2021-11-08 13:51:23 -08:00
Pavel Yaskevich
4799acfb20 [CSBindings] Attempt a type variable early if it's constrained by a struct/enum type
If a type variable has a subtype binding which came from a conversion/subtype/equality
constraint to a struct or enum (expect to `AnyHashable`, `Unsafe{Mutable}RawPointer`),
attempt it early because that type is the only choice which is not going to fail such
constraint.

For example, in cases like `$T argument convertible to Int` type variable could
only be bound to `Int`, `Int!`, or `@lvalue Int` to satisfy that constraint, so
it would make sense to attempt to bind it to `Int` early if it doesn't represent
a result of a member lookup (that's how IUO and/or `@lvalue` could be inferred)`
and doesn't have any direct disjunction associated with it e.g. for coercion or
optional matching.
2021-11-08 13:51:23 -08:00
Pavel Yaskevich
106922545c Merge pull request #40074 from xedin/rdar-84879566
[ConstraintLocator] Allow simplification of constructor member with overloaded base
2021-11-08 10:13:49 -08:00
Anthony Latsis
a987ad619b Merge pull request #40082 from AnthonyLatsis/invalid-ext-bind
AST: Make sure malscoped extensions get their extended nominal computed
2021-11-08 20:52:20 +03:00
Anthony Latsis
5215fe5d95 AST: Make sure malscoped extensions get their extended nominal computed 2021-11-08 17:29:38 +03:00
Pavel Yaskevich
609841710f [ConstraintLocator] Allow simplification of constructor member with overloaded base
`init` calls to redeclared types would end up diagnosed as ambiguity,
so locator simplification needs to account for the fact that "base"
of constructor might be overloaded type reference.

Resolves: rdar://84879566
2021-11-05 16:44:07 -07:00
Alejandro Alonso
98feb5e6ec Add availability to a few new tests (#40048)
its available, not availabile
2021-11-05 16:01:19 -07:00
Karoy Lorentey
6d33683c15 Merge pull request #40012 from lorentey/set-on-fire2
[stdlib] Optimize high-level Set operations
2021-11-05 13:48:40 -07:00
Doug Gregor
b4f65112b0 Merge pull request #40060 from DougGregor/propagate-async-to-inherited-designated-inits
Make sure we propagate 'async' down to inherited designed initializes.
2021-11-05 10:46:41 -07:00
Doug Gregor
d3a370914b Make sure we propagate 'async' down to inherited designed initializes.
Fixes a crash reported via rdar://80353441.
2021-11-04 21:21:37 -07:00
Pavel Yaskevich
573ae9bcac Merge pull request #40047 from xedin/rdar-83056143
[Diagnostics] A tailored diagnostic for Double<->CGFloat conversion via optional chaining
2021-11-04 16:14:58 -07:00
Pavel Yaskevich
293e97a761 Merge pull request #40022 from xedin/rdar-83072606
[Diagnostics] Coercion warning shouldn't assume that IUO is always optional
2021-11-04 00:42:05 -07:00
swift-ci
165c9b6208 Merge pull request #40038 from nate-chandler/rdar84984903 2021-11-03 23:04:13 -07:00
Pavel Yaskevich
ba9f6a24dd [TypeChecker] NFC: Add a test-case for rdar://83666783 2021-11-03 20:54:10 -07:00
Nate Chandler
d9b32f243c [Test] Fixed run line for lexical-lifetimes.swift.
rdar://84984903
2021-11-03 16:48:48 -07:00
Karoy Lorentey
172b1b8502 [test] Fix error in non-Darwin builds 2021-11-03 11:59:58 -07:00
Karoy Lorentey
5f65686cfc [test] Replace some more 9999 availabilities with SwiftStdlib 5.6 2021-11-02 20:43:35 -07:00
Karoy Lorentey
8e4b53b5ad [stdlib][test] Add a bit more extensive tests for high-level set operations 2021-11-02 19:35:22 -07:00
Pavel Yaskevich
d72871c0e3 [Diagnostics] Coercion warning shouldn't assume that IUO is always optional
In situations like `_ = ... as! Bool!` the `to` type could either
be represented by an optional (default) or unwrapped. Coercion warnings
cannot assume that `to` (even though its IUO) is always represented
as an optional type.

Resolves: rdar://83072606
2021-11-02 13:42:11 -07:00
Karoy Lorentey
e2cfab4f28 [stdlib][test] Adopt availability macros in tests 2021-10-31 15:00:58 -07:00
Karoy Lorentey
8e154a415a Merge pull request #39962 from lorentey/concurrency-availability
[stdlib] Introduce availability macros
2021-10-31 14:23:57 -07:00
nate-chandler
22609acef5 Merge pull request #39957 from nate-chandler/rdar80704984_2
[SILGen] Handled foreign funcs with async, error, and more args.
2021-10-29 13:49:18 -07:00
Karoy Lorentey
47956908b7 [Concurrency] SwiftStdlib 5.5 ⟹ SwiftStdlib 5.1 (usages)
The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib.

Adjust macro usages accordingly.
2021-10-28 14:36:36 -07:00
Nate Chandler
bc09cc9cf8 [SILGen] Handled foreign funcs with async, error, and more.
In 1ae317dd88, all the machinery was added
to enable calling ObjC functions that have both async and error
conventions.  The handling that was added for matching up arguments and
parameters, however, failed to handle functions that had both foreign
async and foreign error and other arguments.  Here, that handling is
fixed.

The fix is in four parts:
- Reverting to a single call to CallSite::emit to emit the formal
  params.  At this point, the foreign async and/or error params will be
  claimed as well.
- Separately counting the async and error parameters in
  ParamLowering::claimParams to ensure we get the right parameter
  slices.
- Letting ArgEmitter::maybeEmitForeignArgument look for an error
  parameter even if it already found an async parameter.
- Letting ArgEmitter::maybeEmitForeignArgument keep looking for foreign
  arguments after it finds one.

rdar://80704984
2021-10-28 13:42:08 -07:00
nate-chandler
1b3fa26a5c Merge pull request #39883 from nate-chandler/lexical_lifetimes/avoid-incorrect-elimination
[SILOptimizer] Keep lexical lifetime markers.
2021-10-28 10:54:59 -07:00
swift-ci
b2732e5755 Merge pull request #39881 from porglezomp-misc/upload-dylibs-concurrency-back-deploy 2021-10-24 13:37:21 -07:00
Cassie Jones
c59b238e0a [test] Enable some language features in validation-test
The logic in test/lit.site.cfg.in and validation-test/lit.site.cfg.in is
largely duplicated. This adds some of the missing features in order to
try to fix backdeployconcurrency testing. This should be more
fundamentally fixed to keep the different test configs in sync.
2021-10-24 14:03:00 -04:00
Cassie Jones
d1fe263e48 [test] Mark availability on failing validation-tests
The validation-test suite was incorrectly being run without the
concurrency feature enabled, so the tests were disabled. Now that
they're running, they need fixed availability annotations.
2021-10-24 14:03:00 -04:00
Nate Chandler
3bb1766a5f [SILOptimizer] Keep lexical lifetime markers.
Previously, TempRValueElimination would peephole simple alloc_stacks,
even when they were lexical; here, they are left for Mem2Reg to properly
handle.

Previously, SemanticARCOpts would eliminate lexical begin_borrows,
incorrectly allowing the lifetime of the value borrowed by them to be
observably shortened.  Here, those borrow scopes are not eliminated if
they are lexical.

Added an executable test that verifies that a local variable strongly
referencing a delegate object keeps that delegate alive through the call
to an object that weakly references the delegate and calls out to it.
2021-10-22 15:00:23 -07:00
Holly Borla
4fc5830d10 [Test] Complicate a "fast" type checker test to make it slow.
This test only happened to be under the constraint system thresholds,
but the performance was not fast. Add a few operands to the + chain,
and disable shrink to push the solver past the performance thresholds.
2021-10-21 15:43:30 -07:00
Saleem Abdulrasool
15a5d2c54b Revert "[android] Update to NDK 23" 2021-10-16 11:07:23 -07:00
swift-ci
46f3cc9dd8 Merge pull request #39045 from buttaface/android-ndk-23 2021-10-15 20:55:19 -07:00
Pavel Yaskevich
55a75ed89b [TypeChecker] NFC: Add a test-case for rdar://80630127 2021-10-14 13:07:12 -07:00
Kuba (Brecka) Mracek
c2c1bfb053 Add SWIFT_STDLIB_HAS_ENVIRON to remove usage of getenv/environ from stdlib (#39599) 2021-10-12 07:16:36 -07:00
Butta
7fa1b4b2ac [android] Update to NDK 23
The latest Long Term Support NDK finally removed binutils, including the bfd/gold
linkers and libgcc. This simplifies our Android support, including making lld the
default linker for Android. Disable three reflection tests that now fail, likely
related to issues with swift-reflection-dump and switching to lld.

Also, add the libatomic dependency for Android armv7, just as on linux.
2021-10-12 12:37:01 +05:30
Mishal Shah
c2fd49cebb Merge pull request #39473 from apple/rebranch
Update swift:main to support llvm-project:stable/20210726 changes (Rebranch merge)
2021-10-11 09:00:51 -07:00
Slava Pestov
8ab330a32d RequirementMachine: Add some testcases 2021-10-09 19:11:15 -04:00
swift-ci
3f8fea8508 Merge remote-tracking branch 'origin/main' into rebranch 2021-10-06 10:17:29 -07:00
Kuba (Brecka) Mracek
25e18e9a5c Enable LTO on the stdlib for the 'minimal' preset (#39292) 2021-10-05 07:38:01 -07:00
swift-ci
c51550f30e Merge remote-tracking branch 'origin/main' into rebranch 2021-09-30 15:11:41 -07:00
Evan Wilde
6956b7c5c9 Replace /usr/bin/python with /usr/env/python
/usr/bin/python doesn't exist on ubuntu 20.04 causing tests to fail.
I've updated the shebangs everywhere to use `/usr/bin/env python`
instead.
2021-09-28 10:05:05 -07:00
Doug Gregor
293e47a351 Handle missing Sendable conformances in SILFunctionType substitutions.
Fixes SR-15248 / rdar://83556240.
2021-09-27 13:35:46 -07:00
Konrad `ktoso` Malawski
e7342eb878 Merge pull request #39365 from kateinoigakukun/katei/fix-coop-executor-part-2
[Concurrency] repair cooperative executor and its tests
2021-09-27 09:47:09 +09:00