Commit Graph

102667 Commits

Author SHA1 Message Date
Michael Gottesman
c0a866d1f6 Merge pull request #30227 from gottesmm/pr-d0ba712c9532bbdd21033e19354f8fb6b3bb253d
[semantic-arc-opts] load [copy] -> load_borrow if copy is completely enclosed in certain kinds of exclusive access scopes.
2020-03-05 09:45:22 -08:00
Michael Gottesman
d428d76f04 Merge pull request #30225 from gottesmm/pr-3ca0f543e9c626572476d6c0ffb789ef45166e54
[temp-rvalue] Add support for eliminating simple temp rvalues inited with a store when in ossa.
2020-03-05 09:44:42 -08:00
Pavel Yaskevich
8b6f66b245 Merge pull request #30223 from xedin/rdar-60048356
[ConstraintSystem] Preserve label matching rules in pattern matching …
2020-03-05 09:23:45 -08:00
Pavel Yaskevich
8ce5c7794b Merge pull request #30232 from xedin/rdar-60047439
[ConstraintSystem] Check availability as part of resolving overload c…
2020-03-05 09:23:04 -08:00
Dan Liew
86748ae6db Merge pull request #30193 from apple/rdar_58702902
Re-enable `asan_recover.swift` on Linux.
2020-03-05 08:12:12 -08:00
Doug Gregor
e780c194fc Merge pull request #30230 from DougGregor/function-builder-switch-checking
[Constraint system] Semantic checking for switch statements in function builders
2020-03-05 06:23:19 -08:00
Alexis Laferrière
34353b8a40 Merge pull request #30215 from xymus/spi-isnt-internal
[SPI] Requestify, inherit SPI groups and better diagnostics
2020-03-05 06:13:01 -08:00
swift-ci
690010353a Merge pull request #30236 from eeckstein/sil-docs 2020-03-05 05:57:38 -08:00
Erik Eckstein
a637b89c29 docs: add documentation for the [dynamic_lifetime] attribute of alloc_stack in SIL.rst 2020-03-05 13:12:08 +01:00
eeckstein
0544a88778 Merge pull request #30226 from gottesmm/pr-7685cba8a8fe94412c5e6edd32dc419c03252b39
[gardening] Add comments explaining what alloc_stack [dynamic_lifetime] means.
2020-03-05 11:38:42 +01:00
Pavel Yaskevich
4c600843d6 [ConstraintSystem] Check availability as part of resolving overload choice
This is a follow up to changes related to contextual availability
(https://github.com/apple/swift/pull/29921) which increased score
for unavailable declarations only if they were overloaded but
overlooked a case of a single unavailable choice.

Resolve: rdar://problem/60047439
2020-03-05 00:35:47 -08:00
Robert Widmann
d07ed46023 Merge pull request #30221 from CodaFi/existaxis
[CS] Use The Full Opened Type When Forming Subscripts
2020-03-04 23:33:35 -08:00
Pavel Yaskevich
87878a65eb [ConstraintSystem] Preserve label matching rules in pattern matching context
Since constraint system now handles pattern matching it has
to preverse label matching semantics which existed in original
code: if pattern element has a label it has to match the one
in the tuple type it's matched against.

Resolves: rdar://problem/60048356
2020-03-04 23:09:31 -08:00
Doug Gregor
c0cf407565 [Constraint solver] Check case variable mutability consistency. 2020-03-04 22:46:36 -08:00
Doug Gregor
3887498e55 [Constraint system] Diagnose @unknown cases in function builders. 2020-03-04 22:46:36 -08:00
Doug Gregor
c962e48b35 [Function builders] Test with an lvalue subject 2020-03-04 22:46:36 -08:00
Rintaro Ishizaki
36fb9c9302 Merge pull request #30229 from apple/revert-30217-zippered
Revert "TBDGen: pass-down target variant when generating textual interface stubs"
2020-03-04 22:23:52 -08:00
Rintaro Ishizaki
58d4868e42 Revert "TBDGen: pass-down target variant when generating textual interface stubs" 2020-03-04 22:01:24 -08:00
Slava Pestov
c3192a0757 Merge pull request #30220 from slavapestov/substitution-map-print-tweak
AST: Set PrintForSIL when printing replacement types in SubstitutionMaps
2020-03-04 23:59:48 -05:00
Michael Gottesman
0aecebd7c1 [semantic-arc-opts] load [copy] -> load_borrow if copy is completely enclosed in certain kinds of exclusive access scopes.
Specifically if we have a begin_access [read] or a begin_access [modify] that is
never actually written to. In that case if we can prove that the load [copy] is
completely within the exclusive access region, we will load_borrow. Example:

```
  %0 = begin_access [read] ...
  %1 = load [copy] %0
  ...
  destroy_value %1
  end_access %0
```

=>

```
  %0 = begin_access [read] ...
  %1 = load_borrow %0
  ...
  end_borrow %1
  end_access %0
```

rdar://60064692
2020-03-04 20:26:18 -08:00
Michael Gottesman
974f62a5c9 [gardening] Add comments explaining what alloc_stack [dynamic_lifetime] means.
Found the meaning by looking at when Definite Initialization marks alloc_stack
with that marker.

For those who are unware like me, it means the liveness of the value in the
alloc_stack is conditional in some way (i.e. conditional init, destroy, etc).
2020-03-04 19:57:40 -08:00
Michael Gottesman
04007f2583 Merge pull request #30201 from gottesmm/pr-6331d582c9865bfa1aca1fee9d93aeac11f93f4b
[ownership] Convert LiveRange to use Operands.
2020-03-04 19:42:44 -08:00
Michael Gottesman
0e19ae4871 [temp-rvalue] Add support for eliminating simple temp rvalues inited with a store when in ossa.
Specifically, we do not handle cases where we use projections,
open_existential_addr, or load_borrow. We should be able to handle those in the
future.

The best part is that ossa makes this really easy to do correctly.

rdar://60064817
2020-03-04 19:29:33 -08:00
swift-ci
6e7184287c Merge pull request #30204 from atrick/no-borrow-address 2020-03-04 19:23:46 -08:00
Davide Italiano
ab56d0df00 Merge pull request #30213 from dcci/separation-of-concerns
[build-script] Allow primary-variant-arch and primary-variant-sdk to …
2020-03-04 17:48:13 -08:00
Xi Ge
830c90feb9 Merge pull request #30217 from nkcsgexi/zippered
TBDGen: pass-down target variant when generating textual interface stubs
2020-03-04 17:40:48 -08:00
Robert Widmann
0a28307c41 [CS] Use The Full Opened Type When Forming Subscripts
The "opened type" of a subscript reference has all references to Self
immediately substituted out, which destroys the link between Self and
the opened existential type we form for the "fully opened type". This
means, in general, we cannot use this type when rewriting subscript
applies, or we'll miss closing opened existentials.

Use the "fully opened type" everywhere except the AnyObject subscript
path. Then, add an assertion that AnyObject subscripts never involve
opened archetypes that we would have to close.

Resolves SR-11748, rdar://57092093
2020-03-04 17:23:15 -08:00
Michael Gottesman
fced2398c5 [semantic-arc] Change LiveRange to work with Operand instead of Operand->getUser().
This is just better information to have since one wants to not only know the
instruction, but also the specific value used on the instruction since behavior
can vary depending upon that. The operand is what ties the two together so it is
a natural fit.

Now that this is done, I am going to work on refactoring out converting a
LiveRange from @owned -> @guaranteed. It will be a consuming operation using a
move operator since once the transformation has completed, the LiveRange no
longer exists.

I need this refactored functionality since I am going to need it when
eliminating phi-webs.
2020-03-04 17:07:48 -08:00
Michael Gottesman
15c7e3a56a Merge pull request #30200 from gottesmm/pr-f782df1b8f778cdddc48f8343fb0876f598f9012
[ownership] Remove BranchPropagatedUser.
2020-03-04 16:59:16 -08:00
Alexis Laferrière
2bbebcb180 [Sema] Remove invalid @_spi attributes 2020-03-04 16:43:05 -08:00
Alexis Laferrière
2b5fc3a8d7 [SPI Test] Test how modules can expose imported SPI through their SPI 2020-03-04 16:43:05 -08:00
Alexis Laferrière
480e8933d7 [SPI Test] Test @_implementationOnly compatibility with @_spi imports 2020-03-04 16:43:05 -08:00
Alexis Laferrière
412469326d [SPI Test] Extend and update SPI tests 2020-03-04 16:43:05 -08:00
Alexis Laferrière
26c6a18345 [Sema] Improve type-checking of the use and exposability of SPIs 2020-03-04 16:43:05 -08:00
Alexis Laferrière
c61cc6fe4e [AST] Add SPI information to public access scopes 2020-03-04 16:42:18 -08:00
Alexis Laferrière
fb1c71c651 [ASTPrinter] Skip SPI extensions too 2020-03-04 16:42:18 -08:00
Alexis Laferrière
65a0dc1754 [ASTPrinter] Print all SPI attributes, including the inherited ones 2020-03-04 16:42:18 -08:00
Alexis Laferrière
0a65a39ecb [ASTPrinter] Check if we should skip synthesized extensions 2020-03-04 16:42:18 -08:00
Alexis Laferrière
7bd585001a [AST] Intro and use isSPI and getSPIGroups 2020-03-04 16:42:18 -08:00
Alexis Laferrière
fd4feacb0d [AST] Intro request to list declared and inherited SPI groups 2020-03-04 16:41:54 -08:00
Slava Pestov
98902ef142 AST: Set PrintForSIL when printing replacement types in SubstitutionMaps
This prints opened existentials with @opened("...") rather than just printing
the erased existential type.
2020-03-04 19:32:14 -05:00
Andrew Trick
653a5aae2a Prevent begin_borrow on addresses and cleanup address access utils. 2020-03-04 16:32:08 -08:00
Xi Ge
6dde0e6abc TBDGen: pass-down target variant when generating textual interface stubs
rdar://60057760
2020-03-04 15:52:29 -08:00
Owen Voorhees
b8a87f651e Merge pull request #30206 from owenv/format-multiline-fixits
[Diag-Experimental-Formatting] Better rendering of multi-line fix-its
2020-03-04 15:34:16 -08:00
Rintaro Ishizaki
0dd56a9e51 Merge pull request #30216 from rintaro/disable-rdar59977439
Disable a flaky test case
swift-DEVELOPMENT-SNAPSHOT-2020-03-04-a
2020-03-04 15:14:05 -08:00
Rintaro Ishizaki
cf1ee044ef Disable a flaky test case
rdar://problem/59977439
2020-03-04 15:12:50 -08:00
Mike Ash
c1faaa5267 Merge pull request #30207 from mikeash/fix-objc-name-suffixes
[Runtime] Reject suffixes on ObjC mangled class names.
2020-03-04 17:05:16 -05:00
Saleem Abdulrasool
5310ee0f69 Merge pull request #30122 from compnerd/cartilege
build: remove reference to `handle_swift_sources` in C++ path
2020-03-04 13:15:59 -08:00
Davide Italiano
af29f5dd3a [build-script] Allow primary-variant-arch and primary-variant-sdk to be set independently.
It's unclear why they're grouped, and it's also confusing.
2020-03-04 12:31:43 -08:00
Joe Groff
61be64a61b Merge pull request #15344 from jckarter/nullable-enum-generalization
IRGen: Generalize the nullable optimization for single-payload enums.
2020-03-04 12:24:41 -08:00