Commit Graph

39091 Commits

Author SHA1 Message Date
swift-ci
897d211183 Merge pull request #30493 from hamishknight/buy-one-get-one-free-promotion 2020-03-18 21:19:17 -07:00
Doug Gregor
3abea6be65 [Constraint system] Use the PatternBindingDecl context when possible.
Make sure that we're resolving types and patterns using the
PatternBindingDecl context, both for the type resolver context and the
contextual pattern used for pattern resolution.

Fixes a regression with implicitly-unwrapped options reported as
SR-11998 / rdar://problem/58455441.
2020-03-18 21:09:06 -07:00
swift-ci
2cff462459 Merge pull request #30492 from atrick/fix-merge-test 2020-03-18 20:23:38 -07:00
Slava Pestov
10c9cb57f0 Merge pull request #30485 from slavapestov/silgen-cleanup-sr-75
Remove SILGen support code for curry thunks
2020-03-18 23:19:42 -04:00
Argyrios Kyrtzidis
08f7028446 Merge pull request #30482 from apple/syntax-incremental-parse-diagnostic
[Parse] Fix issue with incremental re-parsing for SwiftSyntax emitting bogus parsing error
2020-03-18 20:17:27 -07:00
Luciano Almeida
63c20bc8d3 [tests] Adding SR-8563 test cases into the suit 2020-03-18 23:57:11 -03:00
Hamish Knight
45dc9090bf [test] Add regression test for SR-9090
We didn't use to accept pointer conversions passed
to double optional parameters, but do now.
2020-03-18 19:34:34 -07:00
Andrew Trick
bd03f563ff Add @inline annotations to merge_exclusivity test to make it stable. 2020-03-18 18:23:04 -07:00
Nathan Hawes
fd82d87db0 Merge pull request #30402 from nathawes/cross-import-code-completion
[IDE/CodeCompletion] Add code completion support for cross import overlays.
2020-03-18 18:16:03 -07:00
Xi Ge
45d0eca9c7 ModuleInterface: consider inherited protocols from super class when collecting handled protocols
Protocol conformances can be implied by super classes. When collecting the list
of IncludedProtocols, we should traverse the class inheritance chain and collect
all protocols.

Without this change, these implied conformances will be printed again via a synthesized
extension at the end of the Swift interface file, leading to an error of redundant
conformances when building modules.

rdar://58563540
2020-03-18 17:21:13 -07:00
Joe Groff
b636a07070 IRGen: Use mangled names to access opaque type associated types in Swift >=5.2. 2020-03-18 16:43:09 -07:00
Slava Pestov
f6187e520a Sema: Don't devirtualize partially applied operator references 2020-03-18 19:23:18 -04:00
Argyrios Kyrtzidis
791309155d [Parse] Fix issue with incremental re-parsing for SwiftSyntax emitting bogus parsing error
rdar://60232712
2020-03-18 16:00:04 -07:00
Slava Pestov
9ef74da84e Merge pull request #30477 from slavapestov/cf-curried-init-regression-test
Add regression test for rdar://59496033
2020-03-18 18:54:45 -04:00
Arnold Schwaighofer
71599b711c IRGen: Only use type layouts when we expect the generated IR to be faster
If there the layout is not dependent on archetypes and but has resilient types
using the new type layout based approach is not going to be faster.

rdar://59960653
2020-03-18 14:54:04 -07:00
Joe Groff
72b13e8c65 IRGen: Add a flag to disable mangled name type metadata accessors.
Useful as a workaround for runtime demangler bugs, or in rare cases where there are
performance problems with the demangler.
2020-03-18 13:55:01 -07:00
Ben Langmuir
c04a8a9076 Merge pull request #30011 from AnthonyLatsis/mutating_dup_quick_help
[ASTPrinter] Fix duplicate «mutating» modifiers when printing file interface
2020-03-18 13:17:05 -07:00
Slava Pestov
c061e66927 Add regression test for rdar://59496033 2020-03-18 16:11:07 -04:00
AG
a32ed1e48f Merge pull request #30461 from bitjammer/acgarland/rdar-60193675-filter-unavailable-obsoleted
[SymbolGraph] Completely filter unavailable/obsoleted symbols
2020-03-18 12:35:04 -07:00
Nathan Hawes
63636100be [IDE/CodeCompletion] Add code completion support for cross import overlays.
If a cross-import overlay shadows another module and has a name starting with
'_', don't present that overlay in places where module name completions are
offered and present symbols comining from that module as if they came from
the shadowed module instead.

Resolves rdar://problem/59445688
2020-03-18 12:02:20 -07:00
Slava Pestov
6412581751 Merge pull request #28698 from slavapestov/sr-75
Sema: Rewrite partial applications into closures
2020-03-18 14:24:37 -04:00
Pavel Yaskevich
d6ebb03c97 Merge pull request #30247 from owenv/combined-descriptive-diag-flags
Support the combination of -enable-educational-notes and -enable-experimental-diagnostic-formatting
2020-03-18 09:44:29 -07:00
Ashley Garland
58edd83f37 [SymbolGraph] Completely filter unavailable/obsoleted symbols
Symbol graph files are processed per platform--documentation for symbols that
are unconditionally unavailable or obsoleted on a platform shouldn't be shown
for that same platform.

Also, removes `isUnconditionallyUnavailable` from the JSON format. If it's
unconditionally unavailable, it won't show up at all.

rdar://60193675
2020-03-18 09:43:08 -07:00
Andrew Trick
75bad901a3 Merge pull request #30467 from atrick/add-inline-never
Add -sil-inline-never-functions flag.
2020-03-18 08:27:46 -07:00
Pavel Yaskevich
2df9bb509e Merge pull request #30440 from LucianoPAlmeida/SR-11540-ambiguos-closure-inference
[SR-11540] Fix ambiguos overload apply to argument for contextual closure
2020-03-18 08:26:34 -07:00
Slava Pestov
c543838854 Sema: Rewrite partial applications into closures
When a method is called with fewer than two parameter lists,
transform it into a fully-applied call by wrapping it in a
closure.

Eg,

Foo.bar => { self in { args... self.bar(args...) } }
foo.bar => { self in { args... self.bar(args...) } }(self)

super.bar => { args... in super.bar(args...) }

With this change, SILGen only ever sees fully-applied calls,
which will allow ripping out some code.

This new way of doing curry thunks fixes a long-standing bug
where unbound references to protocol methods did not work.

This is because such a reference must open the existential
*inside* the closure, after 'self' has been applied, whereas
the old SILGen implementation of curry thunks really wanted
the type of the method reference to match the opened type of
the method.

A follow-up cleanup will remove the SILGen curry thunk
implementation.

Fixes rdar://21289579 and https://bugs.swift.org/browse/SR-75.
2020-03-18 09:29:22 -04:00
Andrew Trick
e8d3ee11eb Add -sil-inline-never-functions flag.
And fix a test case that assumes Array.append is never inlined.

We need to be able to prevent inlining a function and any of its
specializations. There's no way to specify multiple function names on
the command line, so we use the partial match technique.
2020-03-18 00:36:49 -07:00
Alex Langford
8953af519f [Driver] Don't pass ELF shared objects to swift-autolink-extract
Prior to performing linking on ELF platforms (except the PS4) we extract
autolink information from the object files that will be used during linking.
The current implementation passes all the linker inputs that are marked as an
TY_Object to swift-autolink-extract. There are a two cases where this is
not necessary or problematic.

In the first case, we are looking at an ELF shared object. Although
harmless, this is wasted work. Specifically, the `.swift1_autolink_entries`
entry in the object files are marked as `SHF_EXCLUDE`, meaning they will not be
merged into the final product during linking.

In the second case, we are linking against a linker script that looks like an
ELF shared object (ends with `.so`). In the previous case, the autolink-extract
step will succeed even if it does unnecessary work. In this case, the
autolink-extract step will fail because it cannot recognize the linker script as
an object file. You will observe an error something like this:
```
<unknown>:0: error: error opening input file '/path/to/libLinkerScript.so'
(The file was not recognized as a valid object file
```
Although your linker will know what to do with it, autolink-extract will halt
before you get to that point.
2020-03-17 21:54:00 -07:00
swift-ci
270f734403 Merge pull request #30435 from zoecarver/fix/builtin-is-dead 2020-03-17 20:48:59 -07:00
Argyrios Kyrtzidis
802af8c436 Merge pull request #30459 from akyrtzi/avoid-isSettable-for-syntactic
[SourceKit] Avoid calling `AbstractStorageDecl::isSettable` during syntactic operations
2020-03-17 20:15:57 -07:00
Saleem Abdulrasool
2c1c13d911 Merge pull request #30430 from compnerd/rpath
Driver: honour `-no-toolchain-stdlib-rpath` on Unices
2020-03-17 19:14:11 -07:00
Argyrios Kyrtzidis
b3b3cd3f81 [SourceKit] Avoid calling AbstractStorageDecl::isSettable during syntactic operations
`isSettable` can trigger typechecking and cause crashes during pure syntactic requests.

rdar://60441208
2020-03-17 18:30:33 -07:00
Luciano Almeida
a25f996b39 [tests] Adjusting test ambiguos test that was also fixed in SR-11540 2020-03-17 21:47:28 -03:00
Slava Pestov
4caa6d7003 IDE: Fix indexing for Sema-built curry thunks 2020-03-17 19:03:03 -04:00
Slava Pestov
45330816b4 Profile: Run tests through to -emit-ir to get better coverage 2020-03-17 19:03:03 -04:00
zoecarver
8f1594685f Polymorphic builtins should have empy attributes 2020-03-17 15:17:10 -07:00
Ted Kremenek
39c34c89ee Bump Swift version to 5.3 2020-03-17 13:54:32 -07:00
Saleem Abdulrasool
c7a198bc03 Driver: honour -no-toolchain-stdlib-rpath on Unices
Handle `-no-toolchain-stdlib-rpath` on Linux/android as well as Darwin.  This
enables the flags on other Unix platforms as it can be useful to control the
embedded rpath for the library.
2020-03-17 17:38:24 +00:00
Arnold Schwaighofer
eeb7fa52b2 Merge pull request #30438 from aschwaighofer/irgen_prefer_clang_type_encoding
IRGen: Use clang's objc encoding for types when there is a ClangNode
2020-03-17 07:39:33 -07:00
Arnold Schwaighofer
77af77fa8a Merge pull request #30433 from aschwaighofer/irgen_no_duplicate_objc_method_descriptor_entries
IRGen: Unique method descriptors in objc method lists
2020-03-17 06:52:20 -07:00
Daniel Rodríguez Troitiño
2af51be6e6 Merge pull request #30390 from drodriguez/android-let-properties-opts-armv7
[android][armv7] Mark let_properties_opts.swift as XFAIL.
2020-03-16 23:14:39 -07:00
Luciano Almeida
a65366ebe6 [tests] Adding SR-11540 tests into test/expr/closure/inference.swift 2020-03-16 22:59:53 -03:00
Arnold Schwaighofer
259c9884ac IRGen: Use clang's objc encoding for types when there is a ClangNode
We do this because the swift code does not support all attributes and
does not support generics.

rdar://60474785
2020-03-16 16:47:13 -07:00
Pavel Yaskevich
01073be9d6 Merge pull request #30436 from xedin/rdar-60501780
[CSBindings] Refactor a check to produce follow-up direct supertype b…
2020-03-16 16:22:05 -07:00
Michael Gottesman
7ac7620c78 Merge pull request #30425 from gottesmm/pr-a62f3926b9e0b421c35408e66cf592f84295cd24
[ownership] Treat open_existential_box as an interior pointer producting instruction.
2020-03-16 14:06:15 -07:00
Ben Langmuir
8cd06688b3 Merge pull request #30434 from benlangmuir/long-opt
[test] Update uses of llvm-objdump to --long options
2020-03-16 13:54:25 -07:00
Xi Ge
63d6e7f8ec Merge pull request #30424 from nkcsgexi/available-context
TBDGen: don't emit $ld$previous$ symbols for added members to a moved decl
2020-03-16 12:53:38 -07:00
Pavel Yaskevich
059a3602f8 [CSBindings] Refactor a check to produce follow-up direct supertype bindings
This is a follow-up to https://github.com/apple/swift/pull/30113
which cased a regression because it was placed under a check which
allows direct supertypes to be inferred if previous (failing) binding
has a supertype as well which has nothing to do with collection
inference.

Let's combine supertype check and inference logic to avoid such
confusion in the future.

Resolves: rdar://problem/60501780
2020-03-16 12:17:55 -07:00
Robert Widmann
7926880268 Merge pull request #30427 from CodaFi/an-enumeration-of-grievances
Do a little extra validation of RawRepresentable.RawValue
2020-03-16 12:09:42 -07:00
Ben Langmuir
63963ab6fe [test] Update uses of llvm-objdump to --long options
Adapt to llvm upstream commit 5c3ec7dc41f3e15c39a193b45f3cf23255de00a2
to fix the master-next tests.
2020-03-16 11:57:08 -07:00