Commit Graph

5899 Commits

Author SHA1 Message Date
Pavel Yaskevich
6d671020b9 [TypeChecker/BuilderTransform] Make sure implicit load expression updates types in AST
Can't use `ConstraintSystem::addImplicitLoadExpr` because that would
only cache types in constraint system and wouldn't propagate them to AST,
since that happens in `ExprRewritter::finalize` during regular solution
application. `TypeChecker::addImplicitLoadExpr` should be used directly
in cases like that.

Resolves: rdar://problem/58972627
2020-02-03 11:45:55 -08:00
swift-ci
8d2c7ac43e Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-29 11:23:12 -08:00
David Ungar
5b8ba88296 Merge pull request #29525 from davidungar/type-prints-off-by-default2
[Incremental] Tests and bug fixes for per-type fingerprints.
2020-01-29 11:18:56 -08:00
swift-ci
054c288643 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-29 08:24:01 -08:00
Chris Amanse
ffa6bf4729 Fix memory leaks in ThreadBarriers.swift (#12212)
* Fix memory leaks in ThreadBarriers.swift

* Fatal error on pthread cond/mutex destroy failure

* Rename pthread to thread

* Fix pthread init function calls

* Fix guard statement
2020-01-29 08:21:52 -08:00
David Ungar
bbffc0959b Tests for type fingerprints are enabled. 2020-01-28 20:06:44 -08:00
swift-ci
dd4488eb2d Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-28 13:04:30 -08:00
Robert Widmann
c81cecf653 Merge pull request #29491 from CodaFi/constraint-kinds
[GSB] Map invalid subject types in requirement constraints to ErrorType
2020-01-28 12:52:57 -08:00
Mike Ash
5f4fcced99 Merge pull request #29495 from mikeash/existentials-no-os-stdlib
[Test] Mark Reflection/existentials.swift as unsupported when testing against the OS stdlib.
2020-01-28 14:34:56 -05:00
Robert Widmann
88d6559722 [GSB] Map invalid subject types in requirement constraints to ErrorType
Resolves SR-12072 and rdar://58941114
2020-01-28 10:15:43 -08:00
swift-ci
81a6a266aa Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-27 18:23:23 -08:00
Mike Ash
76a6f88b3a [Test] Mark Reflection/existentials.swift as unsupported when testing against the OS stdlib, as the test looks for a recent Remote Mirror addition to print the mangled name of a typeref.
rdar://problem/58939662
2020-01-27 21:04:32 -05:00
David Ungar
84fa03f757 Added -disable-type-fingerprints to tests. 2020-01-27 15:14:46 -08:00
swift-ci
1db2b06e58 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-25 23:24:24 -08:00
Rintaro Ishizaki
407b6c4b1d Merge pull request #29416 from marcrasi/add-complete-repl-test
negative test for SR-12076: completion crash
2020-01-25 23:08:43 -08:00
swift-ci
72229ba355 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-24 16:43:36 -08:00
Slava Pestov
305620b354 ClangImporter: Reconcile Clang declaration hidden-ness between loadAllMembers() and lazy loading
Lazy loading checked if the ClangDecl was hidden, but loading all
members did not. Let's make loadAllMembers() behave like the lazy
path, and fix some of the mock SDKs in the test suite.
2020-01-24 17:07:08 -05:00
Marc Rasi
d608220360 negative test for SR-12076: completion crash 2020-01-24 10:12:39 -08:00
swift-ci
5ef7482da1 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-24 09:43:51 -08:00
Pavel Yaskevich
d412ea4d16 [Diagnostics] Unsatisfied requirement in reference diagnostics expect type context
Resolves: rdar://problem/50666427
2020-01-23 10:14:37 -08:00
swift-ci
a48309f8b1 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-21 12:03:41 -08:00
Doug Gregor
8283a67648 Revert "Revert "Reimplement function builders as statement transformations."" 2020-01-21 10:07:20 -08:00
swift-ci
677787741d Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-21 09:23:10 -08:00
Doug Gregor
423adbc089 Merge pull request #29292 from apple/revert-29133-generlize-function-builders
Revert "Reimplement function builders as statement transformations."
2020-01-21 09:10:20 -08:00
swift-ci
b696f6b808 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-19 17:23:50 -08:00
Ross Bayer
d39dae54e4 [Build System: Python] Renamed the Python lint validation test and updated the contents to match the other tests. 2020-01-19 01:32:58 -08:00
Ross Bayer
83bfc69ea3 [Build System: update-checkout] Added a new run_test.py script to utils/update_checkout which is used to run the validation test. 2020-01-19 01:32:47 -08:00
Ross Bayer
de1759c84f [Build System: build-script] Added a new run_test.py script to utils/swift_build_support which is used to run the unit test suite. 2020-01-19 01:31:21 -08:00
Ross Bayer
7587c7c0ac [Build System: build-script] Re-structured the build_swift module tests to contain a build_swift directory.
Having the test directory match the module we are testing means we can have scripts in the top level of utils/build_swift which can also have tests. As part of this re-structure the test utilties have been simplified somewhat and all tests no longer use a custom TestCase, rather the standard one exposed by the unittest module.
2020-01-19 01:31:21 -08:00
swift-ci
740276362c Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-18 06:04:04 -08:00
eeckstein
3fd9098f67 Merge pull request #29274 from eeckstein/disable-slow-tests
tests: exclude some very long running tests from jobs with a non-optimized stdlib
2020-01-18 14:59:33 +01:00
Doug Gregor
86c13d3c74 Revert "Reimplement function builders as statement transformations." 2020-01-17 15:52:49 -08:00
swift-ci
3a0eb0760f Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-17 10:44:12 -08:00
Doug Gregor
09bfd9438f Merge pull request #29133 from DougGregor/generlize-function-builders
Reimplement function builders as statement transformations.
2020-01-17 10:39:46 -08:00
Erik Eckstein
79fb67f5df tests: exclude some very long running tests from jobs with a non-optimized stdlib
Those are tests which take > 1000s on some simulator configurations with a non-optimized stdlib.
We run those tests anyway with an optimized stdlib. So we don’t lose test coverage by disabling them for debug-stdlib.

This fixes some sporadic time outs on the CI jobs.
2020-01-17 16:51:02 +01:00
swift-ci
fd4e6e02f2 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-17 02:24:00 -08:00
Ross Bayer
31f063b8b8 [Build System: build-script] Remove the old arguments module hiding in swift_build_support in favor of the more featureful one living in build_swift. 2020-01-17 00:30:17 -08:00
Doug Gregor
a49f0091cb [Constraint application] Skip error expressions when applying builders.
If we encountered an error, just skip it; there's nothing more to do.
2020-01-16 13:19:21 -08:00
adrian-prantl
d52ec5d13f Merge pull request #29139 from adrian-prantl/55412775
Reflection: Implement a TypeRef -> Demangle tree adapter
2020-01-16 09:38:42 -08:00
Pavel Yaskevich
8269522f86 Merge pull request #28837 from xedin/rdar-56340587
[ConstraintSystem] Delay constraint generation for single-statement closure body
2020-01-16 00:29:11 -08:00
Adrian Prantl
ea2b5eced9 Reflection: Implement a TypeRef -> Demangle tree adapter.
To allow more pervasive use of TypeRefs in LLDB, we need a way to build mangled
names from TypeRef pointers to allow round-tripping between TypeRefs and AST
types. The goal is to experiment with making lldb::CompilerType backed by
TypeRefs instead of AST types.

<rdar://problem/55412775>
2020-01-14 17:50:01 -08:00
Rintaro Ishizaki
0aa3125b62 [Testing] Eliminate REQUIRES-ANY usage
REQUIRES-ANY is deprecated and being removed. Use boolean expressions.

rdar://problem/58549266
2020-01-14 10:21:49 -08:00
Pavel Yaskevich
30876a42de [TypeChecker] NFC: Mark test-case for rdar://problem/22022980 as "slow"
It used to be "fast" before because `selectDisjunction` used to pick
inner `==`s before outer one (which compares arrays) but now, since
constraint generation for the closure body is delayed, it looks
like the opposite is happening which makes this test-case go exponential.
2020-01-14 00:09:33 -08:00
Pavel Yaskevich
09e45823e2 [Diagnostics] NFC: Adjust test-cases improved by changes to closure expression handling 2020-01-14 00:09:33 -08:00
Pavel Yaskevich
3f1083e6c3 [TypeChecker] NFC: Mark perf test-case for rdar://problem/20959612 as "fast"
This test-case has been improved by changes in closure expression
handling in constraint system, because the bodies are going to be
opened in order, the nesting yields linear performance.
2020-01-14 00:09:33 -08:00
Rintaro Ishizaki
4ced714e25 [CodeCompletion] Allow type variable in MakeAbstractConformanceForGenericType
When typesSatisfyConstraint() is called with 'openArchetypes=true',
archetypes are substituted with type variables. If they have
conformances, they used to hit assertion in
'MakeAbstractConformanceForGenericType::operator()'.

Adjust the assetion to accept 'TypeVariableType'.

rdar://problem/56834798
2020-01-09 23:18:27 -08:00
Luciano Almeida
27b01e3eb0 [test] Adding validation test for generic function match 2020-01-09 14:10:37 -03:00
Joe Groff
509735ea66 IRGen: Work around RemoteMirror bug generating reflection info for empty builtin types.
The RemoteMirror library in shipping versions of macOS/iOS/tvOS/watchOS crashes if the compiler
emits a BuiltinTypeDescriptor with size zero. Although this is fixed in top-of-tree RemoteMirror,
we want binaries built with the new compiler to still be inspectable when run on older OSes.
Generate the metadata as an empty struct with no fields when deploying back to these older
platforms, which should be functionally equivalent for most purposes.
Fixes rdar://problem/57924984.
2020-01-06 19:32:43 -08:00
Karoy Lorentey
b7e08accb1 [stdlib] Slice: customize withContiguous[Mutable]StorageIfAvailable (#28883)
* [stdlib] Slice: customize withContiguous[Mutable]StorageIfAvailable

We can easily make an UnsafeBufferPointer that slices another UnsafeBufferPointer, so let’s allow Slice to vend a slice of the base collection’s contiguous storage, if it provides access to one.

We need to do some index distance calculations to implement this, but those will be constant-time in the usual case where the base collection is a RAC.

https://bugs.swift.org/browse/SR-11957
rdar://58090587

* [test] UnsafeBufferPointer: fix some warnings

* [stdlib] Slice: don’t calculate index distances unless the base provides contiguous mutable storage
2020-01-06 12:32:30 -05:00
Rintaro Ishizaki
091c36bc82 [CodeCompletion] Evaluate 'PatternBindingEntry' before checking the init
If a completion happens in an 'PatternBindingInitializer' context for
'TypedPattern' without any 'VarDecl', e.g.:

    let _: Int = <COMPLETION>

it crashes because 'typeCheckPatternBinding()' requires that the
'TypedPattern' has the type.

rdar://problem/52105899
2019-12-25 16:30:52 -08:00