Skip to content

[pull] swiftwasm from main #4371

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 344 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
344 commits
Select commit Hold shift + click to select a range
2e5d4b6
Fix build errors
yim-lee Mar 10, 2022
c5254bb
Add @available
yim-lee Mar 10, 2022
a5adf26
Workaround swift-syntax-test bug
yim-lee Mar 10, 2022
2adcd72
Make thread safe
yim-lee Mar 10, 2022
143914a
Use os_unfair_lock on Apple platforms
yim-lee Mar 11, 2022
b001d5b
swift-syntax-test bug fixed; remove workaround
yim-lee Mar 15, 2022
0d2b2f2
Stabilize VarDecl::isLet for ParamDecls
CodaFi Mar 15, 2022
4f3373a
Merge pull request #41813 from tshortli/target-min-inlining-version-min
tshortli Mar 15, 2022
c3c7fe0
Merge pull request #41811 from tshortli/forbid-availability-macros-in…
tshortli Mar 15, 2022
b47d436
CMake: Add `-target-min-inlining-version min` to the Swift standard l…
tshortli Mar 9, 2022
5b5ed56
Added printing during inlining.
nate-chandler Mar 15, 2022
6fb5c30
[CSDiagnostics] Contextual failure could result in optional chain hav…
xedin Mar 15, 2022
5331e27
Merge pull request #41730 from xedin/se-0326-solve-pattern-bindings-v…
xedin Mar 15, 2022
7e473dc
Merge pull request #41737 from beccadax/anything-can-be-sendable
beccadax Mar 15, 2022
b1b9e07
[Swift Static Mirror] Report mangled names without a prefix
artemcm Mar 15, 2022
8484f39
Merge pull request #41814 from apple/ktoso-patch-10
ktoso Mar 15, 2022
83d9b68
Separate out Duration-based APIs so they aren't in the back-deploymen…
DougGregor Mar 15, 2022
4197128
Fix variable name
DougGregor Mar 15, 2022
b09b5c4
Merge pull request #41818 from slavapestov/rqm-optimize-path-normaliz…
slavapestov Mar 15, 2022
fe6cefc
Downgrade To A Warning
CodaFi Mar 15, 2022
1f125c3
RequirementMachine: Make some methods on RuleBuilder private
slavapestov Mar 15, 2022
1d8dd94
RequirementMachine: Refactor RuleBuilder in preparation for rule sharing
slavapestov Mar 15, 2022
564f626
RequirementMachine: Rename some RuleBuilder methods for clarity
slavapestov Mar 15, 2022
f3bcc52
RequirementMachine: Rename RequirementMachine::initWithProtocols()
slavapestov Mar 15, 2022
aaf84ac
RequirementMachine: Implement RequirementMachine::initWithProtocolSig…
slavapestov Mar 15, 2022
b183ae1
Merge pull request #41812 from CodaFi/imap
CodaFi Mar 15, 2022
c34f705
Detach `enable-experimental-async-top-level` flag
etcwilde Mar 14, 2022
fbd6946
Merge pull request #41816 from hyp/status-doc
hyp Mar 15, 2022
8c13370
[Distributed] rename _Distributed to underscoreless module
ktoso Mar 10, 2022
4f8c015
update some missing places with _
ktoso Mar 11, 2022
3321c32
Pass all the tests!
etcwilde Mar 10, 2022
72e03b7
SE-0343 Update changelog for async top-level
etcwilde Mar 14, 2022
1afaf74
top-level is `@MainActor(unsafe)` below swift 6
etcwilde Mar 15, 2022
4796fb3
last bits of lingering _Distributed
ktoso Mar 15, 2022
8a1c513
add test and availability annotations
ktoso Mar 15, 2022
683224a
Revert "Separate the C++ and Objective-C generated header output types."
hyp Mar 16, 2022
52e0534
Merge pull request #41823 from hyp/swift-gen-hdr-lang-pound-if
hyp Mar 16, 2022
a36e1a9
Merge pull request #41821 from nate-chandler/performance_inliner/adde…
swift-ci Mar 16, 2022
20242b4
Merge pull request #41789 from tshortli/stdlib-add-min-inlining-version
swift-ci Mar 16, 2022
8eb762e
Merge pull request #41687 from stevapple/ignore-build
CodaFi Mar 16, 2022
ae1ca94
Merge pull request #41815 from CodaFi/switch-hitter
CodaFi Mar 16, 2022
80ef80f
Merge pull request #41809 from DougGregor/back-deploy-without-duration
DougGregor Mar 16, 2022
704c7e1
Merge pull request #41764 from ktoso/wip-flag-module
swift-ci Mar 16, 2022
b603551
Print Variadic Sequence Types with Array Slice Sugar in SIL Mode
CodaFi Mar 16, 2022
1afdb47
Un-XFAIL Stdlib Validation Test
CodaFi Mar 10, 2022
6b64ac2
[RequirementMachine] Suppress redundant requirement warnings for infe…
hborla Mar 16, 2022
ea355fd
Merge pull request #41805 from etcwilde/ewilde/enable-top-level-concu…
etcwilde Mar 16, 2022
4c09b91
update Distributed module import
ktoso Mar 16, 2022
af443be
RequirementMachine: Implement RewriteContext::getRequirementMachine(P…
slavapestov Mar 15, 2022
327e7e5
RequirementMachine: Add importedRules parameter to RewriteSystem::ini…
slavapestov Mar 15, 2022
c08601b
RequirementMachine: Implement RewriteSystem::getLocalRules()
slavapestov Mar 15, 2022
9704168
RequirementMachine: Skip imported rules in various places when iterat…
slavapestov Mar 15, 2022
653977a
RequirementMachine: Rule sharing
slavapestov Mar 15, 2022
d7f8445
RequirementMachine: Filter duplicates in ProtocolDependenciesRequest
slavapestov Mar 16, 2022
7be83da
Merge pull request #41769 from CodaFi/silt
swift-ci Mar 16, 2022
fcde683
Merge pull request #41756 from yim-lee/distributed/loccal-actor-system
swift-ci Mar 16, 2022
c09df49
Tests: Add integration tests for @_backDeploy that verify that use of…
tshortli Mar 9, 2022
8c27759
Merge pull request #41817 from slavapestov/rqm-rule-sharing
slavapestov Mar 16, 2022
e40fc77
Merge pull request #41667 from ahoppen/pr/complete-expr-after-if
ahoppen Mar 16, 2022
9fd97d5
Merge pull request #41676 from mikeash/swift-inspect-concurrency-flags
mikeash Mar 16, 2022
98beadf
Merge pull request #41833 from hborla/redundant-requirement-tweak
hborla Mar 16, 2022
e40e0f7
[stdlib] improve UnsafeMutableRawBufferPointer.copyMemory
glessard Mar 16, 2022
cc60db7
[test] validate behaviour when copying from an empty buffer
glessard Mar 16, 2022
8176b61
RequirementMachine: Tweak debug output and add an assertion
slavapestov Mar 16, 2022
c25cd24
RequirementMachine: RewriteSystem::initialize() takes writtenRequirem…
slavapestov Mar 16, 2022
fb487f8
RequirementMachine: Factor out RewriteSystem::addRules() from Rewrite…
slavapestov Mar 16, 2022
652de97
RequirementMachine: Introduce RuleBuilder::initWithConditionalRequire…
slavapestov Mar 16, 2022
c91c760
RequirementMachine: Correctly handle importing of protocols in inferC…
slavapestov Mar 16, 2022
7c00619
RequirementMachine: Fold getRuleForRequirement() into RuleBuilder::ad…
slavapestov Mar 16, 2022
ef1636a
RequirementMachine: Split off RuleBuilder.{cpp,h} from RequirementLow…
slavapestov Mar 16, 2022
7589d1f
Merge pull request #41825 from artemcm/SwiftStaticMirrr/MangledNamesN…
artemcm Mar 16, 2022
d90e812
RequirementMachine: Factor out duplicated lookupConcreteNestedType() …
slavapestov Mar 16, 2022
6095065
RequirementMachine: Add a performance/diagnostics test case
slavapestov Mar 16, 2022
6e6c8c2
RequirementMachine: Only check local rules against maximum rule limit
slavapestov Mar 16, 2022
839b483
Merge pull request #41824 from xedin/rdar-85516390
xedin Mar 16, 2022
209c5c7
Prevent linker errors when building dispatch with instrumentation (#4…
thevinster Mar 16, 2022
acc9c4a
Tests: Disable distributed_actor_localSystem on watchOS until its fai…
tshortli Mar 16, 2022
377cdc1
Merge pull request #41840 from tshortli/disable-distributed-actor-loc…
kavon Mar 16, 2022
febdf30
[SSADestroyHoisting] Tie barriers to lifetimes.
nate-chandler Feb 24, 2022
266668d
[SSADestroyHoisting] Fold into sequences.
nate-chandler Mar 5, 2022
87d0c9f
[SSADestroyHoisting] Bitcasts obstruct folding.
nate-chandler Mar 10, 2022
696c8f1
[ConstraintSystem] Implement simplication of `PatternMatch` element
xedin Mar 16, 2022
fed7c69
[ConstraintSystem] Implement simplication of `ClosureBodyElement` ele…
xedin Mar 16, 2022
bb432e8
[cxx-interop] Test for apinotes fix in llvm-project.
plotfi Mar 15, 2022
3b4c637
[ConstraintSystem] Implement simplication of assorted `Type` elements
xedin Mar 16, 2022
363954a
Put Variadic Generics Behind a Flag
CodaFi Mar 16, 2022
3f47ed2
[ConstraintSystem] Implement simplication of `{Function, Generic, Syn…
xedin Mar 16, 2022
6f3203d
[ConstraintSystem] Implement simplication of `{DynamicLookup, KeyPath…
xedin Mar 16, 2022
9dbda85
[ConstraintSystem] Implement simplication of `GenericParameter` element
xedin Mar 16, 2022
3d8333b
[ConstraintSystem] Implement simplication of `KeyPath{Root, Value}` e…
xedin Mar 16, 2022
46ecae3
[ConstraintSystem] Implement simplication of `Opened{Generic, OpaqueA…
xedin Mar 16, 2022
029b112
[ConstraintSystem] Implement simplication of generic requirement elem…
xedin Mar 16, 2022
8fe78d4
[ConstraintSystem] Implement simplication of `{Pack, PatternBinding}E…
xedin Mar 16, 2022
9bd05b7
[ConstraintSystem] Implement simplication of `ImplicitConversion` ele…
xedin Mar 16, 2022
1505d7c
[Diagnostic][Sema] Record locator with OptionalPayload dropped for co…
LucianoPAlmeida Mar 16, 2022
974fbc1
[NFC] Move ObjC method support to NominalTypeDecl
beccadax Mar 15, 2022
06949a4
Check protocols for selector conflicts
beccadax Mar 15, 2022
135c266
[CodeCompletion] Call sawSolution when type checking a result builder
ahoppen Mar 16, 2022
b17b1a9
Merge pull request #41836 from glessard/sr15994
glessard Mar 16, 2022
57518b5
Do not escape UNICODE when writing out target info.
artemcm Mar 16, 2022
6c0ccfc
Merge pull request #41838 from slavapestov/rqm-conditional-requiremen…
slavapestov Mar 16, 2022
cc0bc22
Correct The Parsing of Primary Associated Type Clauses in Protocols
CodaFi Mar 17, 2022
3aa4c0e
Merge pull request #41791 from tshortli/back-deploy-attr-integration-…
tshortli Mar 17, 2022
fb6503f
Merge pull request #41830 from LucianoPAlmeida/SR-15970-optional-conf…
LucianoPAlmeida Mar 17, 2022
f518c80
Move validation-test/compiler_crashers_2/sr8968.swift to test/Generic…
slavapestov Mar 17, 2022
5eb29ae
GSB: Relax -requirement-machine-protocol-signatures=verify check a li…
slavapestov Mar 16, 2022
a6199cf
Merge pull request #41841 from nate-chandler/lexical_lifetimes/ssa-de…
nate-chandler Mar 17, 2022
7c1c9ce
[SILOpt] Disabled DestroyHoisting.
nate-chandler Feb 19, 2022
1a0cd33
[Benchmark] Shortened local var lifetime.
nate-chandler Feb 25, 2022
74bf5cf
[Test] Tweaked test name.
nate-chandler Feb 22, 2022
672ec76
[NFC] Removed spurious namespacing.
nate-chandler Feb 24, 2022
43189db
Merge pull request #41845 from CodaFi/flag-sitter
CodaFi Mar 17, 2022
ce2c771
Merge pull request #41846 from ahoppen/pr/saw-solution-in-result-builder
ahoppen Mar 17, 2022
a9e9211
[ConstraintSystem] Augment condition/ternary simplication to support …
xedin Mar 16, 2022
eb6b267
[ConstraintSystem] Implement simplification of Witness, WrappedValue,…
xedin Mar 16, 2022
01691d6
[ConstraintSystem] ExpressionTimer: Simplify locators only if allotte…
xedin Mar 16, 2022
2c35b65
[CSDiagnostics] Adjust a couple of diagnostics to not respect differe…
xedin Mar 16, 2022
4af49e3
[CodeCompletion] Add test cases
ahoppen Mar 17, 2022
ca9056a
[TypeChecker] Add method to check whether a type variable represents …
ahoppen Mar 3, 2022
ea29723
[Distributed] Add name parameter to recordArgument for better interop
ktoso Mar 14, 2022
3ff972b
[Distributed] unlock some tests previously failing
ktoso Mar 15, 2022
20f28f8
[Distributed] make RemoteCallTarget Hashable, add availability
ktoso Mar 16, 2022
5a5d1ba
[Distributed] Implement RemoteCallArgument
ktoso Mar 16, 2022
f538d33
[CodeCompletion][Sema] Migrate CallArgurment position completion to t…
ahoppen Mar 17, 2022
a64b75e
Merge pull request #41808 from mikeash/more-signposts
mikeash Mar 17, 2022
e94abe4
Merge pull request #41847 from xedin/add-missing-locator-simplifications
xedin Mar 17, 2022
e63a064
[build-presets] Disable SourceKit-LSP tests on Linux
ahoppen Mar 17, 2022
8c21aaf
Merge pull request #41588 from rxwei/string-processing-swift-main
shahmishal Mar 17, 2022
9d52099
[cxx-interop] start to emitting a unified header file for a Swift module
hyp Mar 16, 2022
2dd9774
[CSGen] Use correct locator for member references in enum element pat…
xedin Mar 17, 2022
c5cef95
RequirementMachine: Minimal conformances collects protocol refinement…
slavapestov Mar 17, 2022
30da30e
RequirementMachine: Rule::isProtocolRefinementRule() allows transitiv…
slavapestov Mar 17, 2022
979196c
[Test] For disabling destroy hoisting.
nate-chandler Mar 17, 2022
064bce4
Add regression test for https://bugs.swift.org/browse/SR-15979
slavapestov Mar 17, 2022
1032464
[TypeChecker] NFC: Restrict multi-statement closure + simd test-case …
xedin Mar 17, 2022
82d8adf
Merge pull request #41863 from xedin/rdar-90445018
gottesmm Mar 17, 2022
613fdca
[CSDiagnostics] Fix trailing closure ambiguity note to not expect tha…
xedin Mar 17, 2022
f9f5476
Merge pull request #41856 from ahoppen/pr/disable-sourcekitlsp-tests
gottesmm Mar 17, 2022
ebdef12
[ContraintSystem] Augment `diagnoseAmbiguity` to diagnose non-express…
xedin Mar 17, 2022
41f176b
[Serialization] Abort if serializing CustomAttr with no type
bnbarham Mar 17, 2022
7e182cf
[ASTMangler] Add a special entry point for mangling of distributed th…
xedin Mar 17, 2022
c9a0295
[Distributed] Synthesis: Start using special mangling for distributed…
xedin Mar 17, 2022
cd93d23
Merge pull request #41831 from hyp/unify-header
hyp Mar 17, 2022
7390f7d
Merge pull request #41842 from slavapestov/gsb-relax-verify-check
slavapestov Mar 17, 2022
eaf3f31
Vectorize UTF16 offset calculations
Catfish-Man Mar 17, 2022
17ac201
Merge pull request #39373 from ahoppen/pr/solver-based-arg-completion
ahoppen Mar 17, 2022
b0a4efb
RequirementMachine: Fix lookupConcreteNestedType() to cope with opaqu…
slavapestov Mar 16, 2022
1e731d3
RequirementMachine: Don't assert on abstract conformance in desugarCo…
slavapestov Mar 16, 2022
4d531ae
RequirementMachine: Remove PropertyMap::ConcreteConformances
slavapestov Mar 16, 2022
2f727d6
RequirementMachine: Opaque archetype support (sort of)
slavapestov Mar 16, 2022
2b6379d
[AST] GenericSignature: Add a way to drop marker protocol requirements
xedin Mar 17, 2022
1330e34
[Distributed] IRGen: Drop marker protocol requirements from accessibl…
xedin Mar 17, 2022
78f6baf
Merge pull request #41827 from plotfi/main
zoecarver Mar 17, 2022
aa82a85
Merge pull request #41848 from CodaFi/parse-tial-credit
CodaFi Mar 17, 2022
ab03005
[Distributed] NFC: Add accessor section test-case to make sure that m…
xedin Mar 17, 2022
0e4e491
Add SIL Test for Parameterized Existential Conversions
CodaFi Mar 16, 2022
5db8647
[cxx-interop] Make sure to use TUScope when looking up clang decls.
zoecarver Mar 17, 2022
1301759
Merge pull request #41862 from slavapestov/add-test-sr15979
slavapestov Mar 17, 2022
13e64f3
[nfc][cxx-interop] Add some pretty stack traces for various things th…
zoecarver Mar 17, 2022
ce75256
Merge pull request #41851 from slavapestov/rqm-fix-protocol-refinemen…
slavapestov Mar 17, 2022
9a9f796
Merge pull request #41844 from artemcm/TargetInfoCarefulJSON
artemcm Mar 17, 2022
9ad3c9a
Use withUnsafeTemporaryAllocation instead of a temporary Array
Catfish-Man Mar 17, 2022
b258865
Merge pull request #41478 from nate-chandler/lexical_lifetimes/destro…
nate-chandler Mar 18, 2022
268309e
Add a function index
atrick Mar 15, 2022
61da992
Merge pull request #41799 from ktoso/wip-argumentNameRecording
ktoso Mar 18, 2022
e6d1ef9
Merge pull request #41868 from slavapestov/rqm-opaque-archetypes
slavapestov Mar 18, 2022
ae2feb5
Merge pull request #41663 from slavapestov/rqm-enable-stdlib-inferred…
slavapestov Mar 18, 2022
7d2aac6
[nfc][docs][cxx-interop] Add example in the status document.
zoecarver Mar 18, 2022
075e7c1
RequirementMachine: Add regression test for rdar://problem/90402519
slavapestov Mar 18, 2022
4e60aa1
RequirementMachine: Pass -requirement-machine-inferred-signatures=off…
slavapestov Mar 18, 2022
058190e
Enable -requirement-machine-inferred-signatures=verify by default
slavapestov Mar 3, 2022
2206b1c
RequirementMachine: Split up equivalence classes with inferred concre…
slavapestov Mar 18, 2022
1b94165
Merge pull request #41872 from CodaFi/existential-angst
CodaFi Mar 18, 2022
a8cec01
[CodeCompletion] Exit early in applyResultBuilderBodyTransform after …
ahoppen Mar 18, 2022
f4d2b0d
Merge pull request #41879 from zoecarver/add-example-docs
zoecarver Mar 18, 2022
422c87a
Merge pull request #41876 from zoecarver/add-pretty-prints
zoecarver Mar 18, 2022
0dd1311
Merge pull request #41650 from slavapestov/rqm-inferred-signatures-on…
slavapestov Mar 18, 2022
f7923ee
[build-presets] Disable SourceKit-LSP tests for SwiftPM Linux CI jobs
ahoppen Mar 18, 2022
ddf0965
Rewrite ClosureScopeAnalysis for generality.
atrick Mar 15, 2022
14fb9a0
Merge pull request #41871 from xedin/fix-mark-protocol-issues-related…
ktoso Mar 18, 2022
82fc059
[CodeCompletion] Store ignored arguments as `Expr *` instead of `Cons…
ahoppen Mar 18, 2022
e081091
Merge pull request #41826 from atrick/fix-recursive-closure
atrick Mar 18, 2022
333d2c2
Remove invalid install_swiftsyntax_parser preset (#41873)
keith Mar 18, 2022
8f791c1
Merge pull request #41884 from ahoppen/pr/disable-sourcekitlsp-tests-…
ahoppen Mar 18, 2022
1680ec3
Merge pull request #41853 from ahoppen/pr/add-fixed-test-cases
ahoppen Mar 18, 2022
32cdb77
Merge pull request #41865 from bnbarham/abort-if-custom-attr-has-no-type
bnbarham Mar 18, 2022
0b32adc
[swift-inspect] Fix taskToThread dictionary on watchOS.
mikeash Mar 18, 2022
cb082e1
Merge pull request #41866 from Catfish-Man/what-a-crumb-y-optimization
Catfish-Man Mar 18, 2022
4c9582c
Revert "Merge pull request #41831 from hyp/unify-header"
hyp Mar 18, 2022
8f14e91
Merge pull request #41861 from xedin/rdar-90347159
xedin Mar 18, 2022
adec767
[Concurrency] Have StackAllocator gracefully fail when passed a small…
mikeash Mar 18, 2022
5361369
Merge pull request #41874 from zoecarver/find-ns-object-in-cxx-mode
zoecarver Mar 18, 2022
07e54bf
Merge pull request #41890 from hyp/dev/unify-header
gottesmm Mar 18, 2022
0ba00db
[Test] Disabled a test temporarily.
nate-chandler Mar 18, 2022
59b62c2
NFC: Update tests to include "before: " label in the @_backDeploy att…
tshortli Mar 18, 2022
2a646dc
Parse: Require a "before: " label in the first item of the list in th…
tshortli Mar 18, 2022
f2ce515
Merge pull request #41889 from apple/fix-swift-inspect-watchos2
swift-ci Mar 18, 2022
b93717c
RequirementMachine: Enable flags directly in LangOptions
slavapestov Mar 18, 2022
0c5cc38
Parse: Add fix-its for 'before:' label parse errors in the @_backDepl…
tshortli Mar 18, 2022
ae2b514
[RemoteMirror][swift-inspect] Decode locks in priority-escalation con…
mikeash Mar 17, 2022
7f2bde2
Merge pull request #41895 from nate-chandler/test/20220318/1
swift-ci Mar 18, 2022
552d4b0
Merge pull request #41896 from slavapestov/rqm-langoptions-flags
slavapestov Mar 18, 2022
7785bf4
Make sure functions defined in a header are inline.
DougGregor Mar 18, 2022
36b41d4
Merge pull request #41869 from Catfish-Man/stack-promotion-and-ar-raise
Catfish-Man Mar 18, 2022
bc686e7
[Diagnostics] Change phrasing of the existential_requires_any warning
porglezomp Mar 19, 2022
9b1fced
backtrack on part of SE-327 dealing with default-value exprs
kavon Mar 19, 2022
c684c56
Merge pull request #41891 from mikeash/fix-async-let-stackallocator
mikeash Mar 19, 2022
6a5d51d
Sema: Fix structural resolution of protocol typealiases with UnboundG…
slavapestov Mar 19, 2022
e6308ed
Merge pull request #41907 from kavon/backtrack-defaultvalue-warning
swift-ci Mar 19, 2022
d0ee43c
Disable test while we investigte
ktoso Mar 19, 2022
81dc4dc
Merge pull request #41883 from ahoppen/pr/solver-based-completion-imp…
ahoppen Mar 19, 2022
17bcf79
Tests: Temporarily disable attr_backDeploy_evolution during swift_tes…
tshortli Mar 19, 2022
11ba9ee
Merge pull request #41908 from slavapestov/unbound-generic-protocol-t…
slavapestov Mar 19, 2022
eecdfb9
Merge pull request #41906 from porglezomp-misc/put-any-here
porglezomp Mar 19, 2022
b1f0bc4
Merge pull request #41911 from tshortli/disable-attr-backdeploy-evolo…
swift-ci Mar 19, 2022
2e3aa87
Revert "Revert "Merge pull request #41831 from hyp/unify-header""
hyp Mar 19, 2022
ee471f3
Fixed minor typo
nhatlee Mar 20, 2022
6e0dbf8
Merge pull request #41913 from nhatlee/patch-1
swift-ci Mar 20, 2022
c255f84
Merge pull request #41901 from DougGregor/inline-in-headers
DougGregor Mar 20, 2022
80bc75a
[cxx-interop] Emit C++ declarations only when '-clang-header-expose-p…
hyp Mar 21, 2022
67bb76a
fix change log typo
zntfdr Mar 21, 2022
e2a62f1
[CodeCompletion] Migrate expression completions to solver-based
ahoppen Mar 18, 2022
1124248
[Docs] Fix dead link to the C++ Interop manifesto
egorzhdan Mar 21, 2022
8ee187e
Add regression test for rdar://problem/90506460
slavapestov Mar 21, 2022
f522e56
Add regression test for rdar://problem/90506457
slavapestov Mar 21, 2022
a45940c
Merge pull request #41915 from zntfdr/patch-1
swift-ci Mar 21, 2022
a6a330c
Merge pull request #41912 from hyp/unify2
hyp Mar 21, 2022
8b51941
Merge pull request #41855 from mikeash/swift-inspect-locks
mikeash Mar 21, 2022
5e36a2a
Fix an AccessedStorage assert for SIL global variables.
atrick Jan 25, 2022
1f39f27
Merge pull request #41893 from tshortli/add-before-label-to-back-depl…
tshortli Mar 21, 2022
cca936e
RequirementMachine: Don't consider protocol typealiases with UnboundG…
slavapestov Mar 19, 2022
f1c5e07
Merge pull request #41920 from slavapestov/rqm-two-regression-tests
slavapestov Mar 21, 2022
3c5a6f9
Merge pull request #41864 from xedin/improvements-for-diagnoseAmbiguity
xedin Mar 21, 2022
404eb2c
GSB: Relax verify check some more in RequirementSignatureRequest
slavapestov Mar 21, 2022
6438c7e
Conservative Dynamic Casts to/from Parameterized Protocols
CodaFi Mar 21, 2022
f7a6005
Merge pull request #41919 from slavapestov/rqm-unbound-generic-protoc…
slavapestov Mar 21, 2022
86f9162
[PrintAsClang] NFC, refactor primitive type mapping logic out from De…
hyp Mar 18, 2022
5c2028d
Merge pull request #41918 from apple/egorzhdan-patch-1
egorzhdan Mar 21, 2022
458ce70
Merge pull request #41633 from ahoppen/pr/solver-based-global-complet…
ahoppen Mar 21, 2022
698ff60
Merge pull request #41926 from CodaFi/caster-oil
CodaFi Mar 21, 2022
01a254f
Merge pull request #41925 from slavapestov/gsb-relax-verify-check-more
slavapestov Mar 21, 2022
298a84a
RequirementMachine: Preserve sugar in desugarSameTypeRequirement()
slavapestov Mar 21, 2022
3571fa8
AST: Preserve sugar in TypeMatcher::visitBoundGenericType()
slavapestov Mar 21, 2022
3733da3
Merge pull request #41910 from apple/ktoso-patch-10
gottesmm Mar 21, 2022
aa00a58
Merge pull request #40996 from atrick/fix-sil-global
atrick Mar 21, 2022
9f9b81b
RequirementMachine: Explicitly specify SmallVector size
slavapestov Mar 21, 2022
bb29c35
Merge pull request #41828 from beccadax/a-breach-of-protocol-can-caus…
beccadax Mar 21, 2022
5fbd9b4
Merge pull request #41938 from slavapestov/rqm-linux-compile-fix
gottesmm Mar 21, 2022
b07b700
Merge pull request #41936 from slavapestov/rqm-preserve-sugar-fix
slavapestov Mar 21, 2022
e5bd9da
Merge pull request #41928 from hyp/i/ref-ptm
hyp Mar 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ docs/_build
.cache
.clangd

# SwiftPM
.build

#==============================================================================#
# Ignore CMake temporary files
#==============================================================================#
Expand All @@ -59,6 +62,7 @@ CMakeFiles
#==============================================================================#
compile_commands.json

#==============================================================================#
# Ignore generated GYB files until we fix the workaround on Windows
#==============================================================================#
8
Expand Down
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ _**Note:** This is in reverse chronological order, so newer entries are added to

## Swift 5.7

* [SE-0343][]:

Top-level scripts support asynchronous calls.

Using an `await` by calling an asynchronous function or accessing an isolated
variable transitions the top-level to an asynchronous context. As an
asynchronous context, top-level variables are `@MainActor`-isolated and the
top-level is run on the `@MainActor`.

Note that the transition affects function overload resolution and starts an
implicit run loop to drive the concurrency machinery.

Unmodified scripts are not affected by this change unless `-warn-concurrency` is
passed to the compiler invocation. With `-warn-concurrency`, variables in the
top-level are isolated to the main actor and the top-level context is isolated
to the main actor, but is not an asynchronous context.

* [SE-0336][]:

It is now possible to declare `distributed actor` and `distributed func`s inside of them.
Expand Down Expand Up @@ -37,7 +54,7 @@ func talkTo(greeter: Greeter) async throws {

* The compiler now emits a warning when a non-final class conforms to a protocol that imposes a same-type requirement between `Self` and an associated type. This is because such a requirement makes the conformance unsound for subclasses.

For example, Swift 5.6 would allow the following code, which at runtime would construct an instanec of `C` and not `SubC` as expected:
For example, Swift 5.6 would allow the following code, which at runtime would construct an instance of `C` and not `SubC` as expected:

```swift
protocol P {
Expand Down Expand Up @@ -79,7 +96,7 @@ For example, Swift 5.6 would allow the following code, which at runtime would co

* [SE-0341][]:

Opaque types can now be used in the parameters of functions and subscripts, wher they provide a shorthand syntax for the introduction of a generic parameter. For example, the following:
Opaque types can now be used in the parameters of functions and subscripts, when they provide a shorthand syntax for the introduction of a generic parameter. For example, the following:

```swift
func horizontal(_ v1: some View, _ v2: some View) -> some View {
Expand Down Expand Up @@ -9065,6 +9082,7 @@ Swift 1.0
[SE-0335]: <https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md>
[SE-0341]: <https://github.com/apple/swift-evolution/blob/main/proposals/0341-opaque-parameters.md>
[SE-0336]: <https://github.com/apple/swift-evolution/blob/main/proposals/0336-distributed-actor-isolation.md>
[SE-0343]: <https://github.com/apple/swift-evolution/blob/main/proposals/0343-top-level-concurrency.md>

[SR-75]: <https://bugs.swift.org/browse/SR-75>
[SR-106]: <https://bugs.swift.org/browse/SR-106>
Expand Down
14 changes: 8 additions & 6 deletions benchmark/single-source/SubstringTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,23 @@ public func run_SubstringFromLongStringGeneric(_ n: Int) {
}
}

@inline(never)
public func run_StringFromLongWholeSubstring(_ n: Int) {
private func getLongWideRealBuffer() -> String {
var s0 = longWide
s0 += "!" // ensure the string has a real buffer
let s = Substring(s0)
return s0
}

@inline(never)
public func run_StringFromLongWholeSubstring(_ n: Int) {
let s = Substring(getLongWideRealBuffer())
for _ in 1...n*500 {
blackHole(String(s))
}
}

@inline(never)
public func run_StringFromLongWholeSubstringGeneric(_ n: Int) {
var s0 = longWide
s0 += "!" // ensure the string has a real buffer
let s = Substring(s0)
let s = Substring(getLongWideRealBuffer())
for _ in 1...n*500 {
create(String.self, from: s)
}
Expand Down
2 changes: 2 additions & 0 deletions cmake/modules/Libdispatch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ foreach(sdk ${DISPATCH_SDKS})
${SWIFT_LIBDISPATCH_COMPILER_TRIPLE_CMAKE_ARGS}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}
-DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
Expand Down
146 changes: 146 additions & 0 deletions docs/CppInteroperability/CppInteroperabilityStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# C++ Interoperability Status

Swift has some experimental ability to interoperate with C++.
This document provides an overview of the status of the Swift and C++ interoperability support.

## C++ to Swift Interoperability Status

Swift has the experimental ability to import a large subset of C++.
This section of the document describes which C++ language and standard library features can be imported and used from Swift in an experimental manner.

### Example
The following example demonstrates several interop features. It compiles and runs on main.

```C++
// cxx-types.h (mapped to CxxTypes module in module.modulemap)
#include <algorithm>
#include <vector>

using V = std::vector<long>;
```

```Swift
// main.swift
import CxxTypes
import std.vector
import std.algorithm

// We can extend C++ types in Swift.
extension V : RandomAccessCollection {
public var startIndex: Int { 0 }
public var endIndex: Int { size() }
}

// Create a vector with some data.
var numbers = V(4)
std.fill(numbers.beginMutating(), numbers.endMutating(), 41)

// Transform it using C++.
std.transform(numbers.beginMutating(), numbers.endMutating(),
numbers.beginMutating()) { (element: Int) in
return element + 1
}

// Loop over it in Swift.
for (index, element) in numbers.enumerated() {
print("v[\(index)] = \(element)")
}

// We can also use anything in RandomAccessCollection, such as map and zip.
let strings = numbers.map { "\($0)" }
for (s, n) in zip(strings, numbers) {
print("\(s) = \(n)")
}
```

### Importing C++

There are currently two experimental ways to import C++ into Swift:
- **Clang modules**: can be imported into Swift. This requires a module map.
- **Bridging header**: can be imported into Swift. Headers included in the bridging header will be imported.
Please note that support for importing C++ 20 modules isn’t implemented.

Both CMake and the Swift package manager can be configured to invoke Swift with the correct arguments to import C++ headers.

**Note**: C++ code is imported using the Objective-C++ language mode on Apple platforms.

### Experimental C++ Language Support

This status table describes which of the following C++ language features can be used in Swift:

| **C++ Language Feature** | **Implemented Experimental Support For Using It In Swift** |
|---------------------------------------------|---------------------------------------------------------------|
| Top-level functions | Yes |
| Enumerations | Yes. That includes `enum class` |
| Struct / Class types | Yes - as value types, except for types without a copy constructor. Partial experimental support for importing a C++ struct/class as a reference type |
| Typedefs / Type aliases | Yes |
| Global Variables | Yes |
| Namespaces | Yes |
| Inline Namespaces | Yes, with some known issues (https://bugs.swift.org/browse/SR-15956) |
| Exceptions | No |
| Fields | Yes |
| Member functions | Yes. Some value category overloads aren't imported |
| Virtual Member Functions | No |
| Operators | Yes, with some known issues |
| Subscript Operators | Yes |
| Constructors | Yes. That includes implicit constructors |
| Destructor | Yes. C++ destructors are invoked automatically when the value is no longer used in Swift |
| Copy constructor / copy assignment operator | Yes. Swift invokes the underlying copy constructor when copying a C++ value |
| Move constructor / move assignment operator | No |
| Base class member functions / operators | Yes, with some known issues |
| Function templates | Yes |
| Class templates | Yes |
| Dependent types | Partially: imported as Any |
| Availability Attributes | Yes |


The following C++ code patterns or language features have specific mappings to Swift language features when imported in Swift:


| **C++ Language Feature** | **Imported Into Swift** |
|------------------------------------------------------|------------------------------------------------------------------------------------------|
| `get`/`set` member functions | Imported as computed property (starting from Swift-5.7) |
| `const`/non-`const` member function overload set | Both overloads are imported as a method, with non-`const` method being renamed to `mutating…` (starting from Swift-5.7). The renaming logic will change in a future version of Swift, and non-`const` methods won't be renamed |


Unless stated otherwise (i.e., imported reference types) all Swift features work with imported types. For example: use in generic contexts, protocol conformance, extensions, etc.


### C++ Standard Library Support

Parts of libc++ can be imported and used from Swift.

This status table describes which of the following C++ standard library features have some experimental support for using them in Swift. Please note that this is not a comprehensive list and other libc++ APIs that use the above supported C++ language features could be imported into Swift.

| **C++ Standard Library Feature** | **Can Be Used From Swift** |
|------------------------------------|----------------------------------------------|
| `std::string` | Yes |
| `std::vector` | Yes |

## Known Issues

### Inline Namespaces
- https://bugs.swift.org/browse/SR-15956: Swift's typechecker currently doesn't allow calling a function from an inline namespace when it's referenced through the parent namespace. Example of a test that fails: https://github.com/apple/swift/blob/main/test/Interop/Cxx/namespace/inline-namespace-function-call-broken.swift


## Swift to C++ Interoperability Status

This section of the document describes which Swift language and standard library features can be imported and used from C++.

### Importing Swift

Swift has some experimental support for generating a header that can be imported by C++.

### Swift Language Support

This status table describes which of the following Swift language features have some experimental support for using them in C++.

**Functions**

| **Swift Language Feature** | **Implemented Experimental Support For Using It In C++** |
|--------------------------------|----------------------------------------------------------|
| Top-level `@_cdecl` functions | Yes |
| Top-level Swift functions | Partially, only with C compatible types |
| `inout` parameters | No |
| Variadic parameters | No |
| Multiple return values | No |
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ documentation, please create a thread on the Swift forums under the
Describes the goals and design for Library Evolution.
- [BuildManifesto.md](/docs/BuildManifesto.md):
Provides an outline for modularizing the build system for the Swift toolchain.
- [CppInteroperabilityManifesto.md](/docs/CppInteroperabilityManifesto.md):
- [CppInteroperabilityManifesto.md](/docs/CppInteroperability/CppInteroperabilityManifesto.md):
Describes the motivation and design for first-class Swift-C++ interoperability.
- [DifferentiableProgramming.md](/docs/DifferentiableProgramming.md):
Outlines a vision and design for first-class differentiable programming in Swift.
Expand Down
17 changes: 11 additions & 6 deletions docs/ReferenceGuides/UnderscoredAttributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ Most notably, default argument expressions are implicitly
`@_alwaysEmitIntoClient`, which means that adding a default argument to a
function which did not have one previously does not break ABI.

## `@_backDeploy(availabilitySpec ...)`
## `@_backDeploy(before: ...)`

Causes the body of a function to be emitted into the module interface to be
available for inlining in clients with deployment targets lower than the formal
availability of the function. When inlined, the body of the function is
transformed such that it calls the library's copy of the function if it is
available at runtime. Otherwise, the copy of the original function body is
executed.
available for emission into clients with deployment targets lower than the
ABI availability of the function. When the client's deployment target is
before the function's ABI availability, the compiler replaces calls to that
function with a call to a thunk that checks at runtime whether the original
library function is available. If the the original is available then it is
called. Otherwise, the fallback copy of the function that was emitted into the
client is called instead.

For more details, see the [pitch thread](https://forums.swift.org/t/pitch-function-back-deployment/55769/)
in the forums.

## `@_assemblyVision`

Expand Down
12 changes: 8 additions & 4 deletions include/swift/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -988,11 +988,11 @@ class ASTContext final {
/// one.
void loadExtensions(NominalTypeDecl *nominal, unsigned previousGeneration);

/// Load the methods within the given class that produce
/// Load the methods within the given type that produce
/// Objective-C class or instance methods with the given selector.
///
/// \param classDecl The class in which we are searching for @objc methods.
/// The search only considers this class and its extensions; not any
/// \param tyDecl The type in which we are searching for @objc methods.
/// The search only considers this type and its extensions; not any
/// superclasses.
///
/// \param selector The selector to search for.
Expand All @@ -1010,7 +1010,11 @@ class ASTContext final {
///
/// \param swiftOnly If true, only loads methods from imported Swift modules,
/// skipping the Clang importer.
void loadObjCMethods(ClassDecl *classDecl, ObjCSelector selector,
///
/// \note Passing a protocol is supported, but currently a no-op, because
/// Objective-C protocols cannot be extended in ways that make the ObjC method
/// lookup table relevant.
void loadObjCMethods(NominalTypeDecl *tyDecl, ObjCSelector selector,
bool isInstanceMethod, unsigned previousGeneration,
llvm::TinyPtrVector<AbstractFunctionDecl *> &methods,
bool swiftOnly = false);
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/ASTMangler.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ class ASTMangler : public Mangler {
Type GlobalActorBound,
ModuleDecl *Module);

std::string mangleDistributedThunk(const FuncDecl *thunk);

/// Mangle a completion handler block implementation function, used for importing ObjC
/// APIs as async.
///
Expand Down
Loading