Commit Graph

5277 Commits

Author SHA1 Message Date
Doug Gregor
719547f8df Merge pull request #23125 from DougGregor/constraint-solver-remove-sr-2505-hack
[Constraint solver] Remove a dubious hack introduced with SR-2505
2019-03-06 20:22:50 -08:00
swift-ci
8a7f2eaae9 Merge pull request #23146 from DougGregor/string-memory-test-faster 2019-03-06 18:13:09 -08:00
Doug Gregor
de13028f6b [StringMemoryTest] Reduce # of iterations down to 1M and lower memory threshold
This test is taking way too long. Cut down on the number of iterations
from 10M to 1M.
2019-03-06 16:59:32 -08:00
Slava Pestov
e0c29408eb This test only fails when asserts are on 2019-03-06 15:42:14 -05:00
Doug Gregor
4ee4124228 Reduce end condition for type checker performance test.
This test is technically scaling linearly in the metrics being
checked, but it was still taking 5+ minutes to type check. Reduce the
upper bound so it finishes in a reasonable amount of time.
2019-03-06 10:14:21 -08:00
Doug Gregor
098470ddb7 Update tests for the removal of the strange "Any" preference rule 2019-03-06 08:58:56 -08:00
Doug Gregor
fae2d1b2ac Merge pull request #23088 from DougGregor/solver-disjunction-favoring
[Constraint solver] Generalize disjunction favoring
2019-03-05 14:41:56 -08:00
Doug Gregor
daf4610be1 [Constraint solver] Don't remove/reintroduce disjunction when favoring.
When favoring particular constraints in a disjunction, don't remove
the old disjunction and create a new one---it's just churn in the
constraint system. Instead, favor the constraints that need it.

This technically flips the SR-139 test case from "too complex" to
being fast enough, but it's still fairly slow.
2019-03-04 20:31:06 -08:00
Doug Gregor
c8d7059863 Merge pull request #23012 from DougGregor/apply-filter-disjunctions
[Constraint solver] Do argument label matching during apply simplification
2019-03-02 16:09:41 -08:00
Doug Gregor
a6902cc5a7 Add a "slow" type checker performance test for rdar://problem/46713933 2019-03-02 10:46:41 -08:00
Doug Gregor
6d8cdaf64c The test case from rdar://problem/20818064 is now scaling well. 2019-03-02 10:11:33 -08:00
Slava Pestov
c47683cdeb Add failing test case for GSB bug 2019-03-01 21:01:51 -05:00
Jordan Rose
7a509422b3 [test] sil-opt doesn't support -Fsystem; use -F
Fix-up for bb0f0c8397 (rdar://problem/48513002).
2019-03-01 17:23:56 -08:00
Jordan Rose
bb0f0c8397 [test] -Fsystem $SDK/System/Library/PrivateFrameworks (#23019)
Otherwise certain modules don't import correctly when built against an
Apple-internal SDK. Should have no effect when using the public SDK,
but we try to minimize divergence between the public and
Apple-internal test suites.

rdar://problem/48513002
2019-03-01 14:26:20 -08:00
Karoy Lorentey
b36c77c042 Merge pull request #22998 from apple/revert-22903-xfail-dictionary-invalidation-test
Revert "[test] Dictionary: Skip a failing index validation test"
2019-02-28 17:01:37 -08:00
Jordan Rose
8521015407 [test] Add proper search paths for XCTest in verify_all_overlays.py (#22994)
This turns out to be the only problem on iOS and tvOS. Oops! macOS
still has some actual failing overlays as tracked by SR-9847.

(We should also add this search path to
ParseableInterface/verify_all_overlays.py.)

rdar://problem/48458622
2019-02-28 15:04:11 -08:00
Karoy Lorentey
3356b2aca4 Revert "[test] Dictionary: Skip a failing index validation test" 2019-02-28 14:16:38 -08:00
Karoy Lorentey
6836cf8e09 [test] Disable two more collection tests in unoptimized builds 2019-02-27 18:33:19 -08:00
Karoy Lorentey
a7f9894f5a [test] Dictionary: Skip a test that currently fails when compiled with -O
rdar://problem/47973577
2019-02-25 16:03:23 -08:00
Jordan Rose
d17602a847 [test] Un-XFAIL a test for watchOS (#22813)
Whatever bug is happening in https://bugs.swift.org/browse/SR-9847,
the watchOS overlays aren't hitting it.

rdar://problem/48280638
2019-02-25 09:41:22 -08:00
Slava Pestov
3300d1a73a Merge pull request #22834 from slavapestov/fix-optimized-test-failures
Fix a couple of check-swift-validation-optimize test failures
2019-02-23 07:38:40 -05:00
Slava Pestov
b9bda84e28 SIL: Fix calls of @_weakLinked functions from serialized SIL
We have to set the SILFunction's 'weakLinked' flag in the defining
module too, so that it can be serialized. Otherwise when we
deserialize it we are not weak linking calls to the function.
2019-02-22 21:10:18 -05:00
Slava Pestov
2633c9d063 Fix old_runtime_crash_without_fixed_layout.swift to pass when optimizations are on
@_optimize(none) does not prevent LLVM from optimizing the function, and the LLVM
optimizer was able to inline blackHole() and elide the metadata access altogether.
2019-02-22 21:10:18 -05:00
Slava Pestov
d0d5fbdf39 ASTDemangler: Introduce new getTypeDeclForMangling()
This will replace getDeclFromMangledSymbolName().

Progress on <rdar://problem/47819208>.
2019-02-22 16:13:02 -05:00
Slava Pestov
71ab1bbe77 IRGen: Fix isResilientConformance() check
If the conforming type is generic, we have to treat the conformance as
resilient if it is defined outside of the current module.

This is because it can resiliently change from being non-dependent
to dependent.
2019-02-20 20:00:46 -05:00
Jordan Rose
43feb9cbe1 On Apple platforms, use swiftmodule directories for the stdlib (#21797)
This changes the Swift resource directory from looking like

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          x86_64/
            Swift.swiftmodule
            Swift.swiftdoc
            Darwin.swiftmodule
            Darwin.swiftdoc

to

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          Swift.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc
          Darwin.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc

matching the layout we use for multi-architecture swiftmodules
everywhere else (particularly frameworks).

There's no change in this commit to how Linux swiftmodules are
packaged. There's been past interest in going the /opposite/ direction
for Linux, since there's not standard support for fat
(multi-architecture) .so libraries. Moving the .so search path /down/
to an architecture-specific directory on Linux would allow the same
resource directory to be used for both host-compiling and
cross-compiling.

rdar://problem/43545560
2019-02-19 14:47:21 -08:00
Michael Ilseman
f87960746c Merge pull request #22108 from milseman/en_gadus_offset
[String.Index] Obsolete encodedOffset var/init
2019-02-19 14:43:26 -08:00
David Zarzycki
65a452f764 Merge pull request #22689 from davezarzycki/fix_overloaded_generics_crash
[Sema] NFC: fix assert-only crasher with overloaded generics
2019-02-19 08:21:43 -05:00
Slava Pestov
6ac91701dd Runtime: Add precondition check to swift_updateClassMetadata()
This initialization pattern can only be used if there is a backward deployment
layout (IRGen calls this ClassMetadataStrategy::FixedOrUpdate) or if we are
running on a newer Objective-C runtime that supports class metadata update
hooks (IRGen calls this ClassMetadataStrategy::Update).

If neither condition holds, we must trap here to avoid undefined behavior.
2019-02-18 22:39:13 -05:00
Slava Pestov
eec0fcdf49 IRGen: When available, use ClassMetadataStrategy::Update even if we don't have legacy type info
If we know our deployment target has a new Objective-C runtime, we can
emit fixed metadata for classes with resilient types even if those
types do not appear in the YAML legacy type info.

Fixes <rdar://problem/47649465>.
2019-02-18 22:39:13 -05:00
David Zarzycki
51ef3c014a [Sema] NFC: fix assert-only crasher with overloaded generics 2019-02-18 08:49:42 -05:00
Max Moiseev
01491ca9d4 Merge pull request #22633 from moiseev/do-not-verify
This test does not verify anything, so typechecking is enough
2019-02-15 09:08:22 -08:00
Maxim Moiseev
9483ad43b3 This test does not verify anything, so typechecking is enough
Related to <rdar://problem/48094005>
Fixes: <rdar://problem/48056095>
2019-02-14 16:50:29 -08:00
Michael Ilseman
e53b719f2e [test] Disable UnicodeLongTest.swift on watchos (#22606)
[test] Disable UnicodeLongTest.swift on watchos
2019-02-14 15:13:35 -08:00
Mishal Shah
5d8286f882 Merge pull request #22608 from xedin/rdar-48061151
[TypeChecker] Disable perf test-case for rdar://problem/21398466
2019-02-14 00:14:19 -08:00
Pavel Yaskevich
43c547b0b8 [TypeChecker] Disable perf test-case for rdar://problem/21398466
Looks like obsoleted initializer has been removed,
and there are no solutions available for 'init(truncatingBitPattern:)'
which leads to performance regression with designated types enabled.

Resolves: rdar://problem/48061151
2019-02-13 21:07:42 -08:00
Michael Ilseman
415cc8fb0c [String.Index] Deprecate encodedOffset var/init
String.Index has an encodedOffset-based initializer and computed
property that exists for serialization purposes. It was documented as
UTF-16 in the SE proposal introducing it, which was String's
underlying encoding at the time, but the dream of String even then was
to abstract away whatever encoding happend to be used.

Serialization needs an explicit encoding for serialized indices to
make sense: the offsets need to align with the view. With String
utilizing UTF-8 encoding for native contents in Swift 5, serialization
isn't necessarily the most efficient in UTF-16.

Furthermore, the majority of usage of encodedOffset in the wild is
buggy and operates under the assumption that a UTF-16 code unit was a
Swift Character, which isn't even valid if the String is known to be
all-ASCII (because CR-LF).

This change introduces a pair of semantics-preserving alternatives to
encodedOffset that explicitly call out the UTF-16 assumption. These
serve as a gentle off-ramp for current mis-uses of encodedOffset.
2019-02-13 18:42:40 -08:00
Karoy Lorentey
e806809634 Merge pull request #22485 from lorentey/disable-long-running-tests
[test] Require optimized stdlib for CollectionOfRef validation tests
2019-02-13 18:36:05 -08:00
Ben Cohen
f15892c1a8 Merge pull request #22288 from airspeedswift/safe-conversion
[stdlib] Remove overly-permissive UnsafePointer init
2019-02-12 11:47:06 -08:00
swift-ci
498b72270b Merge pull request #22527 from Catfish-Man/literally-empty 2019-02-11 22:35:33 -08:00
Andrew Trick
638c3ea21c Merge pull request #22521 from atrick/fix-nil-buffer
Fix crashes in Unsafe[Raw]BufferPointer with nil baseAddress.
2019-02-11 22:00:43 -08:00
David Smith
490325c057 Update Dictionary test expectations too 2019-02-11 21:24:33 -08:00
David Smith
f2c398c74a Update test expectations around Set storage identifiers 2019-02-11 18:41:14 -08:00
Slava Pestov
c8effd26b3 Merge pull request #22408 from slavapestov/always-use-legacy-layouts
Always use legacy layouts
2019-02-11 19:10:02 -05:00
Andrew Trick
28a529ceed Fix crashes in Unsafe[Raw]BufferPointer with nil baseAddress.
This fix updates various initializers to handle incoming empty buffers
that happen to have a nil base. They should simply create another
buffer with nil base rather than crashing!

It is valid for an Unsafe[Raw]BufferPointer can have a nil base
address. This allows round-tripping with C code that takes a
pointer/length pair and uses `0` as the pointer value.

The original design wrongly assumed that we would use a sentinel value
for empty buffers and was never updated for or tested with the current
design.

Fixes <rdar://problem/47946984> Regression in Foundation.Data's
UnsafeBufferPointer constructor.
2019-02-11 13:38:48 -08:00
Ben Cohen
0f339d3663 Merge branch 'master' into safe-conversion 2019-02-11 12:58:51 -08:00
Slava Pestov
dc3abd14c3 MetadataReader: Add support for Objective-C tagged pointers (#22498)
This allows Remote Mirrors and RemoteAST to inspect existentials
containing instances of imported classes.
2019-02-10 12:23:37 -05:00
Karoy Lorentey
447da103e0 [test] Regenerate CollectionOfRef validation tests 2019-02-08 15:01:27 -08:00
Karoy Lorentey
6859d056a4 [test] Collection tests with reference types should also require optimized stdlib 2019-02-08 15:00:02 -08:00
Slava Pestov
32954fc463 Use -read-legacy-type-info-path in Runtime/class-layout-from-objc.m test 2019-02-08 14:22:00 -05:00