Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
1f32e2d
[Foundation] DataProtocol: Reimplement firstRange(of:in:)/lastRange(o…
YOCKOW Sep 2, 2019
421af22
[Foundation] Add tests for [SR-10689](https://bugs.swift.org/browse/S…
YOCKOW Dec 8, 2019
2853114
AssociatedTypeInference: Self is a valid fixed type witness
AnthonyLatsis Jul 9, 2020
1724deb
[ConstraintSystem] Add a type variable merging heuristic to addJoinCo…
hborla Aug 4, 2020
5026514
[sil] Define ValueOwnershipKind::isCompatibleWith(SILValue v).
gottesmm Aug 4, 2020
bfbc3a7
[Test] Run __swift5_entry test on all Apple platforms.
nate-chandler Aug 4, 2020
8c0ee61
[utils] Add Uxtheme.h to VFS overlay
smeenai Aug 5, 2020
8d21750
Frontend: support dumping the JIT state
compnerd Aug 4, 2020
849c636
[AutoDiff] Fix differentiation for non-wrt `inout` parameters. (#33304)
dan-zheng Aug 5, 2020
42571e5
Merge remote-tracking branch 'github/master' into HEAD
dan-zheng Aug 5, 2020
d3f132b
Merge pull request #33302 from nate-chandler/emit-main-into-entry-seg…
nate-chandler Aug 5, 2020
ee44292
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 5, 2020
493d102
[Localization] Ignore diagnostic IDs that are available in YAML and n…
HassanElDesouky Aug 5, 2020
d2cb1ca
[Diagnostics] NFC: Adjust `en.yaml` to mirror diagnostics in `.def` f…
xedin Aug 5, 2020
c64ca9a
Merge pull request #33301 from compnerd/jit-state-of-mind
CodaFi Aug 5, 2020
55c2e01
[Localization] Add comments
HassanElDesouky Aug 5, 2020
9b2fd2d
Merge pull request #33307 from smeenai/master
compnerd Aug 5, 2020
8362643
Merge pull request #33317 from xedin/adjust-yaml-diags
xedin Aug 5, 2020
ef6c374
[Sema/Index] Resolve #keyPath components so they can be indexed
Aug 1, 2020
b647245
Merge pull request #33316 from HassanElDesouky/localization-ignoreIDs
xedin Aug 5, 2020
a84cf7f
[Locale] Serialize YAML to an OnDiskHashTable format and create a too…
HassanElDesouky Jul 27, 2020
8ee4e93
[Localization] Simplify implementation of iterator over YAML
xedin Jul 29, 2020
8a1b620
[Localization] Serialization writer should own the inserted data
xedin Jul 29, 2020
8d8da1b
[Localization] Adjust types associated with reader/writer info
xedin Jul 30, 2020
0d7a519
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 5, 2020
6b28c2f
[SIL] Add flag to SILFunction to indicate async.
nate-chandler Aug 4, 2020
d0c1a45
DependenciesScanner: teach the scanner to diagnose dependency cycles
nkcsgexi Aug 5, 2020
0103b79
[Localization] Adjust cmake to include serialized diagnostics in tool…
xedin Jul 31, 2020
67dbef5
[Localization] NFC: Include all of the headers based on the types used
xedin Aug 5, 2020
3a4d156
[Localization] Switch serialization format to use DiagID as a key
xedin Aug 5, 2020
5e13a53
[Localization] Make return type of the serialization main cross platform
xedin Aug 6, 2020
3ad98a5
[Docs] Fix broken url and filename (#33318)
gabeiglio Aug 6, 2020
1fbdd7c
Merge pull request #33274 from nate-chandler/silfunction-async
nate-chandler Aug 6, 2020
1e95349
Merge pull request #33322 from nkcsgexi/diagnose-cycle-scanner
nkcsgexi Aug 6, 2020
ceeb724
Don't build SwiftUnitTests for cross compile host
shahmishal Aug 6, 2020
bb356d3
Don't run LLDB cross compile host test suite
shahmishal Aug 6, 2020
9adbace
Remove compiler-rt from install targets for cross compile host
shahmishal Aug 6, 2020
2b62570
Merge pull request #33022 from HassanElDesouky/localization-serializa…
xedin Aug 6, 2020
0efb86a
[ConstraintSystem] Add an overload of addJoinConstraint that takes in
hborla Aug 4, 2020
43aafcd
[CSGen] Use addJoinConstraint for joining array literal element types.
hborla Aug 4, 2020
cd44ca8
[ConstraintSystem] Move getAtomicLiteralKind to TypeVariableType::Imp…
hborla Aug 5, 2020
c41dd21
[test] Ensure clang importer sdk uses its own CoreFoundation overlay
edymtt Aug 5, 2020
65327ae
test: repair the prespecialized-metadata tests on ASi
compnerd Aug 6, 2020
48b0802
test: swap parameters in test assertion (NFC)
compnerd Aug 6, 2020
7966ab4
test: disable a couple of IRGen tests on ASi
compnerd Aug 6, 2020
f186eff
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 6, 2020
61c33a6
Merge remote-tracking branch 'github/tensorflow' into HEAD
ainu-bot Aug 6, 2020
145b8ae
LLVMMergeFunctions: allow more parameters if the function is bigger
eeckstein Aug 6, 2020
755f6aa
AST, SIL: Remove UTF16 encoding from StringLiteralExpr and StringLite…
eeckstein Aug 4, 2020
b265541
[NFC] Document the new type variable merging heuristic in addJoinCons…
hborla Aug 6, 2020
38e2bd9
[Diagnostics] Demote availability errors to warning for decls in ObjC…
Aug 5, 2020
8da019c
[Syntax] Fix grammar and parsing for 'async'.
DougGregor Aug 6, 2020
d82c6cb
[Syntax] Fix syntax tree creation for __await expressions.
DougGregor Aug 6, 2020
6ff46ae
[Concurrency] Add serialization test for `async`
DougGregor Aug 6, 2020
3aa4f74
Add missing include to fix build issues on master-next and master-reb…
Aug 6, 2020
0e03628
Merge pull request #33327 from compnerd/metaconfiguration
compnerd Aug 6, 2020
9b790d0
Merge pull request #33323 from apple/shahmishal/support-cross-compile…
shahmishal Aug 6, 2020
ebb714d
IRGen: ObjC method lists are not const.
jckarter Aug 6, 2020
989a432
[NFC] Update array literal type checking performance validation tests.
hborla Aug 6, 2020
f78a87a
Merge pull request #33329 from compnerd/labelling
compnerd Aug 6, 2020
e26aeca
[Runtime] Fix the isa mask assert for ARM64e.
mikeash Aug 6, 2020
6a5522f
[Syntax] Fix type syntax tests for 'async'.
DougGregor Aug 6, 2020
094aa8f
Fix build error due to missing include of llvm/Support/FileSystem.h
plotfi Aug 6, 2020
aa229c2
[Localization] Fully qualify `swift-serialize-diagnostics` tool
xedin Aug 6, 2020
672f238
Merge pull request #33335 from nathawes/add-missing-include
Aug 6, 2020
69abfc1
Merge pull request #33320 from nathawes/index-key-paths
Aug 6, 2020
d064241
[ssa-updater] Modernize style before adding support for guaranteed pa…
gottesmm Aug 4, 2020
d3f0de8
[SE-0163] Migrate from deprecated Unicode APIs (part 3) (#33175)
benrimmington Aug 6, 2020
ad83b21
Add another test case to test/Constraints/sr12365.swift
slavapestov Aug 6, 2020
34650e8
Merge pull request #32799 from AnthonyLatsis/sself-is-fixed
slavapestov Aug 6, 2020
adbbc00
[CSFix] Add a warning fix for situations when trailing closure is mat…
xedin Aug 6, 2020
19fce32
[Diagnostics] For array element conversion failures, emit an error me…
hborla Aug 7, 2020
d71a406
Merge pull request #33344 from plotfi/master
swift-ci Aug 7, 2020
9c9c1af
Merge pull request #33348 from slavapestov/testcase-rdar66492626
slavapestov Aug 7, 2020
b981d83
Merge pull request #33326 from edymtt/seal-clang-importer-sdk
CodaFi Aug 7, 2020
b98085d
[Doc] Update CI trigger for CentOS and Ubuntu
shahmishal Aug 7, 2020
f9e54e1
Merge pull request #33353 from apple/shahmishal/doc/trigger-update
shahmishal Aug 7, 2020
a3cd8bc
[Tests] Codesign the binary before executing the test
shahmishal Aug 7, 2020
f292eb6
[Diagnostics] Introduce a warning diagnostic for backward trailing cl…
xedin Aug 7, 2020
003ca97
Merge pull request #33333 from DougGregor/concurrency-syntax-fixes
DougGregor Aug 7, 2020
20e25e4
Merge pull request #33346 from xedin/quality-diag-serialization-tool
xedin Aug 7, 2020
50ac9ab
[Sema] Adding contextual type purpose for where clause expression in …
LucianoPAlmeida Aug 7, 2020
faf7994
Merge pull request #33331 from eeckstein/merge-functions
eeckstein Aug 7, 2020
ea30413
Merge pull request #33288 from eeckstein/string-optimization
eeckstein Aug 7, 2020
2ee68b9
Merge pull request #33341 from mikeash/fix-isa-mask-assert2
mikeash Aug 7, 2020
a422bfb
Merge pull request #33330 from compnerd/ASi-resilience
compnerd Aug 7, 2020
bea0238
test: format configuration to be more pythonic
compnerd Aug 4, 2020
9e81823
Merge pull request #33296 from hborla/merge-joined-literal-typevars
hborla Aug 7, 2020
84ea2a9
SR-13362: no baseline is available for the standard library on ASi
compnerd Aug 7, 2020
d30366f
Dispatch: correct `DispatchTimeInterval` calculation on ASi
compnerd Aug 6, 2020
6e62444
test: use the `swift_only_stable_abi` feature instead of adhoc checks
compnerd Aug 7, 2020
e57961c
[Runtime] Fix the ISA mask assert for ARM64 running on ARM64e hardware.
mikeash Aug 7, 2020
88a8498
Merge pull request #33357 from compnerd/pythonista
compnerd Aug 7, 2020
44d686f
[ConstraintSystem] Use new "specify label" fix/diagnostic to warn abo…
xedin Aug 7, 2020
00b22bf
[CSApply] NFC: Remove logic replaced by `TrailingClosureRequiresExpli…
xedin Aug 7, 2020
13f2d3b
Merge pull request #33359 from compnerd/baseline
lorentey Aug 7, 2020
d8b6baf
Temporarily disable failing test
slavapestov Aug 7, 2020
e5d05a9
Merge pull request #33365 from slavapestov/disable-test-rdar66693249
slavapestov Aug 7, 2020
bc449e3
Revert "Temporarily disable failing test"
slavapestov Aug 7, 2020
29ff1fc
Merge pull request #33367 from apple/revert-33365-disable-test-rdar66…
slavapestov Aug 7, 2020
d6f19d2
Temporarily disable failing test
slavapestov Aug 7, 2020
0f8c96e
Merge pull request #33368 from slavapestov/disable-test-rdar66644853
slavapestov Aug 7, 2020
06c975c
Remove code sign from stdlib/Error.swift
shahmishal Aug 7, 2020
9a71bfe
Merge pull request #33360 from compnerd/stable-abi-check
compnerd Aug 7, 2020
9ce3459
Merge pull request #33332 from jckarter/objc-method-lists-not-const
jckarter Aug 7, 2020
6d47061
[AutoDiff] NFC: fix typo. (#33361)
dan-zheng Aug 7, 2020
ceeceaa
Merge pull request #33342 from compnerd/dispatch-interval-units
compnerd Aug 7, 2020
3ae31d5
Sema: Don't need to derive CaseIterable's AllCases associated type
slavapestov Aug 7, 2020
2bff31e
Merge pull request #33362 from mikeash/fix-isa-mask-assert3
swift-ci Aug 7, 2020
635550c
[SymbolGraph] Check Loc validity before extracting text
bitjammer Aug 7, 2020
a16aef2
test: repair Interpreter/bridged_casts_folding on ASi
compnerd Aug 7, 2020
88e1306
test: repair Interpreter/SDK/interpreter_with_options on ASi
compnerd Aug 7, 2020
a405c5d
test: repair stdlib/Dispatch on ASi
compnerd Aug 6, 2020
155e20c
[Test] Add Interpreter and IRGen tests for SR-13203 (#33340)
theblixguy Aug 7, 2020
08771ab
Merge pull request #33364 from xedin/trailing-closure-warning
xedin Aug 7, 2020
9bbe6e7
Merge pull request #28639 from YOCKOW/sr-10689-cherry-pick
Aug 7, 2020
ab4cdc1
[Docs] [AutoDiff] Improve wording in various places in the manifesto.
rxwei Aug 7, 2020
473f55c
Remove codesign from test/Interpreter/SDK/objc_swift3_deprecated_objc…
shahmishal Aug 7, 2020
d172129
Improve @guaranteed args handling in ARCSequenceOpts
meg-gupta Aug 3, 2020
ccca08b
[AutoDiff] Add reverse-mode `switch_enum` support for `Optional`. (#3…
efremale Aug 8, 2020
85dccde
Merge pull request #33375 from rxwei/reword-manifesto
swift-ci Aug 8, 2020
8fc778e
Merge pull request #33355 from LucianoPAlmeida/SR-13262-where-needs-bool
LucianoPAlmeida Aug 8, 2020
bc2a8f4
Merge pull request #33354 from apple/shahmishal/codesign-tests
shahmishal Aug 8, 2020
80d8360
Merge pull request #33293 from gottesmm/pr-dbea2005792482f2c31921009e…
gottesmm Aug 8, 2020
63da97d
Merge pull request #33371 from slavapestov/do-not-derive-in-all-cases
slavapestov Aug 8, 2020
fba46ee
Fix edgecase in AllocBoxToStack handling of local apply
meg-gupta Aug 7, 2020
4d4af13
Add a flag to turn off analysis of function calls in AllocBoxToStack
meg-gupta Aug 7, 2020
eb625f7
[Sema] Allow inference of binding to type var of differing lvalue-ness…
Jumhyn Aug 7, 2020
5782dd4
Merge pull request #33343 from compnerd/dispatch-ASi
compnerd Aug 8, 2020
1d0bf50
Merge pull request #33373 from compnerd/rosetta
compnerd Aug 8, 2020
1d410fb
Merge pull request #33372 from compnerd/trapping-illness
compnerd Aug 8, 2020
17eb463
Merge pull request #33347 from gottesmm/pr-0e907fa209a6d12c8e02117c55…
gottesmm Aug 8, 2020
8122957
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 8, 2020
03d94b4
Add default IR attributes to helper functions and convert
rjmccall Aug 8, 2020
d01fed2
[Sema] Implement tailored diagnostics for MissingMemberFailure with s…
LucianoPAlmeida Aug 8, 2020
0d5bfcb
[tests] Adding regression tests for SR-13359
LucianoPAlmeida Aug 9, 2020
1105843
Merge pull request #33379 from rjmccall/default-attribute-helpers
rjmccall Aug 9, 2020
8431158
[AutoDiff] Temporarily disable failing test on tensorflow branch.
dan-zheng Aug 9, 2020
c6bc6f0
Merge pull request #33363 from Jumhyn/SR-13357
xedin Aug 9, 2020
061e69b
[Diagnostics] Adjusting SR-13359 diagnostic wording and add tests for…
LucianoPAlmeida Aug 9, 2020
4becc86
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 9, 2020
72e6bbc
test: repair Serialization.autolinking after #33379
compnerd Aug 9, 2020
a3b8014
[Localization] Make the serialization tool print the removed diagnostics
HassanElDesouky Aug 6, 2020
b37491a
AssociatedTypeInference: Stop skipping the current protocol when look…
AnthonyLatsis Jul 17, 2020
a0bf69b
Merge pull request #33381 from compnerd/33379
compnerd Aug 10, 2020
82fe84a
[Diagnostics] Restricting member subscript tailored diagnostics to li…
LucianoPAlmeida Aug 10, 2020
e8f1784
[Diagnostics] Adding member subscript tailored diagnostics fixit to s…
LucianoPAlmeida Aug 10, 2020
008cc3c
Document conventions for constructing names in mangling docs (#33203)
hlopko Aug 10, 2020
2b99d2b
Merge pull request #32945 from AnthonyLatsis/silly-bug
AnthonyLatsis Aug 10, 2020
038eae4
Adding SR-13359 diagnostics to localization yaml files and minor comment
LucianoPAlmeida Aug 10, 2020
792da10
Revert "Sema: Make type resolution for EnumElementPattern less eager"
AnthonyLatsis Aug 10, 2020
a3340e8
[NFC] Add a test where a contextual type is necessary to resolve an E…
AnthonyLatsis Aug 10, 2020
ccd82a0
[Gardening] Fixed 404 in SIL and SIL Optimizations -> HighLevelSILOpt…
gabeiglio Aug 10, 2020
bfeafb6
Merge pull request #33376 from meg-gupta/fixallocboxtostack
meg-gupta Aug 10, 2020
0d25abc
Merge pull request #33267 from meg-gupta/arcseqchanges
meg-gupta Aug 10, 2020
c092423
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 10, 2020
9642cb6
Merge pull request #33337 from HassanElDesouky/localization-report-de…
xedin Aug 10, 2020
0f11dc7
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 10, 2020
63875e9
[cxx-interop] [IRGen] TypeInfo for address-only types. (#32973)
zoecarver Aug 10, 2020
4edf476
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 10, 2020
457b999
Add checks that the endpoints of partial ranges are not-NaN. (#33378)
stephentyrone Aug 10, 2020
23f7fa7
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 10, 2020
d8bef6e
Merge pull request #33385 from apple/revert-33227-unbound-thinout-1
CodaFi Aug 10, 2020
f6ccc4c
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 10, 2020
05c3333
Merge pull request #33370 from bitjammer/acgarland/rdar-65258208-cras…
bitjammer Aug 10, 2020
6b9cfff
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 10, 2020
fe27ad3
Serialization: add an option to allow deserializing @_implementationO…
nkcsgexi Aug 10, 2020
9da6d92
[Gardening] Reflow codable_non_decoded_property_here
CodaFi Aug 10, 2020
c077455
Use a SmallMapVector instead of a SmallDenseMap
CodaFi Aug 10, 2020
52591ef
[Sema] Rename error-handling code to effects-handling code.
DougGregor Aug 10, 2020
a2dc034
[Effects handling] Stop storing an ApplyClassifier as an instance.
DougGregor Aug 10, 2020
8083b2d
[Effects handling] Rename PotentialReason -> PotentialThrowsReason.
DougGregor Aug 10, 2020
05f418a
Remove CodableConformanceType
CodaFi Aug 10, 2020
3b9b540
Clean up modeling of CodingKeysValidity
CodaFi Aug 10, 2020
aada983
Replace supersuperclassConformsTo
CodaFi Aug 10, 2020
fbbb2bb
[Effects handling] Eliminate Context::Kind::NonExhaustiveCatch.
DougGregor Aug 10, 2020
f24b763
[Effects handling] Simplify away getKindForFunctionBody().
DougGregor Aug 10, 2020
8f03720
Merge pull request #33387 from nkcsgexi/65570721-master
nkcsgexi Aug 10, 2020
d30dba7
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 10, 2020
f40de80
[Effects handling] Eliminate Context::Kind::NonThrowingAutoClosure.
DougGregor Aug 10, 2020
7cee2bf
Windows: include `direct.h` in `sys.stat` module
compnerd Aug 10, 2020
d62e9dd
[Diagnostics] Minor adjustments on MissingMember tuple base and yaml …
LucianoPAlmeida Aug 10, 2020
92efa8b
Merge pull request #33392 from CodaFi/when-everyone-is-super-no-one-w…
swift-ci Aug 11, 2020
f2be63e
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 11, 2020
ac66839
[Disable] SILOptimizer test (66807959)
shahmishal Aug 11, 2020
142aa5f
Merge pull request #33396 from apple/shahmishal/disable-test-siloptim…
shahmishal Aug 11, 2020
5794e58
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 11, 2020
7de9573
Don't verify exact NaN text for .debugDescription (#33391)
tbkka Aug 11, 2020
9459e37
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 11, 2020
c0055e7
Merge pull request #33380 from LucianoPAlmeida/SR-13359-subscript-tuple
LucianoPAlmeida Aug 11, 2020
a77fd77
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 11, 2020
524887b
[Effects handling] Eliminate Context::Kind::RethrowingFunction.
DougGregor Aug 11, 2020
ea8217a
[Effects handling] Collapse "Handled" and "NonThrowingFunction" kinds.
DougGregor Aug 11, 2020
90e42bb
[Effects handling] Eliminate Context::getHandled().
DougGregor Aug 11, 2020
462e37b
[Effects handling] Move "illegal context" strings into diagnostic text.
DougGregor Aug 11, 2020
6d8a50d
Merge pull request #33398 from DougGregor/refactor-to-effects-handling
DougGregor Aug 11, 2020
bc5fb08
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 11, 2020
b9cf249
Merge pull request #33394 from compnerd/direct-call
compnerd Aug 11, 2020
9db1c82
Merge remote-tracking branch 'github/master' into HEAD
ainu-bot Aug 11, 2020
4391f42
[AutoDiff] Fix `Optional` differentiation crash. (#33386)
dan-zheng Aug 11, 2020
2332998
Merge remote-tracking branch 'github/master' into HEAD
dan-zheng Aug 11, 2020
9f560ad
Updating the tags for the merge.
Aug 11, 2020
b7228b7
Update tensorflow branch
Aug 12, 2020
f06709f
Update tensorflow from 2.3 to 2.3.0
Aug 12, 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
60 changes: 60 additions & 0 deletions docs/ABI/Mangling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1047,3 +1047,63 @@ Some kinds need arguments, which precede ``Tf``.
If the first character of the string literal is a digit ``[0-9]`` or an
underscore ``_``, the identifier for the string literal is prefixed with an
additional underscore ``_``.

Conventions for foreign symbols
-------------------------------

Swift interoperates with multiple other languages - C, C++, Objective-C, and
Objective-C++. Each of these languages defines their own mangling conventions,
so Swift must take care to follow them. However, these conventions do not cover
Swift-specific symbols like Swift type metadata for foreign types, so Swift uses
its own mangling scheme for those symbols.

Importing C and C++ structs
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Types imported from C and C++ are imported as if they are located in the ``__C``
module, regardless of the actual Clang module that they are coming from. This
can be observed when mangling a Swift function that accepts a C/C++ struct as a
parameter:

C++ module ``CxxStructModule``:

.. code-block:: c++

struct CxxStruct {};

inline void cxxFunction(CxxStruct s) {}

Swift module ``main`` that imports ``CxxStructModule``:

.. code-block:: swift

import CxxStructModule

public func swiftFunction(_ s: CxxStruct) {}

Resulting symbols (showing only Itanium-mangled C++ symbols for brevity):

.. code::

_Z11cxxFunction9CxxStruct // -> cxxFunction(CxxStruct)
s4main13swiftFunctionyySo9CxxStructVF // -> main.swiftFunction(__C.CxxStruct) -> ()

The reason for ignoring the Clang module and always putting C and C++ types into
``__C`` at the Swift ABI level is that the Clang module is not a part of the C
or C++ ABI. When owners of C and C++ Clang modules decide what changes are
ABI-compatible or not, they will likely take into account C and C++ ABI, but not
the Swift ABI. Therefore, Swift ABI can only encode information about a C or C++
type that the C and C++ ABI already encodes in order to remain compatible with
future versions of libraries that evolve according to C and C++ ABI
compatibility principles.

The C/C++ compiler does not generate Swift metadata symbols and value witness
tables for C and C++ types. To make a foreign type usable in Swift in the same
way as a native type, the Swift compiler must generate these symbols.
Specifically, each Swift module that uses a given C or C++ type generates the
necessary Swift symbols. For the example above the Swift compiler will generate following
nominal type descriptor symbol for ``CxxStruct`` while compiling the ``main`` module:

.. code::

sSo9CxxStructVMn // -> nominal type descriptor for __C.CxxStruct
8 changes: 5 additions & 3 deletions docs/ContinuousIntegration.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ macOS platform | @swift-ci Please smoke benchmark | S
Linux platform | @swift-ci Please test Linux platform | Swift Test Linux Platform (smoke test)<br>Swift Test Linux Platform
Linux platform | @swift-ci Please clean test Linux platform | Swift Test Linux Platform (smoke test)<br>Swift Test Linux Platform
macOS platform | @swift-ci Please ASAN test | Swift ASAN Test OS X Platform
Ubuntu 20.04 | @swift-ci Please test Ubuntu 20.04 platform | Swift Test Ubuntu 20.04 Platform
CentOS 8 | @swift-ci Please test CentOS 8 platform | Swift Test CentOS 8 Platform
Amazon Linux 2 | @swift-ci Please test Amazon Linux 2 platform | Swift Test Amazon Linux 2 Platform
Ubuntu 18.04 | @swift-ci Please test Ubuntu 18.04 platform | Swift Test Ubuntu 18.04 Platform
Ubuntu 20.04 | @swift-ci Please test Ubuntu 20.04 platform | Swift Test Ubuntu 20.04 Platform
CentOS 7 | @swift-ci Please test CentOS 7 platform | Swift Test CentOS 7 Platform
CentOS 8 | @swift-ci Please test CentOS 8 platform | Swift Test CentOS 8 Platform
Amazon Linux 2 | @swift-ci Please test Amazon Linux 2 platform | Swift Test Amazon Linux 2 Platform

The core principles of validation testing is that:

Expand Down
18 changes: 13 additions & 5 deletions docs/DifferentiableProgramming.md
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,15 @@ extension Perceptron {

### `@differentiable` function types

A subtype of normal function types with a different runtime representation,
which stores metadata that allows their values to be differentiated anywhere.
Differentiable functions are first-class values, identified by a
`@differentiable` attribute in the function type. A `@differentiable` function
type is a subtype of its corresponding normal function type (i.e. without a
`@differentiable` attribute) with an extended ABI, which stores metadata that
allows their values to be differentiated anywhere the function is passed. A
`@differentiable(linear)` function type is a subtype of its corresponding
`@differentiable` function type. A normal function can be implicitly converted
to a `@differentiable` or `@differentiable(linear)` function with appropriate
compile-time checks.

```swift
func addOne(_ x: Float) -> Float { x + 1 }
Expand All @@ -920,8 +927,9 @@ func _(_ x: Float) -> (value: Float,

### Differential operators

Standard library differentiation APIs that take `@differentiable` functions and
return derivative functions or compute derivative values.
Differential operators are APIs defined in the standard library that take
`@differentiable` functions and return derivative functions or compute
derivative values.

```swift
// In the standard library:
Expand Down Expand Up @@ -2318,7 +2326,7 @@ As shown in the
subsection, a `@differentiable` function value's runtime representation contains
the original function along with extra information that allows the function to
be differentiated (or transposed, if it is `@differentiable(linear)`). A
@differentiable or `@differentiable(linear)` function value can be called like a
`@differentiable` or `@differentiable(linear)` function value can be called like a
non-`@differentiable` function. A `@differentiable(linear)` function value can
be implicitly converted to a `@differentiable` one, which can be implicitly
converted to a non-`@differentiable` one.
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ documentation, please create a thread on the Swift forums under the
- [RequestEvaluator.md](/docs/RequestEvaluator.md):
Describes the request evaluator architecture, which is used for
lazy type-checking and efficient caching.
- [Literal.md](/docs/Literal.md):
- [Literals.md](/docs/Literals.md):
Describes type-checking and inference specifically for literals.
- [Serialization.rst](/docs/Serialization.rst):
Gives an overview of the LLVM bitcode format used for swiftmodules.
Expand All @@ -117,7 +117,7 @@ documentation, please create a thread on the Swift forums under the
Provides an overview of the implementation of SIL in the compiler.
- [OptimizerDesign.md](/docs/OptimizerDesign.md):
Describes the design of the optimizer pipeline.
- [HighLevelSILOptimizations.rst](docs/HighLevelSILOptimizations.rst):
- [HighLevelSILOptimizations.rst](/docs/HighLevelSILOptimizations.rst):
Describes how the optimizer understands the semantics of high-level
operations on currency data types and optimizes accordingly.
Includes a thorough discussion of the `@_semantics` attribute.
Expand Down
24 changes: 22 additions & 2 deletions include/swift/AST/DiagnosticEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "swift/AST/TypeLoc.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/VersionTuple.h"

namespace swift {
Expand Down Expand Up @@ -742,8 +744,26 @@ namespace swift {
void setLocalization(std::string locale, std::string path) {
assert(!locale.empty());
assert(!path.empty());
localization =
std::make_unique<diag::YAMLLocalizationProducer>(locale, path);
llvm::SmallString<128> filePath(path);
llvm::sys::path::append(filePath, locale);
llvm::sys::path::replace_extension(filePath, ".db");

// If the serialized diagnostics file not available,
// fallback to the `YAML` file.
if (llvm::sys::fs::exists(filePath)) {
if (auto file = llvm::MemoryBuffer::getFile(filePath)) {
localization = std::make_unique<diag::SerializedLocalizationProducer>(
std::move(file.get()));
}
} else {
llvm::sys::path::replace_extension(filePath, ".yaml");
// In case of missing localization files, we should fallback to messages
// from `.def` files.
if (llvm::sys::fs::exists(filePath)) {
localization =
std::make_unique<diag::YAMLLocalizationProducer>(filePath.str());
}
}
}

void ignoreDiagnostic(DiagID id) {
Expand Down
7 changes: 7 additions & 0 deletions include/swift/AST/DiagnosticsCommon.def
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,12 @@ WARNING(cross_imported_by_both_modules, none,
"please report this bug to the maintainers of these modules",
(Identifier, Identifier, Identifier))

//------------------------------------------------------------------------------
// MARK: dependencies scanner diagnostics
//------------------------------------------------------------------------------

ERROR(scanner_find_cycle, none,
"dependency scanner detected dependency cycle: '%0'", (StringRef))

#define UNDEFINE_DIAGNOSTIC_MACROS
#include "DefineDiagnosticMacros.h"
30 changes: 26 additions & 4 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ ERROR(could_not_find_subscript_member_did_you_mean,none,
"did you mean to use the subscript operator?",
(Type))

ERROR(could_not_find_subscript_member_tuple, none,
"cannot access element using subscript for tuple type %0; "
"use '.' notation instead", (Type))
ERROR(could_not_find_subscript_member_tuple_did_you_mean_use_dot, none,
"cannot access element using subscript for tuple type %0; "
"did you mean to use '.%1'?", (Type, StringRef))

ERROR(could_not_find_enum_case,none,
"enum type %0 has no case %1; did you mean %2?",
(Type, DeclNameRef, DeclName))
Expand Down Expand Up @@ -2835,7 +2842,8 @@ NOTE(codable_extraneous_codingkey_case_here,none,
NOTE(codable_non_conforming_property_here,none,
"cannot automatically synthesize %0 because %1 does not conform to %0", (Type, TypeLoc))
NOTE(codable_non_decoded_property_here,none,
"cannot automatically synthesize %0 because %1 does not have a matching CodingKey and does not have a default value", (Type, Identifier))
"cannot automatically synthesize %0 because %1 does not have a matching "
"CodingKey and does not have a default value", (Type, Identifier))
NOTE(codable_codingkeys_type_is_not_an_enum_here,none,
"cannot automatically synthesize %0 because 'CodingKeys' is not an enum", (Type))
NOTE(codable_codingkeys_type_does_not_conform_here,none,
Expand Down Expand Up @@ -4064,10 +4072,13 @@ ERROR(throw_in_nonexhaustive_catch,none,
"error is not handled because the enclosing catch is not exhaustive", ())

ERROR(throwing_call_in_illegal_context,none,
"call can throw, but errors cannot be thrown out of %0",
(StringRef))
"call can throw, but errors cannot be thrown out of "
"%select{<<ERROR>>|a default argument|a property initializer|a global variable initializer|an enum case raw value|a catch pattern|a catch guard expression|a defer body}0",
(unsigned))
ERROR(throw_in_illegal_context,none,
"errors cannot be thrown out of %0", (StringRef))
"errors cannot be thrown out of "
"%select{<<ERROR>>|a default argument|a property initializer|a global variable initializer|an enum case raw value|a catch pattern|a catch guard expression|a defer body}0",
(unsigned))

ERROR(throwing_operator_without_try,none,
"operator can throw but expression is not marked with 'try'", ())
Expand Down Expand Up @@ -4716,13 +4727,24 @@ ERROR(availability_decl_unavailable, none,
"%select{ in %3|}2%select{|: %4}4",
(unsigned, DeclName, bool, StringRef, StringRef))

WARNING(availability_decl_unavailable_warn, none,
"%select{getter for |setter for |}0%1 is unavailable"
"%select{ in %3|}2%select{|: %4}4",
(unsigned, DeclName, bool, StringRef, StringRef))

#define REPLACEMENT_DECL_KIND_SELECT "select{| instance method| property}"
ERROR(availability_decl_unavailable_rename, none,
"%select{getter for |setter for |}0%1 has been "
"%select{renamed to|replaced by}2%" REPLACEMENT_DECL_KIND_SELECT "3 "
"'%4'%select{|: %5}5",
(unsigned, DeclName, bool, unsigned, StringRef, StringRef))

WARNING(availability_decl_unavailable_rename_warn, none,
"%select{getter for |setter for |}0%1 has been "
"%select{renamed to|replaced by}2%" REPLACEMENT_DECL_KIND_SELECT "3 "
"'%4'%select{|: %5}5",
(unsigned, DeclName, bool, unsigned, StringRef, StringRef))

NOTE(availability_marked_unavailable, none,
"%select{getter for |setter for |}0%1 has been explicitly marked "
"unavailable here", (unsigned, DeclName))
Expand Down
21 changes: 18 additions & 3 deletions include/swift/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -861,9 +861,6 @@ class StringLiteralExpr : public LiteralExpr {
/// A UTF-8 string.
UTF8,

/// A UTF-16 string.
UTF16,

/// A single UnicodeScalar, passed as an integer.
OneUnicodeScalar
};
Expand Down Expand Up @@ -5259,6 +5256,7 @@ class KeyPathExpr : public Expr {
OptionalWrap,
Identity,
TupleElement,
DictionaryKey,
};

private:
Expand Down Expand Up @@ -5367,6 +5365,16 @@ class KeyPathExpr : public Expr {
propertyType,
loc);
}

/// Create a component for a dictionary key (#keyPath only).
static Component forDictionaryKey(DeclNameRef UnresolvedName,
Type valueType,
SourceLoc loc) {
return Component(nullptr, UnresolvedName, nullptr, {}, {},
Kind::DictionaryKey,
valueType,
loc);
}

/// Create a component for a subscript.
static Component forSubscript(ASTContext &ctx,
Expand Down Expand Up @@ -5457,6 +5465,7 @@ class KeyPathExpr : public Expr {
case Kind::Property:
case Kind::Identity:
case Kind::TupleElement:
case Kind::DictionaryKey:
return true;

case Kind::UnresolvedSubscript:
Expand All @@ -5481,6 +5490,7 @@ class KeyPathExpr : public Expr {
case Kind::Property:
case Kind::Identity:
case Kind::TupleElement:
case Kind::DictionaryKey:
return nullptr;
}
llvm_unreachable("unhandled kind");
Expand All @@ -5500,6 +5510,7 @@ class KeyPathExpr : public Expr {
case Kind::Property:
case Kind::Identity:
case Kind::TupleElement:
case Kind::DictionaryKey:
llvm_unreachable("no subscript labels for this kind");
}
llvm_unreachable("unhandled kind");
Expand All @@ -5522,6 +5533,7 @@ class KeyPathExpr : public Expr {
case Kind::Property:
case Kind::Identity:
case Kind::TupleElement:
case Kind::DictionaryKey:
return {};
}
llvm_unreachable("unhandled kind");
Expand All @@ -5533,6 +5545,7 @@ class KeyPathExpr : public Expr {
DeclNameRef getUnresolvedDeclName() const {
switch (getKind()) {
case Kind::UnresolvedProperty:
case Kind::DictionaryKey:
return Decl.UnresolvedName;

case Kind::Invalid:
Expand Down Expand Up @@ -5563,6 +5576,7 @@ class KeyPathExpr : public Expr {
case Kind::OptionalForce:
case Kind::Identity:
case Kind::TupleElement:
case Kind::DictionaryKey:
llvm_unreachable("no decl ref for this kind");
}
llvm_unreachable("unhandled kind");
Expand All @@ -5582,6 +5596,7 @@ class KeyPathExpr : public Expr {
case Kind::Identity:
case Kind::Property:
case Kind::Subscript:
case Kind::DictionaryKey:
llvm_unreachable("no field number for this kind");
}
llvm_unreachable("unhandled kind");
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/GenericSignatureBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ class GenericSignatureBuilder {
/// \param resolutionKind How to perform the resolution.
///
/// \param wantExactPotentialArchetype Whether to return the precise
/// potential archetype described by the type (vs. just the equivalance
/// potential archetype described by the type (vs. just the equivalence
/// class and resolved type).
ResolvedType maybeResolveEquivalenceClass(
Type type,
Expand Down
8 changes: 8 additions & 0 deletions include/swift/AST/IRGenOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ struct PointerAuthOptions : clang::PointerAuthOptions {
PointerAuthSchema ResilientClassStubInitCallbacks;
};

enum class JITDebugArtifact : unsigned {
None, ///< None
LLVMIR, ///< LLVM IR
Object, ///< Object File
};

/// The set of options supported by IR generation.
class IRGenOptions {
public:
Expand Down Expand Up @@ -326,6 +332,8 @@ class IRGenOptions {
Optional<llvm::VersionTuple> AutolinkRuntimeCompatibilityLibraryVersion;
Optional<llvm::VersionTuple> AutolinkRuntimeCompatibilityDynamicReplacementLibraryVersion;

JITDebugArtifact DumpJIT = JITDebugArtifact::None;

IRGenOptions()
: DWARFVersion(2), OutputKind(IRGenOutputKind::LLVMAssembly),
Verify(true), OptMode(OptimizationMode::NotSet),
Expand Down
Loading