Commit Graph

104924 Commits

Author SHA1 Message Date
swift-ci
3ae2e04c28 Merge pull request #31445 from zoecarver/fix/escape-state-public 2020-04-30 18:10:38 -07:00
Artem Chikin
282cbe959f Merge pull request #31161 from artemcm/NonmutatingPWSetterInit
Allow initializing a wrapped property with a nonmutating setter
2020-04-30 17:59:54 -07:00
Hamish Knight
d22d189dc6 Merge pull request #31456 from hamishknight/operational-dependencies 2020-04-30 17:57:16 -07:00
Hamish Knight
005f8ad706 Merge pull request #31452 from hamishknight/swift-intermediate-bit 2020-04-30 15:54:06 -07:00
Robert Widmann
988075fe28 Merge pull request #31447 from CodaFi/opt-ical-illusion
[NFC] Internalize TypeResolutionOptions in TypeResolution
2020-04-30 15:29:46 -07:00
Robert Widmann
8410e86efe Merge pull request #31449 from CodaFi/real-loc
[NFC] Remove TypeLoc from typeCheckExpression
2020-04-30 15:29:22 -07:00
Hamish Knight
22c64640e0 Register operator dependencies on direct lookup requests
Make sure a dependency gets registered when a
direct lookup is fired off. This is necessary in
order to ensure that operator redeclaration
checking records the right dependencies (and any
future logic that might want to perform direct
operator lookups).

In doing so, this commit also removes the
compatibility logic for the old referenced name
tracker that would skip recording dependencies in
certain cases. This should be safe as the new
logic will record strictly more dependencies than
the old logic.
2020-04-30 15:27:51 -07:00
Dmitri Gribenko
762720e4c7 Merge pull request #31400 from hlopko/pretty-print-static-vars-in-sil
[CxxInterop] Add C++ demangled name for globals/static member variables to SIL
2020-05-01 00:14:17 +02:00
Artem Chikin
d04ae47801 Allow initializing a wrapped property with a nonmutating setter
This is achieved in 3 steps:
1. CSApply detects assignments to property wrappers inside constructors, and produces an `inout` expr instead of a `load`, which it normally would because nonmutating setters take the `self` by-value. This is necessary becasue the assign_by_wrapper instruction expects an address type for its $1 operand.
2. SILGenLValue now emits the assign_by_wrapper pattern for such setters, ignoring the fact that they capture `self` by value. It also introduces an additional load instruction for the setter patrial_apply because the setter signature still expects a value and we now have an address (because of (1)).
3. DefiniteInitialization specifically ignores load instructions used to produce a `self` value for a setter referenced on assign_by_wrapper because it will be deleted by lowering anyway.

Resolves rdar://problem/60600911 and rdar://problem/52280477
2020-04-30 14:49:22 -07:00
swift-ci
74b4e43bd7 Merge pull request #31334 from valeriyvan/StringUnicodeScalarView 2020-04-30 14:46:17 -07:00
swift-ci
4bf38a1eeb Merge pull request #31448 from valeriyvan/FixDocCommentCTypes 2020-04-30 14:43:07 -07:00
Hamish Knight
b6150b06b3 [Serialization] Remove duplicated IsSIB bit
Store the bit on the ModuleFile, and query it
from the SerializedASTFile.
2020-04-30 14:17:29 -07:00
Robert Widmann
1f5dcf0269 Merge pull request #31229 from CodaFi/collect-a-mundo
[NFC] Extract Dependency Registration to DependencyCollector
2020-04-30 13:53:44 -07:00
Robert Widmann
caa0334740 [NFC] Remove TypeLoc from typeCheckExpression
Turns out, no callers were taking advantage of the location information in the TypeLoc
2020-04-30 13:03:23 -07:00
Valeriy Van
2d6313f919 Adds doc comment to internal func _memcpy in CTypes.swift 2020-04-30 21:48:00 +02:00
Valeriy Van
b90f996824 Fixes doc comment of func _memmove in CTypes.swift 2020-04-30 21:45:56 +02:00
swift-ci
62e5780c78 Merge pull request #31348 from valeriyvan/StringUTF16View 2020-04-30 12:36:08 -07:00
Karoy Lorentey
34db631df6 Merge pull request #31430 from apple/revert-30830-rdar61347183
Revert "test: disable several tests failing in CI"
2020-04-30 12:18:05 -07:00
Dmitri Gribenko
105c8f96b1 Merge pull request #31441 from hlopko/header-guards
Add header guards to headers in test/interop
swift-DEVELOPMENT-SNAPSHOT-2020-04-30-a
2020-04-30 20:51:07 +02:00
Robert Widmann
31d23303e1 [NFC] Strip all remaining TypeResolutionOptions parameters
Now that these are stored in the TypeResolution object itself, and all callers that mutate flags create a new resolution object, this data can be derived from the resolution itself.
2020-04-30 10:58:40 -07:00
Holly Borla
259a88ed29 Merge pull request #31443 from hborla/property-wrapper-optional-dynamic-self
[Property Wrappers] Fix disallowing dynamic Self for property wrapper wrappedValue/projectedValue to also cover optional.
2020-04-30 10:52:04 -07:00
zoecarver
c733ca1419 [NFC] Make EscapeState a public member of EscapeAnalysis.
Makes EscapeAnalysis::EscapeState public. This allows EscapeAnalysis::getEscapeState to be used outside of EscapeAnalysis.
2020-04-30 10:36:10 -07:00
Robert Widmann
4130170bf2 [NFC] Internalize TypeCheckerOptions in a TypeResolution Object
Add the appropriate assertions to ensure that the now-redundant options parameters are being kept in sync so they can be retracted.

The eventual goal is to have TypeResolution requestified.
2020-04-30 10:35:02 -07:00
Robert Widmann
bb9a41ef2a Merge pull request #31405 from valeriyvan/FixSnippetsCharacterProperties
Fixes example snippets in CharacterProperties.swift
2020-04-30 10:33:48 -07:00
Slava Pestov
3ef7011ba9 Merge pull request #31432 from slavapestov/dynamic-stored-property-with-observers-fix
Sema: Fix crash with stored property that has on-demand 'modify' accessor
2020-04-30 13:02:40 -04:00
Eric Miotto
b309c62a75 [build] set CMAKE_OSX_ARCHITECTURES in swift_cmake_options (#31414)
This augments #31023 to make sure CMake invokes the compiler checks
correctly -- this is needed to avoid errors in certain
configurations.

Addresses rdar://62339814
2020-04-30 09:34:36 -07:00
Holly Borla
3baf0bd175 [Property Wrappers] Fix disallowing dynamic Self for property wrapper
wrappedValue/projectedValue to also cover optional.
2020-04-30 08:57:54 -07:00
Dmitri Gribenko
89a3d663b5 Merge pull request #31439 from hlopko/fix-cc-to-cpp
Change C++ extension for test inputs from .cc to .cpp
2020-04-30 17:33:10 +02:00
Marcel Hlopko
45509cd885 Add // clang name: Foo::bar comment to globals/functions/static member variables 2020-04-30 16:55:14 +02:00
Saleem Abdulrasool
adaf0651f1 Merge pull request #31429 from compnerd/combase
Windows: add `combase` to the `WinSDK.core` module
2020-04-30 07:32:49 -07:00
Marcel Hlopko
2fbcf184ed Add header guards to test/Interop 2020-04-30 16:13:33 +02:00
Marcel Hlopko
6c9ccbc59b Add header guards for test input headers 2020-04-30 15:49:20 +02:00
Marcel Hlopko
edbd902a90 Change C++ extension for test inputs from .cc to .cpp 2020-04-30 15:34:16 +02:00
Ben Rimmington
962ac3934d Update CHANGELOG.md to add missing SR-11700 link (#31435) 2020-04-30 12:31:34 +01:00
eeckstein
366d77adf1 Merge pull request #31438 from eeckstein/fix-docs
docs: fix doc build error
2020-04-30 12:46:23 +02:00
Dmitri Gribenko
fb7020f3f7 Merge pull request #31396 from hlopko/static-member-func
Test static member functions
2020-04-30 12:21:56 +02:00
Pavel Yaskevich
5e60fa0506 Merge pull request #31373 from xedin/astnode-improvements
[ConstraintSystem] Switch solver to use `ASTNode` instead of `TypedNode`
2020-04-30 00:52:25 -07:00
Erik Eckstein
af69128b4f docs: fix doc build error 2020-04-30 09:07:34 +02:00
Slava Pestov
546848fd23 Merge pull request #31433 from slavapestov/unused-var-warning
TBDGen: Fix unused variable warning
2020-04-30 01:41:11 -04:00
Hamish Knight
34b1333bed Merge pull request #31425 from hamishknight/a-frontend-vocation 2020-04-29 20:55:28 -07:00
Slava Pestov
f4bdfdacc0 Sema: Fix crash with stored property that has on-demand 'modify' accessor
If a stored property has observers, the 'modify' coroutine body takes a
special form which directly yields the underlying storage and calls the
'didSet' and/or 'willSet' accessors.

However, if a property is 'dynamic', the 'modify' coroutine is synthesized
on-demand and it's SIL is serialized. It cannot reference the 'didSet'
or 'willSet' accessors, since they are private. Furthermore, an on-demand
accessor must also work if the property is overridden in a subclass.

So in this case, fall back to the more general 'modify' synthesis code,
which just calls the getter followed by the setter.

Fixes <rdar://problem/62339808>.
2020-04-29 23:23:15 -04:00
Slava Pestov
8c5cb0e7a1 TBDGen: Fix unused variable warning 2020-04-29 22:26:06 -04:00
Karoy Lorentey
6537df068a Revert "test: disable several tests failing in CI" 2020-04-29 19:00:17 -07:00
Hamish Knight
f34964bc8e [Frontend] NFC: Remove a mutable SILOptions accessor
We shouldn't expose the ability to mutate the
SILOptions through the CompilerInstance.
2020-04-29 18:58:47 -07:00
Hamish Knight
f7ae7c0459 [Frontend] Avoid passing CompilerInvocation + CompilerInstance
The invocation can be retrieved from the
CompilerInstance.
2020-04-29 18:58:47 -07:00
Saleem Abdulrasool
904f6aa1ec Windows: add combase to the WinSDK.core module
Ensure that this header properly gets modularized into its own module.
2020-04-29 18:42:11 -07:00
Slava Pestov
8755cede40 Merge pull request #31426 from slavapestov/index-before-silgen
Frontend: Write out index before SILGen
2020-04-29 21:29:19 -04:00
Karoy Lorentey
bbe2f6e735 Merge pull request #31391 from lorentey/private-shims
[Darwin] Import all overlay shims with @_implementationOnly
2020-04-29 17:55:46 -07:00
Michael Gottesman
4a4b7bfd86 Merge pull request #31421 from gottesmm/pr-9a4e0a7a57d7bd503205a207da15b89babf064d6
[ownership] Accept unconditional_checked_cast_addr, treating it like a write.
2020-04-29 17:31:06 -07:00
swift-ci
f5abd61205 Merge pull request #31419 from CodaFi/duty-free-imports 2020-04-29 17:07:15 -07:00