Commit Graph

17988 Commits

Author SHA1 Message Date
swift-ci
dfb3830650 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 17:08:32 -07:00
Doug Gregor
5b755412e5 [Stdlib] Eliminate LazyFilterIndex.
Eliminate the vestigial type `LazyFilterIndex`, which was
necessary pre-Swift-3 to allow the index to move. Swift 3's indexing
model means that the movement of indices is on the collection itself,
so we no longer need `LazyFilterIndex`: instead, the `Index` type of
the lazy filtered collection is simply the `Index` type of the base
collection, which is a nice convenience: it means you can take indices
from a lazy wrapper around a given collection C and use them with the
collection C (and, with care, vice-versa) without jumping through
extra hoops.
2017-04-20 16:56:21 -07:00
Nathan Hawes
0127469a27 Merge pull request #8889 from nathawes/rdar31665007-index-memberwise-init-arglabels-as-property-references
[indexer] Index the the arg labels of memberwise initializers as references to the properties they correspond to
2017-04-20 16:53:32 -07:00
swift-ci
a2162ae6a3 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 16:48:31 -07:00
Erik Eckstein
43ecc02397 Disable a failing test.
rdar://problem/31746923
2017-04-20 16:44:45 -07:00
Michael Ilseman
8b5777fdd2 [stdlib] Bug fix in reverse ASCII grapheme breaking
Fix a bug using wrong index calculations in the ASCII grapheme
breaking fast path. Add new test case.
2017-04-20 16:22:18 -07:00
Doug Gregor
70ee642072 [Stdlib] Eliminate LazyFilterIndex.
Eliminate the vestigial type `LazyFilterIndex`, which was
necessary pre-Swift-3 to allow the index to move. Swift 3's indexing
model means that the movement of indices is on the collection itself,
so we no longer need `LazyFilterIndex`: instead, the `Index` type of
the lazy filtered collection is simply the `Index` type of the base
collection, which is a nice convenience: it means you can take indices
from a lazy wrapper around a given collection C and use them with the
collection C (and, with care, vice-versa) without jumping through
extra hoops.
2017-04-20 16:15:41 -07:00
Nathan Hawes
4db092ec81 [migrator] Add test for objc inference changes (fixit migration) 2017-04-20 15:30:02 -07:00
Roman Levenstein
e1c3538ecb redundundant-overflow-check-removal improvements
- Code-refactoring
- Support for comparison followed by a cond_fail
- Correctness fixes for relation propagation
2017-04-20 15:28:23 -07:00
Roman Levenstein
2326cb7f38 [constant-propagation] Simplify comparisons with Int.max
Make use of the following inequalities:
1) Int.max >= X, X <= Int.max are always true for any signed integer X
2) Int.max < X, X > Int.max are always false for any signed integer X
3) For any X of the same size as Int.max and any n>=1 , (X>>n) is always <= Int.max, that is (X>>n) <= Int.max and Int.max >= (X>>n) are always true.
     At the same time (X>>n) > Int.max and  Int.max < (X>>n) is always false.
4)  X < 0 is always false, if X is known to be a result of an unsigned operation with overflow checks enabled.
     X >= 0 is always true, if X is known to be a result of an unsigned operation with overflow checks enabled.
2017-04-20 15:27:59 -07:00
Roman Levenstein
616ef49d57 [sil-combine] Handle more patterns in cond_br conditions
Add the following peepholes:
cond_br(x == 0), t_label, f_label -> cond_br x, f_label, t_label
cond_br (x != 1), t_label, f_label -> cond_br x, f_label, t_label
2017-04-20 15:27:49 -07:00
Roman Levenstein
315b2aba49 [sil-combine] Canonicalize boolean equality checks
Convert i1_const != X to X != i1_const.
Convert i1_const == X to X == i1_const.
2017-04-20 15:27:40 -07:00
Devin Coughlin
77611e6ef9 [Exclusivity] Add best-effort static checking for class stored properties.
Add a simple, best-effort static check for exclusive access for stored
class properties. For safety these properties must be checked dynamically,
also -- but we'll now diagnose statically if we see an obvious violation.
2017-04-20 14:27:09 -07:00
Max Moiseev
fc134ae1df Fixing the test 2017-04-20 14:18:20 -07:00
Nathan Hawes
081500a4d0 [indexer] Index the the arg labels of memberwise initializers as references to the properties they correspond to
Resolves rdar://problem/31665007
2017-04-20 13:28:50 -07:00
Brian King
37266d85e1 Verify behavior of Swift 3 and Swift 4 final protocol extension behavior 2017-04-20 16:06:02 -04:00
swift-ci
34f3319946 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 12:48:38 -07:00
Xi Ge
b089bab40e swift-api-digester: avoid reporting moved constructors. rdar://31694119 (#8885)
They don't make more sense than renamed decls.
2017-04-20 12:48:17 -07:00
swift-ci
156915f005 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 12:28:30 -07:00
swift-ci
0b3544b4fa Merge pull request #8874 from devincoughlin/mark-uninitialized 2017-04-20 12:25:03 -07:00
David Farler
4c601828c9 Merge pull request #8873 from bitjammer/migrator-editor
[Migrator] Add adapter for clang lib/Edit textual edits
2017-04-20 12:22:09 -07:00
David Farler
012d511d54 Merge pull request #8823 from mxswd/quickhelp-xml
Updated quick help XML to separate the comment data from the metadata
2017-04-20 12:20:46 -07:00
swift-ci
1d46e688db Merge pull request #8510 from phausler/data_slice_fixes 2017-04-20 12:12:16 -07:00
swift-ci
0475733f45 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 11:48:33 -07:00
Roman Levenstein
a707e7c9df Merge pull request #8883 from swiftix/eager-specializer-fixes
[eager-specializer] Fix a bug in eager specialization of throwing functions
2017-04-20 11:39:04 -07:00
swift-ci
6225602e62 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 11:28:53 -07:00
swift-ci
aac809b95a Merge pull request #8882 from eeckstein/sil-di-printing 2017-04-20 11:06:43 -07:00
David Farler
9701d94f15 [Migrator] Add adapter for clang lib/Edit textual edits
This adds an adapter class that wraps Clang's lib/Edit
Commit and EditedSource classes for use in the initial
"syntactic" passes. Once the passes have completed,
the resulting source file is then passed to the Swift compiler
fix-it passes.

rdar://problem/30926261
2017-04-20 10:54:22 -07:00
Maxim Moiseev
10da98abb9 Merge pull request #8851 from moiseev/integer-fixes
[stdlib] A few Swift 3 compatibility fixes
2017-04-20 10:45:02 -07:00
Roman Levenstein
a7fd8cd359 [eager-specializer] Fix a bug in eager specialization of throwing functions
Properly handle the case when a function being specialized may throw according to its type, but does not actually do it in its body.

Fixes rdar://problem/31694581
2017-04-20 10:38:28 -07:00
Arnold Schwaighofer
599cca2f1b ASTContext: Add trivially representable types even if we loaded their library later
Add CGFloat (and other types that this applies to) as a trivial type even after
the one-time initialization of the ForeignRepresentableCache.

This allows

  let str = ""
  import Foundation
  let pt = CGPoint(x: 1.0, y: 2.0)

to work.

Before we would populate the cache the first time on the first line "let str =
..." and because the CoreGraphics module was not loaded we would not add CGFloat
as a trivial type. When we come to query for CGFloat on the third line we would
return NSNumber instead of CGFloat as a type and that would crash IRGen.

rdar://31610342
2017-04-20 09:35:06 -07:00
Erik Eckstein
d4db9b8099 SILPrinter: make the printing of debug info optional.
With the option -sil-print-debuginfo the printing of debug locations and scopes can be enabled.

I made the default for the option “false”, because in 99% of the time I don’t need the debug info in the printed SIL and I prefer better readability.
2017-04-20 09:18:08 -07:00
Maxwell Swadling
d7949f03c8 Merge remote-tracking branch 'origin/master' into quickhelp-xml
Conflicts:
	test/SourceKit/DocSupport/doc_clang_module.swift.response
2017-04-20 09:17:48 -07:00
Joe Groff
c742f88434 Work around a bug in the closure specializer with methods that return Self and take closure arguments (rdar://problem/31725007) 2017-04-20 08:53:55 -07:00
swift-ci
112b402e1b Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 08:28:31 -07:00
Roman Levenstein
1d3d5d7d43 Merge pull request #8867 from moiseev/sil-test
[test] UnXFAILing and fixing SILOptimizer/eager_specialize.sil test
2017-04-20 08:11:39 -07:00
swift-ci
faa74d7167 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 01:48:41 -07:00
Slava Pestov
16b033c111 Merge pull request #8876 from slavapestov/subclass-existentials-sema-casts
Update Sema cast checks for subclass existentials... and more!
2017-04-20 01:28:53 -07:00
swift-ci
b733669ef5 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 01:08:30 -07:00
swift-ci
0f4ebfd66e Merge pull request #8593 from DougGregor/stdlib-se-0142 2017-04-20 00:49:04 -07:00
swift-ci
ed81ed9480 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 00:48:31 -07:00
Slava Pestov
191afb0e96 Fix a test on Linux 2017-04-20 00:37:40 -07:00
Slava Pestov
eb8b1ab3e1 Sema: Casts between unrelated optional types may succeed
... if the value is 'nil'!

Fixes <https://bugs.swift.org/browse/SR-3505>.
2017-04-20 00:37:39 -07:00
Slava Pestov
b1177f0413 Sema: Fix bogus "always fails" warnings with casts between generic classes
We would misreport a cast from G<T> to G<Int> or vice versa
as always failing, because we were checking for an exact
subtype relationship instead of archetype binding.

Fixes <https://bugs.swift.org/browse/SR-3609>.
2017-04-20 00:37:39 -07:00
Slava Pestov
55df58d2a3 Sema: More accurate cast diagnostics for subclass existentials
Normally there is very little the type checker can conclude about
casts between existentials, because new conformances can be added
retroactively. However if the existentials are class-constrained,
we can rule out certain casts as always failing by looking at
superclass bounds.
2017-04-20 00:37:37 -07:00
Doug Gregor
a926beab5b [GSB] Hack to limit recursion in the type graph.
This stops after 5 recurrences of the same associated type. It is a
gross hack and a terrible idea, here as a placeholder to prevent us
from running off the rails in ill-formed code. This will go away when
we get further along the path with recursive protocol constraints.
2017-04-20 00:09:23 -07:00
Slava Pestov
88e48c901e Add test for SR-4378
This snippet type checks in Swift 4 mode, but not in Swift 3.

It used to work in Swift 3.0, so something broke when we
implemented SE-0110 and redid the Swift 3 mode emulation.
2017-04-20 00:07:06 -07:00
Doug Gregor
29a15ce402 [Stdlib] Apply SE-0142 to fix ABI FIXME #92, part of ABI FIXME #99. 2017-04-19 23:15:33 -07:00
Joe Groff
517c45aa3d Followups from merging master 2017-04-19 20:58:52 -07:00
Joe Groff
cdb54ccadf Put keypaths behind a flag. 2017-04-19 20:39:11 -07:00