Commit Graph

7628 Commits

Author SHA1 Message Date
Mishal Shah
5210c3b38f Merge pull request #35663 from apple/pr-rebranch
Support new changes from swift/rebranch on llvm-project repo
2021-02-01 17:42:27 -08:00
Daniel Rodríguez Troitiño
748339a83a [test] Mark concurrency tests with appropiate REQUIRES. (#35624)
The Python build system always enables concurrency, but CMake has it
disable by default. Collaborators that do not use the Python build
system and use directly CMake will have it disable, unless they
explicitely enable it. If the tests are not marked as requiring the
concurrency features, the tests will fail to execute when concurrency is
disabled.

The changes add the `REQUIRES: concurrency` line to many tests that deal
with concurrency, but wasn't marked as such.
2021-02-01 11:45:15 -08:00
Alexis Laferrière
f576bebaf1 [Tests] Disable process-stats-dir.py related tests 2021-02-01 10:22:10 -08:00
David Zarzycki
716e38c572 [Testing] NFC: Make BoxingCasts test concurrent
This test is the slowest test on my machine.
2021-02-01 08:11:50 -05:00
Michael Gottesman
6e61279dec Merge pull request #35587 from gottesmm/pr-5db2d0b093c814bacaaf559563926c5dec16acc3
[ast] Enable the ASTVerifier behind the enable-ast-verifier flag in no-asserts builds.
2021-01-27 10:13:54 -08:00
Alexis Laferrière
fe4d46cea9 Merge pull request #35590 from xymus/reword-module-build-error
[ModuleInterface] Update wording of the "failed to build module" error
2021-01-26 18:52:24 -08:00
Alexis Laferrière
b79c7b627b [ModuleInterface] Update wording of the "failed to build module" error
The error shown when the compiler fails to build a module from its
textual interface has been creating some confusion. This is a proposal
to make it more useful to the programmer not working in the SDK, insist
on looking at the previous errors first, put less emphasis on possible
compiler bugs, and always show alternatives to the incompatible
compilers issue as this is the most common case now.
2021-01-26 15:36:46 -08:00
Michael Gottesman
1de2d3f7c0 [ast] Enable the ASTVerifier behind the enable-ast-verifier flag in no-asserts builds.
This follows the design of how we handled this with
sil-verify-all. Specifically, the default behavior is to run only in asserts
builds, but one can use the two flags: enable-ast-verifier and
disable-ast-verifier to override the default behavior.

The reason why this is interesting is that this means that when compiling
normally, we will not run the verifier, so we won't have a perf hit. But we can
now ask the user to run with this flag (or in a future maybe a re-run in the
driver would do this for them), saving us time when screening bugs by avoiding
the need to build an asserts compiler to triage if the ASTVerifier would catch
the bug.
2021-01-25 11:55:47 -08:00
tbkka
35dad1161a Fix reflection_Optional_Any to support non-Apple platforms (#35546)
* Fix reflection_Optional_Any to support non-Apple platforms

Apple and non-Apple platforms happen to use different number
of extra inhabitants in 64-bit pointers.  This is already
supported by the test framework, we just need to fill it in
properly for this one test.

* Remove OS= restriction
2021-01-22 11:51:37 -08:00
Robert Widmann
d4f92d4116 Merge pull request #35527 from CodaFi/context-clues
Use the Correct DeclContext When Simplifying Member Constraints
2021-01-20 19:07:28 -08:00
Robert Widmann
0943351fe7 Use the Correct DeclContext When Simplifying Member Constraints
Looking for the parent source file is going to fail when the paramter
we're interested in comes from a module context. Request the correct
top-level context in those situations.

rdar://73379770
2021-01-20 15:42:35 -08:00
David Zarzycki
ab2f6c701b [Testing] Unbreak unified build testing
This test assumes an Apple platform but for reasons unknown, the Linux
bots (wrongly?) consider this test to be unsupported.
2021-01-20 08:51:06 -05:00
Dave Lee
e843c72ff9 Merge pull request #35433 from apple/Reflection-Support-OpaqueExistential-in-RecordTypeInfo-readExtraInhabitantIndex
[Reflection] Support OpaqueExistential in RecordTypeInfo::readExtraInhabitantIndex
2021-01-19 20:17:52 -08:00
Tim Kientzle
cb1173d928 More test adjustments 2021-01-19 14:15:07 -08:00
Tim Kientzle
7f8bebb467 Merge branch 'Reflection-Support-OpaqueExistential-in-RecordTypeInfo-readExtraInhabitantIndex' of https://github.com/apple/swift into Reflection-Support-OpaqueExistential-in-RecordTypeInfo-readExtraInhabitantIndex 2021-01-19 12:32:10 -08:00
Tim Kientzle
73db0134c8 Rename test case, fix typos 2021-01-19 12:29:45 -08:00
Dave Lee
7ed7122c6b test fixes 2021-01-19 12:27:32 -08:00
Dave Lee
340b85fe03 add reflect_Optional_Any.swift
Authored by Tim Kientzle @tbkka
2021-01-19 10:06:48 -08:00
Luciano Almeida
1d7d282065 Merge pull request #35255 from LucianoPAlmeida/SR-12383
[SR-12383][Diagnostics] Do not use canonical type for aka diagnostics instead walk the type recursivelly desugaring
2021-01-19 08:19:00 -03:00
Slava Pestov
c8aee4180e Sema: Fix a couple of crash-on-invalid problems with class inheritance
It is possible for ClassDecl::getSuperclassDecl() to succeed but for
ClassDecl::getSuperclass() to fail. This happens if the superclass is
a generic type and one of the generic arguments could not be resolved,
or does not satisfy the generic requirements, for example; in that
case, a BoundGenericType cannot be formed.

In a couple of places we were not prepared for this possibility.
Let's recover by making judicious use of ErrorType.

Fixes <rdar://problem/73169149>.
2021-01-17 18:06:13 -05:00
Varun Gandhi
b263e99d71 Merge pull request #35367 from mininny/simplify-unused-lvalue-wording
[Diagnostics] Simplify unused lvalue warning wording
2021-01-16 14:29:43 -08:00
Minhyuk Kim
7eaabe1996 Simplify unused lvalue warning wording 2021-01-15 22:14:56 +09:00
Robert Widmann
a4d76261f0 Pass -target to lit Tests instead of -arch
A follow-on to b436825948 where
-m${platform}-version-min was traded for -target. The lit substitution
for %target-clang was relying on -arch and -version-min to specify the
intended platform version to the linker. With the removal of
version-min, only arch was given, so a fallback platform was selected.
For the iPhone simulator, for example, this is iOS 10.99 despite there
being no such simulator for that deployment version. Provide the variant
triple everywhere instead. This has the added benefit of unifying the
special paths catalyst takes.

Fixes rdar://73174820
2021-01-14 13:33:30 -08:00
Luciano Almeida
b9dec7da4c [test] Adjusting tests for generic parameters that are now being aka on diagnostics 2021-01-14 17:44:52 -03:00
Ben Barham
86c292c10c [Test] Temporarily disable tests blocking PR testing 2021-01-14 12:09:14 +10:00
Anthony Latsis
afcb1665f8 GSB: Handle concrete ResolvedTypes in ArchetypeType::resolveNestedType()
A nested type of an archetype type might be concrete, for example, via a
same-type constraint:

extension SomeProtocol where SomeAssoc == Int {
  ... Self.SomeAssoc ...
}

This can happen in one of two ways; either the EquivalenceClass of the
nested type has a concrete type, or it is "fully concrete" because
there is no equivalence class and maybeResolveEquivalenceClass() returns
a ResolvedType storing the concrete type.

For some reason we didn't handle the second case here.

Fixes https://bugs.swift.org/browse/SR-13519 / rdar://problem/68531679
2021-01-12 23:52:44 -05:00
Andrew Trick
677424b337 Merge pull request #35315 from atrick/fix-settestlifetime
Add a _fixLifetime to stdlib/Set.swift test.
2021-01-08 21:16:17 -08:00
Andrew Trick
0aa91f46ec Add a _fixLifetime to stdlib/Set.swift test.
On Linux with -O:

[ RUN      ] Set.formSymmetricDifference
stdout>>> check failed at /Users/docker_user/src/build/buildbot_linux/swift-linux-x86_64/main.swift, line 3245
stdout>>> unexpected value: "94788628116752" (of type Swift.Int)
[     FAIL ] Set.formSymmetricDifference

The test is roughly:

  var s1 = Set(...)
  let s1_copy = s1

  let identity1 = s1._rawIdentifier()
  s1.someMutatingMethod1()

  check(s1)
  check(s1_copy)

  s1.someMutatingMethod2()

  // Mutating the set should cause an identity change
  releaseAssert(identity1 != s1._rawIdentifier())

On Linux, the optimizer is able to destroy s1_copy before the call to
s1.someMutatingMethod2(), which generates new Set storage. This new
storage uses the same address as the destroyed s1_copy.

Fixes rdar://72933150 ([CanonicalOSSA] Fix Set.swift unit test that assumes object lifetime)
2021-01-08 11:52:33 -08:00
Karoy Lorentey
4b2f032fac [test] Disable tests for newly introduced Range behavior on earlier OSes 2021-01-06 13:03:58 -08:00
Mike Ash
4ccfdfb72a [Runtime] Fix StableAddressConcurrentReadableHashMap threading crash.
StableAddressConcurrentReadableHashMap::getOrInsert had a race condition in the first lookup, where the snapshot was destroyed before the pointer was extracted from the returned wrapper. Fix this by creating the snapshot outside the if so that it stays alive.

rdar://problem/71932487
2020-12-21 16:52:56 -05:00
Pavel Yaskevich
e985d97e05 Merge pull request #35127 from xedin/rdar-38378503
[TypeChecker] Un-XFAIL perf test-case for rdar://23620262
2020-12-18 10:45:01 -08:00
David Zarzycki
238413d349 [testing] add missing REQUIRES: concurrency 2020-12-17 09:03:04 -05:00
Nate Chandler
d2726c31bb [Async CC] Don't lookup known archetype conformance.
Previously, when saving NecessaryBindings for an async function, if a
type that was passed-in happened to be an archetype, a lookup for that
type's conformance would always be done.  However, that lookup was not
always necessary or possible such as in the case where both the metadata
and the witness table were provided to the function in an async context.
Here, that is fixed by using the conformance that was seen when
constructing the NecessaryBindings if one is available.

rdar://problem/72397303
2020-12-16 17:20:31 -08:00
Pavel Yaskevich
0d040e2420 [TypeChecker] Un-XFAIL perf test-case for rdar://23620262 2020-12-16 12:04:15 -08:00
Pavel Yaskevich
c6bdeea852 [ConstraintSystem] Strengthen dependent member type checks while inferring bindings
Look through specifier (inout, l-value) and optional types while
checking for presence of dependent member types to avoid inferring
incorrect bindings (which could lead to infinite recursion in the
solver).

Resolves: SR-13856
Resolves: rdar://problem/71383770
2020-12-14 16:39:13 -08:00
Nate Cook
c35b567001 Temporary removal of RangeSet/DiscontiguousSlice (#35076) 2020-12-14 08:42:01 -06:00
Karoy Lorentey
8082b58365 Merge pull request #34961 from lorentey/buffers-need-to-be-fast-but-not-too-fast
[stdlib] Review and fix some problems with unsafe buffer and Range initialization
2020-12-12 19:13:20 -08:00
Zoe Carver
3dff6226e3 Merge pull request #28484 from zoecarver/optimize/mandatory-function-cleanup-pass
Remove dead function cleanup from mandatory inlining
2020-12-11 16:49:49 -08:00
zoecarver
6def04d360 Removes dead function cleanup from MandatoryInlining.
This will help reduce compile time in SourceKit (among others). Dead
function elimination will handle the removal of dead functions (not in
-Onone).
2020-12-10 09:18:16 -08:00
Arnold Schwaighofer
20dd3997de This test also fails in optimize size mode
rdar://71933996
2020-12-08 07:12:18 -08:00
Karoy Lorentey
c5c27c7c69 [stdlib] Add a missing debug precondition to [Closed]Range.init(uncheckedBounds:)
Unchecked APIs must still perform checks in debug builds to ensure that invariants aren’t violated.
(I.e., these aren’t a license to perform invalid operations — they just let us get rid of the checks when we know for sure they are unnecessary.)
2020-12-04 02:06:22 -08:00
Karoy Lorentey
7f63b42496 [test] ArrayTraps: Skip trap test on negative UBP counts in release builds 2020-12-04 02:06:21 -08:00
Arnold Schwaighofer
007c74f5ba Temporarily disable test in optimize mode
The test failed on oss-swift_tools-RA_stdlib-RD_test-simulator

rdar://71933996
2020-12-03 07:21:12 -08:00
Eric Miotto
8fc2598167 [build-script] Allow to tune dsymutil parallelism (#34795)
This should enable scaling when using machines with large amount of
RAM.

To better support machines with lower spec, process one binary per
dsymutil invocation (reverting #34149).

Add some (limited) facilities to gather the time taken to execute
dsymutil to better assist in tuning the parameter -- these are printed in
JSON format in the log to allow for easier scraping

```
{ "command": "dsymutil", "start": "2020-11-18T18:10:47" }
{ "command": "dsymutil", "end": "2020-11-18T18:14:45" }
```

Addresses rdar://71018443
2020-12-01 07:11:10 -08:00
David Zarzycki
0e650c1c89 [Testing] Add missing REQUIRES 2020-12-01 06:39:13 -05:00
eeckstein
d01aa21fdb Merge pull request #34867 from eeckstein/fix-escape-analysis
EscapeAnalysis: fix a quadratic behavior in ConnectionGraph::getNode
2020-12-01 10:02:35 +01:00
Nate Chandler
f33f1d3646 [Async CC] Always add full type metadata to bindings.
NecessaryBindings are used by both async functions and partial apply
forwarders.  The latter are able to avoid bindings in some cases because
a new function is generated where the information that would otherwise
be available in the bindings can be made available.  That is not the
case for async functions.  A generic async function requires all of the
metadata and witness tables be passed along to it: unlike a partial
apply forwarder it isn't in any way specialized so this information
can't be recovered.

Previously, metadata bindings were always passed along to async
functions.  However, destructuring that can be done for partial apply
forwarders was still being applied.  This resulted in an inappropriate
and unexpected number of bindings in NecessaryBindings.

Here, that destructuring is avoided for metadata passed to async
functions.

Now, the full metadata required by async functions are passed along to
them as necessary.

rdar://problem/71816041
2020-11-30 14:02:56 -08:00
Karoy Lorentey
b0eafeed9f Merge pull request #34665 from lorentey/runtime-error-message-format
[runtime] Adjust file/line information in fatal error messages to match compiler diagnostics
2020-11-30 11:46:49 -08:00
Erik Eckstein
f14916832f EscapeAnalysis: fix a quadratic behavior in ConnectionGraph::getNode
Fixes a compile time problem. The single linked list of merge targets in connection graph nodes can be very large.
Update the final merge target in the map, so that it has to be traversed only once for a given SILValue.

rdar://problem/71602804
2020-11-24 15:47:46 +01:00
Nate Cook
cae81eece0 Fix issues with discontiguous-slice assignment (#34708)
The mutating collection subscript for discontiguous slices assigns to the wrong group
of indices. This fixes the behavior and adds test coverage.

rdar://problem/70690643
2020-11-18 11:16:26 -06:00