Skip to content

Merge 2020-10-28 into tensorflow #34477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1,115 commits into from
Nov 3, 2020
Merged
Changes from 2 commits
Commits
Show all changes
1115 commits
Select commit Hold shift + click to select a range
0c51dda
Sema: Pull @_implementationOnly override checking out of Exportabilit…
slavapestov Oct 16, 2020
0ea1367
Sema: Refactoring in preparation for conformance availability checking
slavapestov Oct 15, 2020
50c44c2
Sema: Don't desugar the type when diagnosing unexportable Clang funct…
slavapestov Oct 19, 2020
f48aa51
Sema: Remove ExportabilityChecker
slavapestov Oct 16, 2020
e10df96
Sema: Fold TypeChecker::isDeclAvailable() into its callers
slavapestov Oct 19, 2020
c2ed347
Sema: Pass ValueDecl instead of ConcreteDeclRef in a few places in av…
slavapestov Oct 19, 2020
9f08ab3
Sema: Remove an unnecessary overload of TypeChecker::diagnosePotentia…
slavapestov Oct 19, 2020
3044c05
Sema: Wrap up some availability-related state in a new ExportContext …
slavapestov Oct 20, 2020
a824e5a
Sema: Refactor getDisallowedOriginKind() to take an ExportContext
slavapestov Oct 20, 2020
73dc49f
[Build System] Remove tvOS i368 slice before copying the libs
shahmishal Oct 20, 2020
cfb4a0f
Merge pull request #34284 from CodaFi/testable-hypotheses
CodaFi Oct 20, 2020
ef73c39
tests: fix APINotes/blocks.swift
eeckstein Oct 20, 2020
077e814
Merge pull request #34334 from aschwaighofer/fix_sil_box_type_opaque_…
aschwaighofer Oct 20, 2020
6b1f6c1
Merge pull request #34363 from eeckstein/fix-test
swift-ci Oct 20, 2020
0883836
Merge pull request #34361 from apple/shahmishal/r70443440
shahmishal Oct 20, 2020
c5176c0
Update swift-rpathize.py to work with Python 3.8 and Python 2.7 (#34332)
tbkka Oct 20, 2020
59aff3e
Update ObjectIdentifier.swift
sunbohong Oct 20, 2020
c2159e2
Update ObjectIdentifier.swift
sunbohong Oct 20, 2020
792c4b7
Merge pull request #34360 from artemcm/DoNotEscapeScannerOutputStrings
artemcm Oct 20, 2020
09fc82a
Merge pull request #34299 from compnerd/i-dont-visual-c-you
compnerd Oct 20, 2020
8d2c85d
Merge pull request #34357 from gottesmm/pr-5b70b29de84d902644bc21dc53…
gottesmm Oct 20, 2020
6a40a3a
[SE-0289] Add support for @resultBuilder.
DougGregor Oct 20, 2020
7e16e3b
Merge pull request #30630 from martinboehme/cxx-constructors
swift-ci Oct 20, 2020
c0d664d
Merge pull request #34329 from slavapestov/nuke-exportability-checker
slavapestov Oct 20, 2020
9f83ced
Add more file-level comments to MemAccessUtils.
atrick Oct 20, 2020
090d57a
Look past class casts when finding the reference root.
atrick Sep 28, 2020
f31296d
Fix isRCIdentityPreservingCast to handle trivial-to-reference casts
atrick Oct 14, 2020
d8dd620
Test cases for AccessedStorage with reference casts.
atrick Sep 28, 2020
abecaa3
[Gardening] Move Fingerprints Tests Under Incremental
CodaFi Oct 20, 2020
5260a62
[Gardening] Drop 'private-' Prefix From Tests
CodaFi Oct 20, 2020
9e0dd2a
[NFC] Remove Reference to "private" in Incremental Test
CodaFi Oct 20, 2020
db594b5
Merge pull request #34368 from atrick/comment-memutils
swift-ci Oct 21, 2020
971932d
Merge pull request #34159 from atrick/opt-ref-root
swift-ci Oct 21, 2020
9671299
Merge pull request #34369 from CodaFi/dusting-off-fingerprints
swift-ci Oct 21, 2020
a3fc337
[CMake] Compile with library evolution for all Darwin platforms.
varungandhi-apple Oct 21, 2020
dd4a9f3
[CMake] Enable library evolution for Darwin overlay.
varungandhi-apple Oct 21, 2020
548b96a
Sema: Add documentation comments for ExportContext
slavapestov Oct 20, 2020
d579b69
Sema: Teach ExportContext to compute whether we're inside a deprecate…
slavapestov Oct 20, 2020
78d2cf2
Sema: Teach ExportContext to compute whether we're inside an implicit…
slavapestov Oct 20, 2020
85d2495
Sema: Teach ExportContext to compute whether we're inside an unavaila…
slavapestov Oct 21, 2020
8347470
Enable SILMem2Reg for OSSA
meg-gupta Sep 9, 2020
0ea5d05
Delete debug_value_addr of stack location, if a debug_value of the Ru…
meg-gupta Oct 12, 2020
06eaf6b
Disable SILCombine of unchecked_bitwise_cast to unchecked_ref_cast in…
meg-gupta Oct 12, 2020
ce90767
Merge pull request #34260 from kavon/actorUnsafe
DougGregor Oct 21, 2020
0d568a9
[SE-0289] Update diagnostics & many other strings to "result builders"
DougGregor Oct 21, 2020
6d41524
[SE-0289] Finish renaming source code, tests to "result builders"
DougGregor Oct 21, 2020
b6c0145
[SE-0289] Continue printing @_functionBuilder in .swiftinterfaces.
DougGregor Oct 21, 2020
c6be347
SILCombine: fix metatype simplification
eeckstein Oct 21, 2020
0d6e79c
Merge pull request #34375 from eeckstein/fix-metadat-combine
eeckstein Oct 21, 2020
4a4c6c0
Update ObjectIdentifier.swift
sunbohong Oct 21, 2020
1be7171
Merge pull request #34350 from mikeash/remove-os-object-test-workaround
mikeash Oct 21, 2020
bf7fa56
Merge pull request #34354 from mikeash/restore-objc_addLoadImageFunc
mikeash Oct 21, 2020
3b6fd4e
Merge pull request #34374 from DougGregor/se-0289-result-builders-rename
DougGregor Oct 21, 2020
ada53b1
Merge pull request #34371 from varungandhi-apple/vg-cmake-Darwin-libr…
varungandhi-apple Oct 21, 2020
74144e4
Platform: extract `WLANAPI` module on Windows
compnerd Oct 21, 2020
a790439
Merge pull request #34276 from meg-gupta/mem2regossa
meg-gupta Oct 21, 2020
0044e7d
[ownership] Move OME past SILMem2Reg
meg-gupta Oct 21, 2020
e185295
[Concurrency] Drop "get" prefix when importing Objective-C methods as…
DougGregor Oct 21, 2020
b0bda13
LoadBorrowInvalidation: fix mysteriously inverted boolean returns.
atrick Oct 4, 2020
4f05d8a
LoadBorrowImmutabilityChecker renaming.
atrick Oct 8, 2020
be73343
Merge pull request #34372 from slavapestov/more-export-context-refact…
slavapestov Oct 21, 2020
8e3fb44
Rewrite LoadBorrowImmutabilityChecker using AccessPath.
atrick Sep 1, 2020
0f1beed
Reenable load-borrow checker.
atrick Oct 14, 2020
987d055
[Mangler] Handle mangling for Clang types not derivable from Swift ty…
varungandhi-apple Oct 15, 2020
6cb71c6
[ASTPrinter] Print Clang type only if not derivable from Swift type.
varungandhi-apple Oct 6, 2020
97202fa
[Async CC] Put direct returns after indirect returns.
nate-chandler Oct 14, 2020
a9aee1b
[Async CC] Put bindings after formal arguments.
nate-chandler Oct 16, 2020
409f3d2
[NFC] Removed Explosion::peek.
nate-chandler Oct 19, 2020
0356c9f
[NFC] Simplify saving of self to async context.
nate-chandler Oct 20, 2020
63b5ba4
[NFC] Used consistent style for casting.
nate-chandler Oct 21, 2020
03f4e40
[Async CC] Move self after formal arguments.
nate-chandler Oct 20, 2020
a9f497d
[utils/swift_build_sdk_interfaces.py] Remove passing '-track-system-d…
akyrtzi Oct 21, 2020
cb900a6
Merge pull request #34057 from varungandhi-apple/vg-track-isDerivable…
swift-ci Oct 22, 2020
af5fa5e
Remove `isPrivateToEnclosingFile` Accessor
CodaFi Oct 22, 2020
c3881d9
[NFC] Pull the Computation of Fingerprints Into the Common Base Class
CodaFi Oct 22, 2020
e2e19dc
Add Compilation "Wave" Assertion in +Asserts Builds
CodaFi Oct 22, 2020
8145566
Merge pull request #34380 from meg-gupta/moveomepastmem2reg
meg-gupta Oct 22, 2020
f0f2246
[cxx-interop] Support C++ function templates in Swift. (#33053)
zoecarver Oct 22, 2020
24ea8be
[Concurrency] Move removal of leading "get" for async imports.
DougGregor Oct 22, 2020
c18331c
Move swift_task_alloc/dealloc into the Concurrency library.
rjmccall Oct 15, 2020
a8464dc
Implicitly import _Concurrency under -enable-experimental-concurrency
rjmccall Oct 22, 2020
b717c7d
Prepare for a more real task-local alloocator implementation.
rjmccall Oct 16, 2020
c31dab2
Add a missing `inline`.
rjmccall Oct 16, 2020
76d8f03
Make the task allocator verify stack discipline in the laziest possib…
rjmccall Oct 16, 2020
a06d18c
Add API for creating unscheduled tasks.
rjmccall Oct 21, 2020
8521453
[Concurrency] Drop "Asynchronously" suffix from imported 'async' meth…
DougGregor Oct 22, 2020
051f4c4
Sema: Improve comments based on code review feedback
slavapestov Oct 21, 2020
0f27312
Sema: Refactor TypeChecker::diagnoseInlinableDeclRef()
slavapestov Oct 21, 2020
b3dadc8
AST: Use VarDecl::isInitExposedToClients() from DeclContext::getFragi…
slavapestov Oct 21, 2020
5f5372a
Sema: Don't check SPI violations in diagnoseInlinableDeclRefAccess()
slavapestov Oct 21, 2020
0dffe5c
Sema: Use VarDecl::isLayoutExposedToClients() when checking access in…
slavapestov Oct 22, 2020
b4c568e
Sema: Use VarDecl::isLayoutExposedToClients() when checking if @_spi …
slavapestov Oct 22, 2020
01bc774
Sema: Enforce that stored properties of @_fixed_layout classes only r…
slavapestov Oct 22, 2020
fa50221
Sema: Use VarDecl::isLayoutExposedToClients() when checking VarDecl e…
slavapestov Oct 22, 2020
91a8a82
Merge pull request #34384 from akyrtzi/util-prebuild-modules-stop-sys…
akyrtzi Oct 22, 2020
a353176
Merge pull request #34385 from atrick/rewrite-loadborrowchecker
atrick Oct 22, 2020
587a8da
Sema: Don't forget to visit conformances introduced by non-generic types
slavapestov Oct 22, 2020
8af4405
AST: 'lazy' property initializers are never @inlinable
slavapestov Oct 22, 2020
bbe9cb7
Merge pull request #34378 from compnerd/wlanapi
compnerd Oct 22, 2020
a9af098
Update ObjectIdentifier.swift
sunbohong Oct 22, 2020
fa9d4fd
Merge pull request #34382 from DougGregor/concurrency-objc-get-async
DougGregor Oct 22, 2020
fe89764
Merge pull request #34390 from slavapestov/misc-availability-fixes
slavapestov Oct 22, 2020
2f08835
Merge pull request #34388 from rjmccall/import-concurrency
rjmccall Oct 22, 2020
785b182
Merge pull request #34381 from rjmccall/task-creation-api
rjmccall Oct 22, 2020
506473d
[Async CC] Supported partial application.
nate-chandler Oct 21, 2020
16104d8
[Concurrency] Don't lose name information from completion-handler arg…
DougGregor Oct 22, 2020
64ec60b
Merge pull request #34370 from nate-chandler/concurrency/irgen/partia…
swift-ci Oct 22, 2020
223d7b9
Fix isStartOfSwiftDecl to allow qualified types and generic arguments…
rjmccall Oct 22, 2020
f21a306
[AST] Introduce BuiltinProtocolConformance
Azoy May 23, 2020
4b71d67
[ABI] Introduce MetadataKind TypeRef
Azoy May 23, 2020
e60ef84
Implement Tuple Equatable Conformance
Azoy May 30, 2020
df9778e
[Compatibility53] Add compatibility library for 5.3 and backport tupl…
Azoy Jun 6, 2020
fd950eb
Implement Tuple Comparable Conformance
Azoy Jul 18, 2020
13b5bf4
[Compatibility53] Backport Tuple Comparable Conformance
Azoy Jul 18, 2020
58e643e
[Runtime] Tuple Comparable associated conformance is not evenly aligned
Azoy Jul 20, 2020
4ff28f2
Implement Tuple Hashable Conformance
Azoy Jul 20, 2020
5e03e33
[Compatibility53] Backport Tuple Hashable Conformance
Azoy Jul 20, 2020
7468375
[ABI] Split TypeReferenceKind from TypeMetadataRecord
Azoy Jul 25, 2020
7a6ea99
[Runtime] Clean up the assembly around Tuple builtin conformances
Azoy Jul 25, 2020
b78da2d
[Runtime] Add stubs for indirect symbols on armv7/s, add missing newl…
Azoy Aug 3, 2020
05cc4aa
[Runtime] Emit non lazy stub pointers for 32 bit x86 for tuple confor…
Azoy Aug 10, 2020
48ea837
Manually define _rawHashValue in compatibility libraries, AST fixes f…
Azoy Aug 26, 2020
33771cf
Merge pull request #34387 from CodaFi/a-giraffe-on-a-beach
CodaFi Oct 22, 2020
4a89483
ClangImporter: support the MS anonymous structure extension
compnerd Oct 22, 2020
b094758
Merge pull request #34394 from DougGregor/concurrency-objc-name-adjus…
DougGregor Oct 22, 2020
3c2f1e4
Merge pull request #34396 from rjmccall/tentative-custom-attr-parsing
rjmccall Oct 23, 2020
39cc436
Merge pull request #34347 from apple/PatrickPijnappel-float-comment
xwu Oct 23, 2020
a7f4534
Harden swift-rpathize against possible first-column output from dyldinfo
rjmccall Oct 23, 2020
9e27835
Merge pull request #34404 from rjmccall/harden-rpathize
swift-ci Oct 23, 2020
9f8b966
Add a test that checks that ClangImporter chooses only exported modul…
scentini Oct 23, 2020
16e5417
Update ObjectIdentifier.swift
sunbohong Oct 23, 2020
9c9c5da
Update ObjectIdentifier.swift
sunbohong Oct 23, 2020
0fb4080
Fix destination for clang-builtin-headers-in-clang-resource-dir (#34364)
edymtt Oct 23, 2020
b985817
[Runtime] Add Native Windows support for builtin conformances
Azoy Aug 30, 2020
2e65e49
remove extra "by"
literalpie Oct 23, 2020
1f47989
Revert "[NFC] Clarify semantics of getImportedModules."
varungandhi-apple Oct 23, 2020
989ea5b
[IRGen] Track repeated requirements for async functions in NecessaryB…
nate-chandler Oct 22, 2020
6829b66
[NFC] Replaced include with forward declaration.
nate-chandler Oct 22, 2020
b8a5b62
[NFC] Cached the layout in AsyncCallEmission.
nate-chandler Oct 22, 2020
128c7bc
[NFC] Whitespace.
nate-chandler Oct 22, 2020
e066588
[IRGen] Temporarily treat @async @convention(c) as not async.
nate-chandler Oct 23, 2020
9135eaf
[Test] Temporarily mark async execution tests' main @async.
nate-chandler Oct 23, 2020
c2469fc
[Test] Made async exec tests obey async rule.
nate-chandler Oct 16, 2020
a963d0a
[Async CC] Added TODO for codesize improvement.
nate-chandler Oct 23, 2020
3cd6a65
Merge pull request #34395 from compnerd/clang-importer
compnerd Oct 23, 2020
303d88c
[Build] Remove Differentiation without tgmath (#34409)
edymtt Oct 23, 2020
a43cb01
Update ObjectIdentifier.swift
natecook1000 Oct 23, 2020
4a52f5a
[ownership] Add another run of SemanticARCOpts right before eliminati…
gottesmm Oct 23, 2020
b3578ab
Add regression test for https://bugs.swift.org/browse/SR-12473 / rdar…
slavapestov Oct 23, 2020
acef026
Add regression test for https://bugs.swift.org/browse/SR-13727 / rdar…
slavapestov Oct 23, 2020
1d2c426
Distinguish raw stringd from multiline delimiters [SR-10011]
maustinstar Oct 23, 2020
fe4f7a5
Test cases for false multiline delimiters
maustinstar Oct 23, 2020
bdd7b42
[copy-propagation] Since this runs on OSSA and we have formalized con…
gottesmm Oct 23, 2020
35f856f
Merge pull request #34408 from literalpie/patch-2
swift-ci Oct 24, 2020
860e14e
[CSGen] Remove redundant `r-value adjustment` constraint
xedin Oct 24, 2020
b385332
Merge pull request #34413 from gottesmm/pr-125681629f67f2d2cfe3cde57c…
gottesmm Oct 24, 2020
8c5737d
[ownership] Change thin_to_thick function to always produce a none va…
gottesmm Oct 23, 2020
360e406
SIL: Rename SILFunction::hasSelfMetadataParam()/getSelfMetadataArgume…
slavapestov Oct 23, 2020
7f2b01c
DI: Fix crash when value_metatype was used with a non-class 'self' type
slavapestov Oct 23, 2020
37f2bc1
DI: Add non-working code for handling value_metatype when used on an …
slavapestov Oct 24, 2020
fc2bd05
Merge pull request #34416 from gottesmm/pr-494b149e92fdf8f15a07109c6a…
gottesmm Oct 24, 2020
e53290d
Remove redundant false delimiter check
maustinstar Oct 24, 2020
b72fb1c
Test zero-width chars nested within false delimiter
maustinstar Oct 24, 2020
d6d01aa
Consistent comment format for test description
maustinstar Oct 24, 2020
75eed47
Note for zero-width chars in multiline delimiter
maustinstar Oct 24, 2020
40ce7f6
Merge pull request #34415 from gottesmm/pr-7013fe1c78c3e6068b82f70954…
gottesmm Oct 24, 2020
442fc68
Merge pull request #34419 from slavapestov/type-of-self-protocol-conv…
slavapestov Oct 24, 2020
93f22cd
Merge pull request #34420 from slavapestov/two-regression-tests
slavapestov Oct 24, 2020
527fb5d
SIL: Enum protocol witness thunks should be [serializable]
slavapestov Oct 24, 2020
5413488
SILGen: Fix crash in emitEnumConstructor() if type lowering depends o…
slavapestov Oct 24, 2020
246fe46
Merge pull request #34422 from egorzhdan/winsdk
egorzhdan Oct 24, 2020
184367c
[stdlib] Fix Array.append(contentsOf:) for arguments of type NSArray
lorentey Oct 24, 2020
fa4e814
Merge pull request #34421 from slavapestov/enum-protocol-witness-vs-r…
slavapestov Oct 25, 2020
05faa07
[cxx-interop] Support bool-based enums.
zoecarver Oct 20, 2020
3a87cbe
[cxx-interop] Disable importing fully specialized class templates.
zoecarver Oct 25, 2020
1683fb9
[ConstraintSystem] Remove `RValueAdjustment` locator element
xedin Oct 26, 2020
9023e56
[Concurrency] Add minimal placeholders for Task and UnsafeContinuation
ktoso Oct 20, 2020
07f80be
[Concurrency] API stubs: Task.Handle, priority and runDetached
ktoso Oct 26, 2020
d6adac3
[Concurrency] Stubs for Task.current()
ktoso Oct 26, 2020
579c89c
[Concurrency] More documentation of Task.Priority
ktoso Oct 26, 2020
bfbeb90
Add tests testing more complicated template scenarios for #32950. (#3…
hlopko Oct 26, 2020
7f09bbf
Merge pull request #33698 from atrick/fix-smallstring
atrick Oct 26, 2020
d1bfe02
Merge pull request #34402 from nate-chandler/concurrency/irgen/tests-…
nate-chandler Oct 26, 2020
d82e0ff
SILInliner: Critical edges have no code size impact.
atrick Sep 26, 2018
84e5fd2
Merge pull request #28833 from Azoy/void-is-equatable
Azoy Oct 26, 2020
92fe04f
Merge pull request #34432 from xedin/remove-rvalue-adjument
xedin Oct 26, 2020
672409d
[cxx-interop] Temporarily disable class-template-variadic test
hlopko Oct 26, 2020
dabdd96
Merge pull request #34440 from hlopko/disable_variadic_test
Catfish-Man Oct 26, 2020
d8dcf61
Improve SimplifyCFG: remove conditional branches to the same target.
atrick Oct 20, 2020
d32a371
Merge pull request #34410 from varungandhi-apple/vg-revert-import-fil…
varungandhi-apple Oct 26, 2020
8b6a09b
configure Swift test options with CMake
rmaz Oct 23, 2020
5d28fbd
SILCombiner: Use a substitution list with concrete type if we can cas…
aschwaighofer Oct 26, 2020
58d07a4
Merge pull request #34426 from lorentey/array-cannot-append
lorentey Oct 26, 2020
b74052c
[Async CC] Added task and executor args.
nate-chandler Oct 26, 2020
3a1b9cd
Merge pull request #34349 from sunbohong/patch-1
Oct 26, 2020
62a5fb1
[CodeCompletion] Dedupe completion results if multiple lookups were m…
Oct 23, 2020
6387a7b
[build] Use llvm matching value for CMake policy CMP0077
kastiglione Oct 19, 2020
26c9626
Merge pull request #34365 from zoecarver/cxx/bool-enum
swift-ci Oct 26, 2020
38d759c
Merge pull request #34428 from zoecarver/cxx/empty-template-spec
swift-ci Oct 26, 2020
d7dfa3e
Bring up tests + validation tests for the 'freestanding' build and th…
kubamracek Oct 26, 2020
0991d8d
Merge pull request #34441 from atrick/simplifycfg-condbr
atrick Oct 26, 2020
a37e7b9
Add an Ownership SSA sub-section about forwarding uses.
gottesmm Jul 16, 2020
f24ddb0
Merge pull request #34444 from nate-chandler/concurrency/irgen/add-re…
nate-chandler Oct 27, 2020
96c1e47
Merge pull request #34449 from apple/build-Use-llvm-matching-value-fo…
kastiglione Oct 27, 2020
b5fd2a5
Address review comments; get() must throw, formatting
ktoso Oct 27, 2020
b65d71b
[Async CC] Added conveniences to retrieve argumments.
nate-chandler Oct 27, 2020
a5b9e86
[NFC] Used convenience to retrieve context arg.
nate-chandler Oct 26, 2020
aeefc1c
Merge pull request #34452 from gottesmm/pr-f34d2cbf39d3441da59079c01e…
gottesmm Oct 27, 2020
d6227dc
Merge pull request #34453 from nate-chandler/concurrency/irgen/argume…
swift-ci Oct 27, 2020
4ce7a2d
CodeCompletion: Annotate archetypes, generic parameters and dependent…
AnthonyLatsis Oct 23, 2020
4b005c4
Fix typos in comments
memecoinbeliever Oct 27, 2020
81c7548
Merge pull request #34443 from aschwaighofer/sil_combiner_fix
aschwaighofer Oct 27, 2020
c10064a
Merge pull request #34407 from rmaz/testconfig
gmittert Oct 27, 2020
08612ff
Merge pull request #34406 from AnthonyLatsis/ide-misc
AnthonyLatsis Oct 27, 2020
b6e07a9
Merge pull request #34391 from ktoso/wip-concurrency-tasks
DougGregor Oct 27, 2020
848d823
[cxx-interop] Cleanup a test now that we can import constructors (#34…
hlopko Oct 27, 2020
a07dda6
Merge pull request #34448 from nathawes/completion-dedupe-ambiguous
Oct 27, 2020
51c1fa9
SILGen: Fix assertion failure when emitting foreign-to-native thunk f…
slavapestov Oct 27, 2020
f08df03
[IRGen] Defined TypeInfo for async context.
nate-chandler Oct 27, 2020
a085fdb
[IRGen] Defined TaskContinuationFunction.
nate-chandler Oct 27, 2020
4fd5c93
[IRGen] Defined TI for TaskContinuationFunction.
nate-chandler Oct 27, 2020
0adfc0b
[IRGen] Defined TypeInfo for SwiftExecutor.
nate-chandler Oct 27, 2020
5d67c4a
[Async CC] Add parent to async context.
nate-chandler Oct 27, 2020
f29f439
[Async CC] Add ResumeParent to async context.
nate-chandler Oct 27, 2020
1e0d6f3
[Async CC] Add ResumeParentExecutor to context.
nate-chandler Oct 27, 2020
904876e
[Async CC] Pass the function's task to task_[de]alloc.
nate-chandler Oct 27, 2020
c9e567b
[Async CC] Save parent context into child context.
nate-chandler Oct 27, 2020
290923c
[docs] Add links to 'The Swift runtime' posts + podcast episode. (#34…
varungandhi-apple Oct 27, 2020
f73eff7
[Async CC] Save parent executor into context.
nate-chandler Oct 27, 2020
ddb739e
[Async CC] Pass task along from caller to callee.
nate-chandler Oct 27, 2020
2ff6ea3
[Async CC] Pass executor along to callee.
nate-chandler Oct 27, 2020
e497253
Merge branch 'tensorflow' of github.com:apple/swift into tensorflow-s…
ainu-bot Oct 27, 2020
9384813
[Diagnostics] Split "only concrete types conform to protocols" into a…
xedin Oct 27, 2020
f24e5db
[Diangostics] NFC: Adjust test-cases to expect that "type cannot conf…
xedin Oct 27, 2020
9269c5c
Merge pull request #34414 from maustinstar/sr-10011
rintaro Oct 27, 2020
811fc06
Merge pull request #34467 from xedin/protocol-conformance-error-as-note
xedin Oct 28, 2020
2bcc74c
Merge pull request #34454 from nate-chandler/concurrency/irgen/thread…
nate-chandler Oct 28, 2020
5910d82
Merge pull request #34456 from slavapestov/foreign-to-native-inout-self
slavapestov Oct 28, 2020
810131c
Merge upstream/main into tensorflow-stage (using imerge)
Oct 28, 2020
d5414ff
Merge branch 'main' of github.com:apple/swift into tensorflow-stage
ainu-bot Oct 28, 2020
e8e613b
RCIdentity: fix another case of not-RC-identity-preserving casts.
eeckstein Oct 21, 2020
9776e88
Merge pull request #34461 from upbooo/fix/typo
xedin Oct 28, 2020
8a779b1
Merge branch 'main' of github.com:apple/swift into tensorflow-stage
ainu-bot Oct 28, 2020
77363fe
Merge pull request #34383 from eeckstein/fix_bridging_casts
swift-ci Oct 28, 2020
f43deb9
Merge branch 'main' of github.com:apple/swift into tensorflow-stage
ainu-bot Oct 28, 2020
64e5f76
Add a failing test for SR-13785 (#34462)
scentini Oct 28, 2020
520b6e8
Merge branch 'main' of github.com:apple/swift into tensorflow-stage
ainu-bot Oct 28, 2020
6da0133
update-checkout-config.json: adjust for tensorflow merge
texasmichelle Oct 28, 2020
f8a8d08
Set SWIFTCI_USE_LOCAL_DEPS=1
texasmichelle Oct 29, 2020
1e86c04
Re-add #30710
texasmichelle Nov 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 134 additions & 3 deletions docs/SIL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@ Owned
Owned ownership models "move only" values. We require that each such value is
consumed exactly once along all program paths. The IR verifier will flag values
that are not consumed along a path as a leak and any double consumes as
use-after-frees. We model move operations via "forwarding uses" such as casts
use-after-frees. We model move operations via `forwarding uses`_ such as casts
and transforming terminators (e.x.: `switch_enum`_, `checked_cast_br`_) that
transform the input value, consuming it in the process, and producing a new
transformed owned value as a result.
Expand Down Expand Up @@ -1805,7 +1805,7 @@ derived from the ARC object. As an example, consider the following Swift/SIL::
}

Notice how our individual copy (``%1``) threads its way through the IR using
forwarding of ``@owned`` ownership. These forwarding operations partition the
`forwarding uses`_ of ``@owned`` ownership. These `forwarding uses`_ partition the
lifetime of the result of the copy_value into a set of disjoint individual owned
lifetimes (``%2``, ``%3``, ``%5``).

Expand Down Expand Up @@ -1847,7 +1847,7 @@ optimizations that they can never shrink the lifetime of ``%0`` by moving
`destroy_value`_ above ``%1``.

Values with guaranteed ownership follow a dataflow rule that states that
non-consuming "forwarding" uses of the guaranteed value are also guaranteed and
non-consuming `forwarding uses`_ of the guaranteed value are also guaranteed and
are recursively validated as being in the original values scope. This was a
choice we made to reduce idempotent scopes in the IR::

Expand Down Expand Up @@ -1912,6 +1912,137 @@ This is a form of ownership that is used to model two different use cases:
trivial pointer to a class. In that case, since we have no reason to assume
that the object will remain alive, we need to make a copy of the value.

Forwarding Uses
~~~~~~~~~~~~~~~

NOTE: In the following, we assumed that one read the section above, `Value Ownership Kind`_.

A subset of SIL instructions define the value ownership kind of their results in
terms of the value ownership kind of their operands. Such an instruction is
called a "forwarding instruction" and any use with such a user instruction a
"forwarding use". This inference generally occurs upon instruction construction
and as a result:

* When manipulating forwarding instructions programatically, one must manually
update their forwarded ownership since most of the time the ownership is
stored in the instruction itself. Don't worry though because the SIL verifier
will catch this error for you if you forget to do so!

* Textual SIL does not represent the ownership of forwarding instructions
explicitly. Instead, the instruction's ownership is inferred normally from the
parsed operand. Since the SILVerifier runs on Textual SIL after parsing, you
can feel confident that ownership constraints were inferred correctly.

Forwarding has slightly different ownership semantics depending on the value
ownership kind of the operand on construction and the result's type. We go
through each below:

* Given an ``@owned`` operand, the forwarding instruction is assumed to end the
lifetime of the operand and produce an ``@owned`` value if non-trivially typed
and ``@none`` if trivially typed. Example: This is used to represent the
semantics of casts::

sil @unsafelyCastToSubClass : $@convention(thin) (@owned Klass) -> @owned SubKlass {
bb0(%0 : @owned $Klass): // %0 is defined here.

// %0 is consumed here and can no longer be used after this point.
// %1 is defined here and after this point must be used to access the object
// passed in via %0.
%1 = unchecked_ref_cast %0 : $Klass to $SubKlass

// Then %1's lifetime ends here and we return the casted argument to our
// caller as an @owned result.
return %1 : $SubKlass
}

* Given a ``@guaranteed`` operand, the forwarding instruction is assumed to
produce ``@guaranteed`` non-trivially typed values and ``@none`` trivially
typed values. Given the non-trivial case, the instruction is assumed to begin
a new implicit borrow scope for the incoming value. Since the borrow scope is
implicit, we validate the uses of the result as if they were uses of the
operand (recursively). This of course means that one should never see
end_borrows on any guaranteed forwarded results, the end_borrow is always on
the instruction that "introduces" the borrowed value. An example of a
guaranteed forwarding instruction is ``struct_extract``::

// In this function, I have a pair of Klasses and I want to grab some state
// and then call the hand off function for someone else to continue
// processing the pair.
sil @accessLHSStateAndHandOff : $@convention(thin) (@owned KlassPair) -> @owned State {
bb0(%0 : @owned $KlassPair): // %0 is defined here.

// Begin the borrow scope for %0. We want to access %1's subfield in a
// read only way that doesn't involve destructuring and extra copies. So
// we construct a guaranteed scope here so we can safely use a
// struct_extract.
%1 = begin_borrow %0 : $KlassPair

// Now we perform our struct_extract operation. This operation
// structurally grabs a value out of a struct without safety relying on
// the guaranteed ownership of its operand to know that %1 is live at all
// use points of %2, its result.
%2 = struct_extract %1 : $KlassPair, #KlassPair.lhs

// Then grab the state from our left hand side klass and copy it so we
// can pass off our klass pair to handOff for continued processing.
%3 = ref_element_addr %2 : $Klass, #Klass.state
%4 = load [copy] %3 : $*State

// Now that we have finished accessing %1, we end the borrow scope for %1.
end_borrow %1 : $KlassPair

%handOff = function_ref @handOff : $@convention(thin) (@owned KlassPair) -> ()
apply %handOff(%0) : $@convention(thin) (@owned KlassPair) -> ()

return %4 : $State
}

* Given an ``@none`` operand, the result value must have ``@none`` ownership.

* Given an ``@unowned`` operand, the result value will have ``@unowned``
ownership. It will be validated just like any other ``@unowned`` value, namely
that it must be copied before use.

An additional wrinkle here is that even though the vast majority of forwarding
instructions forward all types of ownership, this is not true in general. To see
why this is necessary, lets compare/contrast `struct_extract`_ (which does not
forward ``@owned`` ownership) and `unchecked_enum_data`_ (which can forward
/all/ ownership kinds). The reason for this difference is that `struct_extract`_
inherently can only extract out a single field of a larger object implying that
the instruction could only represent consuming a sub-field of a value instead of
the entire value at once. This violates our constraint that owned values can
never be partially consumed: a value is either completely alive or completely
dead. In contrast, enums always represent their payloads as elements in a single
tuple value. This means that `unchecked_enum_data`_ when it extracts that
payload from an enum, can consume the entire enum+payload.

To handle cases where we want to use `struct_extract`_ in a consuming way, we
instead are able to use the `destructure_struct`_ instruction that consumes the
entire struct at once and gives one back the structs individual constituant
parts::

struct KlassPair {
var fieldOne: Klass
var fieldTwo: Klass
}

sil @getFirstPairElt : $@convention(thin) (@owned KlassPair) -> @owned Klass {
bb0(%0 : @owned $KlassPair):
// If we were to just do this directly and consume KlassPair to access
// fieldOne... what would happen to fieldTwo? Would it be consumed?
//
// %1 = struct_extract %0 : $KlassPair, #KlassPair.fieldOne
//
// Instead we need to destructure to ensure we consume the entire owned value at once.
(%1, %2) = destructure_struct $KlassPair

// We only want to return %1, so we need to cleanup %2.
destroy_value %2 : $Klass

// Then return %1 to our caller
return %1 : $Klass
}

Runtime Failure
---------------

Expand Down