Skip to content

Merge main 2023-01-05 #5139

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 213 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
d47bba6
Improve diagnostics when attempting to extend existential type
cbjeukendrup Aug 20, 2022
187cf81
[CS] Increase the score for implicit global actor function conversion
LucianoPAlmeida Dec 12, 2022
6ab641e
Add zippering support
etcwilde Oct 17, 2022
41d4171
Build with catalyst support in nightly osx package
etcwilde Dec 21, 2022
a31b1c5
Centralise code to map between UTF-8 and UTF-16 on Windows.
al45tair Dec 15, 2022
ca771c4
Change to returning `nullptr` rather than triggering a fatal error.
al45tair Dec 15, 2022
fb1211e
Rename the functions as they're exported as C APIs.
al45tair Dec 16, 2022
e73de53
Move _swift_win32_withDbgHelpLibrary into the new header.
al45tair Dec 16, 2022
a13d677
Make the UTF8-to-wide functions into SPI rather than internal.
al45tair Dec 21, 2022
697dfba
[TypeChecker] Enable result builder AST transform by default
xedin Aug 5, 2022
36a50c7
[ResultBuilder] Don't run syntactic diagnostics on transformed do sta…
xedin Jun 20, 2022
c03addb
[CodeCompletion] Insert code completion token into build block call t…
ahoppen Jun 14, 2022
3c90c89
[CodeCompletion] Drop ForCodeCompletion constraint system option for …
ahoppen Jun 14, 2022
5292699
[AST] Drop `ResultBuilderASTTransform` feature flag
xedin Dec 21, 2022
b01d21b
[BuilderTransform] NFC: Correctly indent transformed body debug printing
xedin Dec 21, 2022
1e6e6e9
[BuilderTransform] NFC: Adjust variable declaration tests
xedin Nov 18, 2022
59d1df7
[Serialization] Wait after the decl to deserialize custom attrs
xymus Dec 17, 2022
cc3d2ec
[Test] Update test to be tolerant to attribute order changes
xymus Dec 20, 2022
9479192
[borrow-expr] Add simple support for borrow-expr but don't wire it up…
gottesmm Dec 21, 2022
e8d2d02
[borrow-keyword] Add some more small tests to show we can call method…
gottesmm Dec 21, 2022
9e61b01
Rework computation of local discriminators for named entities.
DougGregor Dec 21, 2022
b9aee05
(Mostly) get rid of Parser::setLocalDiscriminator.
DougGregor Dec 21, 2022
b399b92
[Parser] Remove the notion of a "local context".
DougGregor Dec 21, 2022
699ef07
[Sema] RuntimeMetadata: Add support for mutating methods via a thunk
xedin Dec 22, 2022
23cf6a1
[Sema] RuntimeMetadata: Add support for async functions and actor met…
xedin Dec 22, 2022
ecc2042
Add error checks for input package name
elsh Dec 20, 2022
3c5ea2e
Merge branch 'main' into es-pkg-err
elsh Dec 22, 2022
813f542
[Compile Time Constant Extraction] Add extraction of Dictionary values.
Dec 22, 2022
4de9197
Opaque types never have local discriminators
DougGregor Dec 22, 2022
e8f1d9f
AST: Fix a warning in ASTPrinter.cpp.
tshortli Dec 20, 2022
d480410
Sema: Diagnose unsupported clang decls for #_hasSymbol.
tshortli Dec 21, 2022
2e8857d
IRGen: Add `#_hasSymbol` support for clang function decls and ObjC cl…
tshortli Dec 2, 2022
c849cbe
Remove extraneous debugging code
DougGregor Dec 22, 2022
3e2bafc
[Macro] Add the `expression` attribute for macro declarations
DougGregor Dec 20, 2022
a0aa318
Address PR feedback, including narrowing element type of `DictionaryV…
Dec 22, 2022
f78f572
Start requiring expression macros to be marked with `@expression`
DougGregor Dec 21, 2022
aa969c7
[Module trace] Eliminate use of `report_fatal_error` in non-assertion…
DougGregor Dec 22, 2022
d3540e6
[ASTScope] Remove a now-incorrect and not-actually-useful assertion.
DougGregor Dec 22, 2022
b4a1fc6
Check that pointer type is `TupleValue` before doing the static cast.
Dec 22, 2022
9df8541
Accessors never have local discriminators
DougGregor Dec 22, 2022
623bfb1
[cxx-interop] Fix typo in `test/Interop/Cxx/stdlib/overlay/Inputs/cus…
egorzhdan Dec 22, 2022
d663bb4
[cxx-interop] Treat name lookup as successful if we found a C++ membe…
egorzhdan Dec 22, 2022
94f1391
[borrow-expr] Wire up borrow expr to SILGenApply.
gottesmm Dec 21, 2022
69c33fc
Fix up some tests.
gottesmm Dec 22, 2022
f8a5418
Zipper all the things!
etcwilde Dec 22, 2022
60486e6
[Tests] RuntimeMetadata: Optimize attribute section checking
xedin Dec 23, 2022
4789369
[CSClosure] Fix handling of non-representivate variables
xedin Dec 24, 2022
25a8838
Get the compiler building again on 32-bit architectures
finagolfin Dec 26, 2022
76981b4
stdlib: repair 32bit non-Darwin build for TypeLayout
kateinoigakukun Dec 27, 2022
483087a
[stdlib] Speed up short UTF-16 distance calculations
lorentey Dec 21, 2022
f3a9305
[stdlib] Simplify breadcrumbs avoidance paths in String.UTF16View
lorentey Dec 28, 2022
2423b8b
[stdlib] StringProtocol._toUTF16Indices: Speed up conversion of short…
lorentey Dec 28, 2022
6fee1b3
[stdlib] Breadcrumbs are spaced in UTF-16 code units, not UTF-8
lorentey Dec 28, 2022
f6b453f
[benchmark] Add some distance(from:to:) benchmarks for String views
lorentey Dec 28, 2022
20e573c
build: adopt static linking for Yams on Windows toolchain
compnerd Dec 28, 2022
3edb034
[benchmark] StringDistance: Decrease workload
lorentey Dec 28, 2022
54aa105
[benchmark] StringDistance: Add ASCII cases
lorentey Dec 28, 2022
ec35728
[stdlib] String.UTF16View: Rework thresholds for relative indexing
lorentey Dec 29, 2022
d00f8ed
[stdlib] Optimize StringProtocol._toUTF16Indices/_toUTF16Offsets
lorentey Dec 29, 2022
42f1389
[benchmark] Why is this thing not written in Swift?
lorentey Dec 29, 2022
fd01ed6
[benchmark] StringDistance: Increase ASCII workload
lorentey Dec 29, 2022
f028016
Fix two documentation links that weren't working
whiteio Dec 29, 2022
7d89d62
[stdlib] Remove `@_specialize` attributes obsoleted by explicit type …
lorentey Dec 29, 2022
fce428e
[stdlib] String.UTF16View: Tweak ASCII paths
lorentey Dec 29, 2022
4565485
[benchmark] Why oh why is this not written in Swift?
lorentey Dec 30, 2022
114d392
[benchmark] StringDistance: Increase ASCII workload by an additional 10x
lorentey Dec 30, 2022
4d9edad
[test] Improve grapheme breaking tests
lorentey Dec 30, 2022
ef0e79b
[stdlib] String: Move shouldBreak into _GraphemeBreakingState
lorentey Dec 30, 2022
55583ac
[stdlib] Add new SPI for grapheme breaking (outside String)
lorentey Dec 30, 2022
2d9e9b2
Revert all changes to Benchmark_Driver
lorentey Dec 31, 2022
e885037
[stdlib] String: Expose _index(roundingDown:) functions in all String…
lorentey Dec 30, 2022
f8b997b
[test] Add tests for string index rounding
lorentey Jan 1, 2023
9dd7475
[test] Fix and reenable a Substring.removeSubrange test
lorentey Jan 1, 2023
051f9ed
[test] String.UTF16View: Add some basic collection tests
lorentey Jan 2, 2023
5d354ce
[stdlib] Fix String.UTF16View.distance(from:to:)
lorentey Jan 2, 2023
8816034
SILInliner: make `SILInliner::Loc` not an optional
eeckstein Dec 15, 2022
6711c90
SILBuilder: add an assertion in `getInsertionPointLoc()`
eeckstein Dec 21, 2022
fbe83d5
SILPrinter: improve printing of debug locations
eeckstein Dec 15, 2022
8dbbfab
AST: add debug locations for generated `IntegerLiteralExpr`s
eeckstein Dec 21, 2022
cd45058
ReleaseCodeMotion: use a SmallVector instead of a SetVector for RCRoo…
eeckstein Dec 21, 2022
0c6f0bb
StringOptimization: preserve debug scopes when creating calls to the …
eeckstein Dec 21, 2022
eaf0532
[Diagnostics] Relax contextual type presence from assertion to a check
xedin Dec 29, 2022
60e573a
Merge pull request #62760 from DougGregor/remove-wrong-unnecessary-as…
DougGregor Jan 3, 2023
0e691c4
Merge pull request #62747 from DougGregor/expression-macro-attr
DougGregor Jan 3, 2023
c1a85c1
Merge pull request #62741 from DougGregor/local-named-discriminators
DougGregor Jan 3, 2023
0407610
[Macros] Don't parse the macro expansion buffer twice.
DougGregor Dec 22, 2022
bdc01ea
[Macros] Handle macro argument lists in diagnostics
DougGregor Dec 22, 2022
af49a90
Customize diagnostic text for extra/missing/mislabeled arguments for …
DougGregor Dec 22, 2022
4ed393d
[Macros] Add a test of a variadic "print" macro.
DougGregor Dec 22, 2022
806b5a8
[Macros] Diagnose errors where a macro is used without the '#'.
DougGregor Dec 23, 2022
36dd677
[Macros] Don't stop lookup early if we found a macro.
DougGregor Dec 23, 2022
6bad02c
[Macros] Implement overloading rules
DougGregor Dec 23, 2022
71ca9c8
[Macros] Diagnose when we forget to provide macro arguments.
DougGregor Dec 24, 2022
6bb9cb8
[Macros] Always parse macro expansions, diagnose later
DougGregor Dec 24, 2022
222bc03
[Macros] Prevent recursive expansion of macros.
DougGregor Dec 24, 2022
bbb5c7a
[Macros] Allow enums and classes/actors to be macro definitions, too
DougGregor Dec 24, 2022
1b14b5d
Fixup some test cases
DougGregor Dec 24, 2022
271048c
[Macros] Fix diagnostic location
DougGregor Dec 25, 2022
8cbae04
One last little test fix
DougGregor Dec 25, 2022
76e0d5e
[Macro] API digester support for macro declarations
DougGregor Jan 3, 2023
49b42b4
Handle indexing of macros
DougGregor Jan 3, 2023
7000969
Introduce and use `#externalMacro` for externally-defined macros.
DougGregor Jan 3, 2023
0868889
Add new source file Macros.swift
DougGregor Jan 3, 2023
5936b7b
Add test that started crashing with my initial rework of closure disc…
DougGregor Jan 3, 2023
bff03d9
Merge pull request #62786 from compnerd/static-yams
compnerd Jan 3, 2023
2a36e56
Update the README to include UBI 9 (#62804)
shahmishal Jan 3, 2023
24bd6fc
Merge pull request #62734 from xedin/enable-result-builder-ast-transf…
xedin Jan 3, 2023
29bf82e
[CSSimplify] Fix sub-pattern matching logic related closure and enum …
takeshi-1000 Jan 3, 2023
7214650
Merge pull request #62745 from tshortli/has-symbol-clang-decls
swift-ci Jan 3, 2023
f55db69
Merge pull request #62762 from apple/egorzhdan/cxx-iterator-test-typo
egorzhdan Jan 3, 2023
0620226
Merge pull request #62763 from apple/egorzhdan/cxx-op-lookup-false
egorzhdan Jan 3, 2023
f47c00c
[docs] modified sentence structure
teddy5518 Jan 3, 2023
745d92d
[cxx-interop] Allow instantiated operator methods to serve as protoco…
egorzhdan Dec 22, 2022
d5eca6c
Merge pull request #62781 from kateinoigakukun/pr-1c50f837dff8c45e643…
swift-ci Jan 3, 2023
0c54362
Merge pull request #62768 from DougGregor/macro-omnibus
DougGregor Jan 3, 2023
961535d
Merge pull request #62759 from DougGregor/loaded-module-trace-no-crash
DougGregor Jan 3, 2023
b95fe48
Merge pull request #62742 from gottesmm/pr-947919228bebf49e02eae5aedb…
gottesmm Jan 3, 2023
1625013
[cxx-interop] Update and enable libc++ module interface test
egorzhdan Jan 3, 2023
a081e04
SILCombine: fix a crash when optimizing keypath-offset-of
eeckstein Jan 3, 2023
cebc00e
Merge pull request #62790 from whiteio/whiteio/fix-documentation-links
egorzhdan Jan 3, 2023
d38271c
Merge pull request #62764 from apple/egorzhdan/cxx-op-witness
egorzhdan Jan 3, 2023
6263956
Mangler: Fix substitution ordering when mangling opaque return types.
jckarter Dec 20, 2022
6e12fff
80-col formatting
atrick Dec 15, 2022
25abbac
Drop an obstructive const qualifier.
atrick Dec 15, 2022
090f049
Add an error message to unit test runner
atrick Dec 15, 2022
c2ae7e0
Add visitForwardedGuaranteedOperands utility.
atrick Dec 6, 2022
0a94845
Add findEnclosingDefs and findBorrowIntroducers utilities.
atrick Dec 6, 2022
b85aea1
Unit tests for findEnclosingDefs and findBorrowIntroducers.
atrick Dec 9, 2022
1052a60
Merge pull request #62738 from xedin/runtime_attr_method_thunks
xedin Jan 3, 2023
ac10f2a
Merge pull request #62811 from apple/egorzhdan/libcxx-test-fix
egorzhdan Jan 3, 2023
733e51f
[SILDeclRef] Expand `kind` by one bit because `RuntimeAttributeGenera…
xedin Jan 3, 2023
0db4ee4
Merge pull request #62653 from xymus/deser-custom-attr-cycle-alt
xymus Jan 3, 2023
2368292
[SE-0368] StaticBigInt: Fix test failures (#62746)
benrimmington Jan 3, 2023
099c643
[Sema] RuntimeMetadata: Require "self" for both static and instance m…
xedin Jan 3, 2023
770af1c
Merge pull request #62783 from lorentey/string-distance-benchmarks
lorentey Jan 3, 2023
8cd86a2
Merge pull request #62799 from lorentey/reenable-string-test
lorentey Jan 3, 2023
f407389
Merge pull request #62634 from atrick/enclosing-def
swift-ci Jan 3, 2023
e9d1d30
Stop using SWIFT_STDLIB_SINGLE_THREADED_CONCURRENCY under SWIFT_STDLI…
kubamracek Jan 3, 2023
cd55016
[test] Cleanup
lorentey Jan 4, 2023
e46f8f8
[stdlib] String.UTF16View: Align indices before calling default algor…
lorentey Jan 4, 2023
701a03b
Remove prefix+ from StaticBigInt (#62733)
stephentyrone Jan 4, 2023
f97bf69
Merge pull request #62772 from teddy5518/patch-1
CodaFi Jan 4, 2023
b5ab1c8
Fix bug: wrong var used (#62683)
valeriyvan Jan 4, 2023
87422e5
[stdlib] _CharacterRecognizer: Remove initializer argument
lorentey Jan 4, 2023
fa2f63c
[stdlib] _CharacterRecognizer._firstBreak(inUncheckedUnsafeUTF8Buffer…
lorentey Jan 4, 2023
e88e947
Merge pull request #62712 from etcwilde/ewilde/zipping-zippers-zip
etcwilde Jan 4, 2023
d3c3d87
Merge pull request #62812 from eeckstein/fix-keypath-opt-crash
eeckstein Jan 4, 2023
bc2bb5b
Merge pull request #62771 from eeckstein/debug-info
eeckstein Jan 4, 2023
3d86732
EscapeUtils: fix a wrong handling of argument indices in walkUpApplyR…
eeckstein Jan 4, 2023
1f920d5
[cxx-interop] Instantiate templated `operator==` for iterator types
egorzhdan Dec 22, 2022
ae7e5b5
LICM: add limits for the number of alias checks to avoid large compil…
eeckstein Jan 4, 2023
3ab94f1
Comment out an expensive assert in type lowering.
eeckstein Jan 4, 2023
e105c22
[Driver][Tests] Disable failing tests as they're affecting PR testing.
al45tair Jan 4, 2023
0d52c41
[Compile Time Constant Extraction] Add extraction of paren expression…
jPaolantonio Jan 4, 2023
32ee81e
[Gardening] Fixed comment.
nate-chandler Dec 3, 2022
cab17c7
[NFC] AddressLowering: Reuse old operand index.
nate-chandler Dec 9, 2022
24bbac5
[Test] Removed unused pattern match.
nate-chandler Dec 12, 2022
0943693
[Gardening] Fix typo.
nate-chandler Dec 14, 2022
8d17dc4
[Gardening] Fixed typo.
nate-chandler Dec 15, 2022
1264e6d
[NFC] AddressLowering: Promote copy-store check.
nate-chandler Dec 15, 2022
2a81238
[AddrLowering] Copy for out-of-range guar stores.
nate-chandler Dec 15, 2022
b3ee1fd
[AddrLowering] Copy for out-of-range owned stores.
nate-chandler Dec 15, 2022
356f2b7
[AddressLowering] Added TODO.
nate-chandler Jan 4, 2023
c31cab2
Merge pull request #62827 from al45tair/wrangler/PR-103867585
swift-ci Jan 4, 2023
74a5b6a
Allow the "macros" experimental feature to be enabled in production c…
DougGregor Jan 4, 2023
2e25c2f
Merge pull request #62791 from xedin/rdar-103739206
xedin Jan 4, 2023
449acae
Merge pull request #62813 from xedin/expand-sildeclref-kind-by-one-bit
xedin Jan 4, 2023
f8bf74b
Merge pull request #62773 from xedin/rdar-83418797
xedin Jan 4, 2023
3ffbc45
Merge pull request #62743 from jckarter/mangler-structural-opaque-typ…
jckarter Jan 4, 2023
db801af
Handle null macro references in the semantic annotator
DougGregor Jan 4, 2023
df00577
Merge pull request #62609 from nate-chandler/opaque-values/2/20221214
swift-ci Jan 4, 2023
d6ed370
Merge pull request #62818 from xedin/runtime-metadata-thunks-should-h…
xedin Jan 4, 2023
0d082df
[ABI] RuntimeMetadata: Adjust type field to make it a symbolic reference
xedin Jan 4, 2023
d023147
Merge pull request #62514 from LucianoPAlmeida/contextual-ambiguous
kavon Jan 4, 2023
5e59444
Merge pull request #62835 from DougGregor/macros-experimental-in-prod
swift-ci Jan 4, 2023
55a6b34
[IRGen] RuntimeMetadata: Reference type descriptors indirectly when r…
xedin Jan 4, 2023
ef98a3c
[borrow-operator] Add initial support for applying _borrow to self wh…
gottesmm Jan 4, 2023
020db23
[AST] TypeWrappers: Always allow attributes that come from swiftinter…
xedin Dec 23, 2022
ed2e07e
[Sema] TypeWrappers: If type wrapper comes from `.swiftinterface` use…
xedin Dec 23, 2022
0987eff
[Sema] TypeWrappers: Availability of `init(storageWrapper:)` should m…
xedin Dec 23, 2022
740ae8d
[Tests] TypeWrappers/NFC: Add a tests to round-trip type wrappers in …
xedin Jan 4, 2023
4f84d8a
[Sema] TypeWrappers: Request type wrapper attribute type eagerly
xedin Jan 5, 2023
e7fc160
Add Clock.sleep(for:). (#61222)
mbrandonw Jan 5, 2023
1b1439b
Merge remote-tracking branch 'origin/main' into katei/merge-main-2023…
kateinoigakukun Jan 5, 2023
892d0a2
[stdlib] String.UTF8View.index(_:offsetBy:limitedBy:): mark encoding …
lorentey Jan 5, 2023
4ffc5fe
Merge pull request #62717 from lorentey/string-utf16-speedup
lorentey Jan 5, 2023
d358ece
Merge pull request #62798 from lorentey/string-index-rounding
lorentey Jan 5, 2023
497a8dc
Merge pull request #62844 from DougGregor/sema-annotator-crash-62840
DougGregor Jan 5, 2023
0144fb6
Merge pull request #62830 from eeckstein/fix-compiletime-bugs
eeckstein Jan 5, 2023
7c54be2
SILCombine: a better fix for optimizing keypath-offset-of
eeckstein Jan 5, 2023
c945561
Merge pull request #62794 from lorentey/character-recognizer
lorentey Jan 5, 2023
ce4ec08
Merge pull request #62838 from xedin/type-wrappers-and-swiftinterfaces
xedin Jan 5, 2023
e26affa
ComputeSideEffects: correct side effects for destroy_addr
eeckstein Jan 5, 2023
1f0f9d6
ComputeSideEffects: ignore side effects of debug_value with address o…
eeckstein Jan 5, 2023
a5c81b9
Merge pull request #62828 from eeckstein/fix-escape-utils
eeckstein Jan 5, 2023
bbe27f9
Merge pull request #62605 from al45tair/eng/PR-103397975
al45tair Jan 5, 2023
f2c8a70
Update Lexicon to add reference link to SIL and ir/refutable pattern …
denoni Jan 5, 2023
e5e9827
Merge pull request #60680 from cbjeukendrup/diag_unsupported_existent…
LucianoPAlmeida Jan 5, 2023
25c9a6a
Merge pull request #62855 from gottesmm/pr-9ca4f16fc6bbe7422d4aa05b73…
gottesmm Jan 5, 2023
f588020
Merge pull request #62862 from eeckstein/silcombine-keypath-opt
eeckstein Jan 5, 2023
f8b1a2e
Merge pull request #62780 from buttaface/32-bit-cast
CodaFi Jan 5, 2023
b5217e6
Merge pull request #62757 from apple/egorzhdan/cxx-instantiate-iterat…
egorzhdan Jan 5, 2023
3f151fe
Merge pull request #62850 from xedin/fix-type-reference-for-runtime-m…
xedin Jan 5, 2023
5683a61
Merge pull request #62752 from quinntaylor/const-extract-dictionary
quinntaylor Jan 5, 2023
6b33768
Merge pull request #62864 from eeckstein/fix-compute-side-effects
eeckstein Jan 5, 2023
12477b7
[Dependency Scanning] Refactor the scanner to resolve unqualified mod…
artemcm Dec 19, 2022
0bdc84b
Merge pull request #62859 from lorentey/mark-utf8-index-encoding
lorentey Jan 5, 2023
f315e11
Merge pull request #62707 from apple/es-pkg-err
elsh Jan 5, 2023
2f0eab7
[test] Disable test/stdlib/StringIndex.swift to unblock CI
lorentey Jan 6, 2023
be69529
Merge pull request #62875 from apple/disable-string-index-test
xedin Jan 6, 2023
b205a9c
Merge pull request #62696 from artemcm/BetterScannerDependencyResolution
artemcm Jan 6, 2023
dd6422c
Merge remote-tracking branch 'apple/main' into katei/merge-main-2023-…
kateinoigakukun Jan 6, 2023
67af65d
[test] add missing WASILibc import in cancellation_handler.swift
kateinoigakukun Jan 7, 2023
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
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ set(COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_OSX "10.9")
set(COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_IOS "7.0")
set(COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_TVOS "9.0")
set(COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_WATCHOS "2.0")
set(COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_MACCATALYST "13.1")

#
# User-configurable debugging options.
Expand Down Expand Up @@ -590,6 +591,13 @@ option(SWIFT_THREADING_PACKAGE
Valid package names are 'pthreads', 'darwin', 'linux', 'win32', 'c11', 'none'
or the empty string for the SDK default.")

option(SWIFT_ENABLE_MACCATALYST
"Build the Standard Library and overlays with MacCatalyst support"
FALSE)

set(SWIFT_DARWIN_DEPLOYMENT_VERSION_MACCATALYST "14.5" CACHE STRING
"Minimum deployment target version for macCatalyst")

#
# End of user-configurable options.
#
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ to track the status of our builds, please refer to our [GitHub Actions page](htt
| **CentOS 7** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-centos-7/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-centos-7)|
| **Amazon Linux 2** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-amazon-linux-2/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-amazon-linux-2)|
| **Amazon Linux 2** | AArch64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-amazon-linux-2-aarch64/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-amazon-linux-2-aarch64)|
| **Universal Base Image 9** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-package-ubi-9/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubi-9)|

**Swift Community-Hosted CI Platforms**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ private struct CollectedEffects {
addDestroyEffects(of: inst.operands[0].value)

case let da as DestroyAddrInst:
// A destroy_addr also involves a read from the address. It's equivalent to a `%x = load [take]` and `destroy_value %x`.
addEffects(.read, to: da.operand)
// Conceptually, it's also a write, because the stored value is not available anymore after the destroy
addEffects(.write, to: da.operand)

addDestroyEffects(of: da.operand)

case let copy as CopyAddrInst:
Expand All @@ -108,12 +113,16 @@ private struct CollectedEffects {
addEffects(.copy, to: copy.source)
}
if !copy.isInitializationOfDest {
// Like for destroy_addr, the destroy also involves a read.
addEffects(.read, to: copy.destination)
addDestroyEffects(of: copy.destination)
}

case let store as StoreInst:
addEffects(.write, to: store.destination)
if store.destinationOwnership == .assign {
// Like for destroy_addr, the destroy also involves a read.
addEffects(.read, to: store.destination)
addDestroyEffects(of: store.destination)
}

Expand Down Expand Up @@ -433,7 +442,8 @@ private struct ArgumentEscapingWalker : ValueDefUseWalker, AddressDefUseWalker {
return .continueWalk

// Warning: all instruction listed here, must also be handled in `CollectedEffects.addInstructionEffects`
case is StoreInst, is StoreWeakInst, is StoreUnownedInst, is ApplySite, is DestroyAddrInst:
case is StoreInst, is StoreWeakInst, is StoreUnownedInst, is ApplySite, is DestroyAddrInst,
is DebugValueInst:
return .continueWalk

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,10 @@ fileprivate struct EscapeWalker<V: EscapeVisitor> : ValueDefUseWalker,
switch effect.kind {
case .escapingToReturn(let toPath, let exclusive):
if exclusive && path.projectionPath.matches(pattern: toPath) {
let arg = apply.arguments[effect.argumentIndex]
guard let callerArgIdx = apply.callerArgIndex(calleeArgIndex: effect.argumentIndex) else {
return .abortWalk
}
let arg = apply.arguments[callerArgIdx]

let p = Path(projectionPath: effect.pathPattern, followStores: path.followStores, knownType: nil)
if walkUp(addressOrValue: arg, path: p) == .abortWalk {
Expand Down
1 change: 1 addition & 0 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ set(SWIFT_BENCH_MODULES
single-source/StrToInt
single-source/StringBuilder
single-source/StringComparison
single-source/StringDistance
single-source/StringEdits
single-source/StringEnum
single-source/StringInterpolation
Expand Down
204 changes: 204 additions & 0 deletions benchmark/single-source/StringDistance.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
//===--- StringEdits.swift ------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

import TestsUtils

public let benchmarks: [BenchmarkInfo] = [
BenchmarkInfo(
name: "StringDistance.characters.mixed",
runFunction: { n in
run_characters(string: mixedString, ranges: mixedRanges, n: n)
},
tags: [.api, .String],
setUpFunction: { blackHole(mixedRanges) }),
BenchmarkInfo(
name: "StringDistance.scalars.mixed",
runFunction: { n in
run_scalars(string: mixedString, ranges: mixedRanges, n: n)
},
tags: [.api, .String],
setUpFunction: { blackHole(mixedRanges) }),
BenchmarkInfo(
name: "StringDistance.utf16.mixed",
runFunction: { n in
run_utf16(string: mixedString, ranges: mixedRanges, n: n)
},
tags: [.api, .String],
setUpFunction: { blackHole(mixedRanges) }),
BenchmarkInfo(
name: "StringDistance.utf8.mixed",
runFunction: { n in
run_utf8(string: mixedString, ranges: mixedRanges, n: n)
},
tags: [.api, .String],
setUpFunction: { blackHole(mixedRanges) }),
BenchmarkInfo(
name: "StringDistance.characters.ascii",
runFunction: { n in
run_characters(string: asciiString, ranges: asciiRanges, n: n)
},
tags: [.api, .String],
setUpFunction: { blackHole(asciiRanges) }),
BenchmarkInfo(
name: "StringDistance.scalars.ascii",
runFunction: { n in
run_scalars(string: asciiString, ranges: asciiRanges, n: n)
},
tags: [.api, .String],
setUpFunction: { blackHole(asciiRanges) }),
BenchmarkInfo(
name: "StringDistance.utf16.ascii",
runFunction: { n in
run_utf16(string: asciiString, ranges: asciiRanges, n: n)
},
tags: [.api, .String],
setUpFunction: { blackHole(asciiRanges) }),
BenchmarkInfo(
name: "StringDistance.utf8.ascii",
runFunction: { n in
run_utf8(string: asciiString, ranges: asciiRanges, n: n)
},
tags: [.api, .String],
setUpFunction: { blackHole(asciiRanges) }),
]


let mixedString = #"""
The powerful programming language that is also easy to learn.
손쉽게 학습할 수 있는 강력한 프로그래밍 언어.
🪙 A 🥞 short 🍰 piece 🫘 of 🌰 text 👨‍👨‍👧‍👧 with 👨‍👩‍👦 some 🚶🏽 emoji 🇺🇸🇨🇦 characters 🧈
some🔩times 🛺 placed 🎣 in 🥌 the 🆘 mid🔀dle 🇦🇶or🏁 around 🏳️‍🌈 a 🍇 w🍑o🥒r🥨d
Unicode is such fun!
U̷n̷i̷c̷o̴d̴e̷ ̶i̸s̷ ̸s̵u̵c̸h̷ ̸f̵u̷n̴!̵
U̴̡̲͋̾n̵̻̳͌ì̶̠̕c̴̭̈͘ǫ̷̯͋̊d̸͖̩̈̈́ḛ̴́ ̴̟͎͐̈i̴̦̓s̴̜̱͘ ̶̲̮̚s̶̙̞͘u̵͕̯̎̽c̵̛͕̜̓h̶̘̍̽ ̸̜̞̿f̵̤̽ṷ̴͇̎͘ń̷͓̒!̷͍̾̚
U̷̢̢̧̨̼̬̰̪͓̞̠͔̗̼̙͕͕̭̻̗̮̮̥̣͉̫͉̬̲̺͍̺͊̂ͅ\#
n̶̨̢̨̯͓̹̝̲̣̖̞̼̺̬̤̝̊̌́̑̋̋͜͝ͅ\#
ḭ̸̦̺̺͉̳͎́͑\#
c̵̛̘̥̮̙̥̟̘̝͙̤̮͉͔̭̺̺̅̀̽̒̽̏̊̆͒͌̂͌̌̓̈́̐̔̿̂͑͠͝͝ͅ\#
ö̶̱̠̱̤̙͚͖̳̜̰̹̖̣̻͎͉̞̫̬̯͕̝͔̝̟̘͔̙̪̭̲́̆̂͑̌͂̉̀̓́̏̎̋͗͛͆̌̽͌̄̎̚͝͝͝͝ͅ\#
d̶̨̨̡̡͙̟͉̱̗̝͙͍̮͍̘̮͔͑\#
e̶̢͕̦̜͔̘̘̝͈̪̖̺̥̺̹͉͎͈̫̯̯̻͑͑̿̽͂̀̽͋́̎̈́̈̿͆̿̒̈́̽̔̇͐͛̀̓͆̏̾̀̌̈́̆̽̕ͅ
"""#

let mixedRanges = (
generateRanges(for: mixedString, by: 1)
+ generateRanges(for: mixedString, by: 2)
+ generateRanges(for: mixedString, by: 4)
+ generateRanges(for: mixedString, by: 8)
+ generateRanges(for: mixedString, by: 16)
+ generateRanges(for: mixedString, by: 32)
+ generateRanges(for: mixedString, by: 64)
+ generateRanges(for: mixedString, by: 128)
+ generateRanges(for: mixedString, by: 256)
+ generateRanges(for: mixedString, by: 512))

let _asciiString = #"""
Swift is a high-performance system programming language. It has a clean
and modern syntax, offers seamless access to existing C and Objective-C code
and frameworks, and is memory safe by default.

Although inspired by Objective-C and many other languages, Swift is not itself
a C-derived language. As a complete and independent language, Swift packages
core features like flow control, data structures, and functions, with
high-level constructs like objects, protocols, closures, and generics. Swift
embraces modules, eliminating the need for headers and the code duplication
they entail.

Swift toolchains are created using the script
[build-toolchain](https://github.com/apple/swift/blob/main/utils/build-toolchain).
This script is used by swift.org's CI to produce snapshots and can allow for
one to locally reproduce such builds for development or distribution purposes.
A typical invocation looks like the following:

```
$ ./swift/utils/build-toolchain $BUNDLE_PREFIX
```

where ``$BUNDLE_PREFIX`` is a string that will be prepended to the build date
to give the bundle identifier of the toolchain's ``Info.plist``. For instance,
if ``$BUNDLE_PREFIX`` was ``com.example``, the toolchain produced will have
the bundle identifier ``com.example.YYYYMMDD``. It will be created in the
directory you run the script with a filename of the form:
``swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz``.
"""#
let asciiString = String(repeating: _asciiString, count: 10)

let asciiRanges = (
generateRanges(for: asciiString, by: 1)
+ generateRanges(for: asciiString, by: 2)
+ generateRanges(for: asciiString, by: 4)
+ generateRanges(for: asciiString, by: 8)
+ generateRanges(for: asciiString, by: 16)
+ generateRanges(for: asciiString, by: 32)
+ generateRanges(for: asciiString, by: 64)
+ generateRanges(for: asciiString, by: 128)
+ generateRanges(for: asciiString, by: 256)
+ generateRanges(for: asciiString, by: 512))

func generateRanges(for string: String, by step: Int) -> [Range<String.Index>] {
var remaining = step
var i = string.startIndex
var last = i

var ranges: [Range<String.Index>] = []
while i < string.endIndex {
string.unicodeScalars.formIndex(after: &i)
remaining -= 1
if remaining == 0 {
ranges.append(last ..< i)
remaining = step
last = i
}
}
ranges.append(last ..< i)
return ranges
}

func run_characters(string: String, ranges: [Range<String.Index>], n: Int) {
var c = 0
for _ in 0 ..< n {
for r in ranges {
c += string.distance(from: r.lowerBound, to: r.upperBound)
}
}
blackHole(c)
}

func run_scalars(string: String, ranges: [Range<String.Index>], n: Int) {
var c = 0
for _ in 0 ..< n {
for r in ranges {
c += string.unicodeScalars.distance(from: r.lowerBound, to: r.upperBound)
}
}
blackHole(c)
}

func run_utf16(string: String, ranges: [Range<String.Index>], n: Int) {
var c = 0
for _ in 0 ..< n {
for r in ranges {
c += string.utf16.distance(from: r.lowerBound, to: r.upperBound)
}
}
blackHole(c)
}

func run_utf8(string: String, ranges: [Range<String.Index>], n: Int) {
var c = 0
for _ in 0 ..< n {
for r in ranges {
c += string.utf8.distance(from: r.lowerBound, to: r.upperBound)
}
}
blackHole(c)
}
4 changes: 3 additions & 1 deletion benchmark/utils/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ import StrComplexWalk
import StrToInt
import StringBuilder
import StringComparison
import StringDistance
import StringEdits
import StringEnum
import StringInterpolation
Expand Down Expand Up @@ -362,9 +363,10 @@ register(StaticArray.benchmarks)
register(StrComplexWalk.benchmarks)
register(StrToInt.benchmarks)
register(StringBuilder.benchmarks)
register(StringComparison.benchmarks)
register(StringDistance.benchmarks)
register(StringEdits.benchmarks)
register(StringEnum.benchmarks)
register(StringComparison.benchmarks)
register(StringInterpolation.benchmarks)
register(StringMatch.benchmarks)
register(StringRemoveDupes.benchmarks)
Expand Down
4 changes: 2 additions & 2 deletions docs/CppInteroperability/CppInteroperabilityManifesto.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Assumptions:
+ [Function templates: calls with generic type parameters](#function-templates-calls-with-generic-type-parameters)
+ [Function templates: importing as real generic functions](#function-templates-importing-as-real-generic-functions)
+ [Class templates](#class-templates)
+ [Class templates: importing instantiation behind typedef](#class-templates-importing-instantiation-behind-typedef)
+ [Class templates: importing full class template instantiations](#class-templates-importing-full-class-template-instantiations)
+ [Class templates: importing specific specializations](#class-templates-importing-specific-specializations)
+ [Class templates: using with generic type parameters](#class-templates-using-with-generic-type-parameters)
+ [Class templates: using in generic code through a synthesized protocol](#class-templates-using-in-generic-code-through-a-synthesized-protocol)
Expand Down Expand Up @@ -184,7 +184,7 @@ that pick different sides, forcing the user to choose.

Swift/C++ interoperability builds on top of the Swift/C interoperability, so it
helps to be familiar with [Swift's strategy for importing C
modules](HowSwiftImportsCAPIs.md).
modules](../HowSwiftImportsCAPIs.md).

# Importing C++ APIs into Swift

Expand Down
Loading