Skip to content

Merge main 2021-02-18 #2763

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 122 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
33049fa
[utils] split-cmdline: Handle typical compiler invocations better
lorentey Feb 10, 2021
c195b2e
[utils] split-cmdline: Handle -working-directory
lorentey Feb 10, 2021
cfa2983
[NFC] Organize ModuleInterfaceSupport.cpp better
beccadax Feb 11, 2021
c2f3725
Warn about module name shadowing in interfaces
beccadax Feb 11, 2021
e2a8abc
[Async CC] Make error indirect.
nate-chandler Jan 5, 2021
b3284c6
[CSBindings] Track source constraint of an adjacent variable
xedin Jan 21, 2021
084db0d
Revert "Merge pull request #34848 from aschwaighofer/make_prespeciali…
aschwaighofer Feb 12, 2021
84eac93
[IRGen] Use the result polymorphic coro.suspend.async intrinsic
aschwaighofer Feb 4, 2021
cf2177f
Fix test case
aschwaighofer Feb 12, 2021
034c2be
GSB: An unresolved DependentMemberType might resolve to a concrete Ty…
slavapestov Feb 12, 2021
fc33728
[cxx-interop] Skip already-imported sub decls.
zoecarver Feb 13, 2021
ba3b261
Shorten diagnostic and refer to bug report instead
beccadax Feb 13, 2021
70d09b5
OSSA: Disable cond_br arguments
atrick Feb 13, 2021
d1e2c0c
Add CHANGELOG entry for #34140
AnthonyLatsis Feb 13, 2021
e33ce42
[capture-promotion] Eliminate non-OSSA support/tests.
gottesmm Feb 5, 2021
b7f5aac
[ownership] Delete dead code that explicitly handles interior pointer…
gottesmm Feb 15, 2021
2c9f9bd
[ownership] When lowering store_borrow, RAUW its result with its inpu…
gottesmm Feb 15, 2021
9fe23a3
[ownership] Add an interior_pointer error test for store_borrow.
gottesmm Feb 15, 2021
27cd40b
[ownership] When looking at an interior pointer's uses, look through …
gottesmm Feb 15, 2021
479b5b9
[ownership] Add an interior_pointer error test for open_existential_box.
gottesmm Feb 15, 2021
75088cd
[AutoDiff] Mangle derivative vtable thunks.
rxwei Feb 15, 2021
a17f8c2
SILOptimizer: add a diagnostics pass to warn about lifetime issues wi…
eeckstein Feb 11, 2021
d892396
Merge pull request #35975 from rxwei/74340331-mangle-ad-vtable-entry-…
rxwei Feb 15, 2021
59c5841
Merge pull request #35946 from aschwaighofer/use_polymorphic_supend_a…
aschwaighofer Feb 15, 2021
75fd1fe
Merge pull request #35967 from atrick/verify-condbr
atrick Feb 15, 2021
841e4ee
Merge pull request #35918 from eeckstein/diagnose-lifetime-issues
eeckstein Feb 15, 2021
6eb00d5
Merge pull request #35964 from zoecarver/cxx/another-double-add-fix
zoecarver Feb 15, 2021
c45fb3c
Merge pull request #35950 from slavapestov/another-gsb-unresolved-dmt…
slavapestov Feb 15, 2021
6a5dfb8
Mark Task.runDetached as @discardableResult.
DougGregor Feb 15, 2021
b9092e4
Temporarily disable three SILOptimizer tests on 32-bit
slavapestov Feb 15, 2021
77d828d
Merge pull request #35978 from slavapestov/disable-tests-rdar74359824
slavapestov Feb 15, 2021
dd1c37a
CSE OSSA: Enable lookThroughOwnershipInsts for some more instructions
meg-gupta Feb 15, 2021
fd10636
[Concurrency][Task Locals] Fix missing flag setting on next pointer
ktoso Feb 15, 2021
c193757
Merge pull request #35977 from DougGregor/discardable-run-detached
swift-ci Feb 15, 2021
02c4165
swift-api-extract to generate JSON API information
cachemeifyoucan Dec 2, 2020
c732ba3
[Clang importer] Make @actorIndependent on imported macros implicit.
DougGregor Feb 15, 2021
a8f91c4
[Clang importer] Allow @UIActor as an alias for @MainActor.
DougGregor Feb 15, 2021
9d5f631
Update test
DougGregor Feb 16, 2021
12164c9
Merge pull request #35974 from gottesmm/interior_pointer_improvements
gottesmm Feb 16, 2021
8b563d2
Merge pull request #35790 from gottesmm/pr-1fe4c56db40fbe22618e6ca72f…
gottesmm Feb 16, 2021
d2bada8
Merge pull request #35969 from AnthonyLatsis/changelog-coself
AnthonyLatsis Feb 16, 2021
20d4a3e
Sema: Inherited designated initializers should inherit the 'rethrows'…
slavapestov Feb 15, 2021
1c494f2
AST: Mark some attributes as ABI/API breaking to add/remove
slavapestov Feb 15, 2021
18084ee
Sema: Small stylistic cleanup for TypeCheckAttr.cpp
slavapestov Feb 15, 2021
67a22aa
Sema: Remove unnecessary AtRethrows diagnostic
slavapestov Feb 15, 2021
37b69fc
Serialization: Tweak record numbers to make room for 'reasync'
slavapestov Feb 15, 2021
6c69d17
Parse: Implement parsing for 'reasync' attribute
slavapestov Feb 15, 2021
cdbba60
AST: ASTPrinter support for 'reasync'
slavapestov Feb 15, 2021
222a988
Merge pull request #35979 from meg-gupta/csefixes
meg-gupta Feb 16, 2021
3d4091c
Merge pull request #35982 from DougGregor/clang-importer-concurrency-…
DougGregor Feb 16, 2021
467ff0a
[nfc][gardening] Add requires cplusplus to LinkedRecords module.
zoecarver Feb 16, 2021
e70fb00
[nfc] Replace count() with find().
zoecarver Feb 16, 2021
035db92
Merge pull request #35987 from slavapestov/designated-init-rethrows
slavapestov Feb 16, 2021
1d6726a
Merge pull request #35986 from slavapestov/reasync-part-1
slavapestov Feb 16, 2021
8cc5e96
Merge pull request #35990 from zoecarver/cxx/gardening/count-to-find
swift-ci Feb 16, 2021
3c02dba
[AutoDiff] Change derivative vtable thunk linkage to private.
rxwei Feb 16, 2021
d9036c2
Merge pull request #35980 from ktoso/wip-locals-missing-flag
ktoso Feb 16, 2021
bba7029
[CusorInfo] Fix ASAN heap-use-after-free failure when reporting paren…
Feb 16, 2021
41d5e57
Merge pull request #35991 from rxwei/73791807-tbdgen-derivative-vtabl…
swift-ci Feb 16, 2021
44708dc
Skip libdispatch build for freestanding presets (#35976)
edymtt Feb 16, 2021
5e851ac
Merge pull request #35945 from aschwaighofer/revert_make_prespecializ…
aschwaighofer Feb 16, 2021
de63a23
Merge pull request #35603 from nate-chandler/concurrency/irgen/rdar71…
nate-chandler Feb 16, 2021
726a8d5
Merge pull request #35690 from cachemeifyoucan/swift-api-extract-json
cachemeifyoucan Feb 16, 2021
37d52fb
Merge pull request #35888 from lorentey/split-cmdline-improvements
lorentey Feb 16, 2021
2f0e7fc
[cxx-interop] Bail on deep template specializations.
zoecarver Feb 13, 2021
625e660
Emit async dispatch in the prologue with auto-generated debug locations.
adrian-prantl Feb 16, 2021
7a500a1
stdlib: Float16 needs an @available annotation for macOS
slavapestov Feb 16, 2021
f45855d
IRGen: always ensure that a function has a IRGenModule for emission
eeckstein Feb 16, 2021
184ee71
IRGen: correctly cast C-function pointers in statically initialized g…
eeckstein Feb 16, 2021
65a9052
Merge pull request #35989 from zoecarver/cxx/gardening/add-requires-c…
zoecarver Feb 16, 2021
f2f3e3d
Check actor isolation in TapExprs
etcwilde Feb 16, 2021
4f016c9
[stdlib] Make MutableCollection.partition(by:) implementation inlinable
lorentey Feb 16, 2021
1f0225b
Merge pull request #35995 from adrian-prantl/concurrent-prologue-locs
swift-ci Feb 16, 2021
e6aee25
Merge pull request #35904 from beccadax/go-back-to-the-shadow
beccadax Feb 16, 2021
e60ccba
[gardening] Call llvm_unreachable after exhaustive switches.
nate-chandler Feb 16, 2021
eea3a6c
SILGen: Handle pseudogeneric completion-handler-based async APIs.
jckarter Feb 16, 2021
655aeef
[CSBindings] NFC: Associate `isCoveredBy(PotentialBinding)` with lite…
xedin Feb 17, 2021
e05cf76
Merge pull request #35997 from slavapestov/fix-float16-availability-o…
slavapestov Feb 17, 2021
4ef7a2d
[CSBindings] NFC: Refactor some of the repetitive uses of type variab…
xedin Jan 22, 2021
27626ec
Merge pull request #35994 from eeckstein/fix-function-globals
swift-ci Feb 17, 2021
f2d06d1
[android][tests] Add config.target_swift_api_extract for Android.
drodriguez Feb 17, 2021
29db401
IRGen: We can only reuse methods for partial apply thunks if their ab…
aschwaighofer Feb 17, 2021
6b61574
Merge pull request #36005 from nate-chandler/gardening/unreachable-af…
nate-chandler Feb 17, 2021
2f584b5
Merge pull request #36010 from drodriguez/android-swift-api-extract
swift-ci Feb 17, 2021
c4b0983
[Sema][CodeCompletion] Allow empty case statement bodies in the resul…
Feb 17, 2021
8448e61
Add support for attributes on closures.
DougGregor Feb 17, 2021
7c336ea
Add support for @concurrent attribute on closures.
DougGregor Feb 17, 2021
d652ba0
Merge pull request #36008 from xedin/a-couple-of-binding-refactorings
xedin Feb 17, 2021
4768de0
Merge pull request #35985 from nathawes/fix-cursor-info-parent-contex…
Feb 17, 2021
11dec42
Merge pull request #36011 from aschwaighofer/irgen_fix_partial_apply_…
aschwaighofer Feb 17, 2021
e6a375a
Merge pull request #36001 from etcwilde/ewilde/tippy-tapping-that-iso…
etcwilde Feb 17, 2021
619e5ea
[android][test] Add REQUIRES: executable_test to simple_partial_apply…
drodriguez Feb 17, 2021
e024d96
Merge pull request #36009 from xedin/constraint-graph-note-typevar-re…
xedin Feb 17, 2021
43eb31e
[Concurrency] Guard use of async calling convention.
varungandhi-apple Feb 17, 2021
7eeabd9
[Runtime] Fix calling convention of async function.
varungandhi-apple Feb 17, 2021
64323a0
Revert "[SR-12033] [Sema] Do not allow inferring defaultable closure …
xedin Feb 17, 2021
bc6a7a6
Merge pull request #35963 from zoecarver/cxx/bail-on-large-templates
zoecarver Feb 17, 2021
90d825f
tests: fix command line in SILOptimizer/global-functionptr.swift
eeckstein Feb 17, 2021
28855a5
Merge pull request #36019 from drodriguez/android-executable-partial-…
swift-ci Feb 17, 2021
536cabb
Merge pull request #35998 from varungandhi-apple/vg-main
swift-ci Feb 17, 2021
b508527
Merge pull request #36006 from jckarter/foreign-async-pseudogeneric
jckarter Feb 17, 2021
891bd00
[sil-deserialization] Implement cache invalidation for all serialized…
gottesmm Feb 17, 2021
9c6c9a5
Merge pull request #36021 from varungandhi-apple/vg-fix-completeTask-…
varungandhi-apple Feb 17, 2021
d3f624f
Merge pull request #36013 from nathawes/fix-missing-completions-in-in…
Feb 17, 2021
ab1d0c7
Merge pull request #36024 from eeckstein/fix-global-funcptr-test
swift-ci Feb 17, 2021
9d3c8ca
Sema: Remove some unreachable code from CSApply
slavapestov Feb 17, 2021
e494df2
[AutoDiff] Add differentiability kind to differentiability witnesses …
rxwei Feb 17, 2021
09dedaa
Sema: Start abstracting out the 'effect' in rethrows-checking logic
slavapestov Feb 17, 2021
e7c4470
Sema: Don't need to setThrows() in the synthesized @main function
slavapestov Feb 16, 2021
04da08a
Fix RUN: line in di_property_wrappers_errors test
slavapestov Feb 16, 2021
57654da
[ownership] On non-Darwin platforms start serializing the stdlib in O…
gottesmm Feb 17, 2021
1efcd3f
Merge pull request #36022 from apple/revert-35503-SR-12033-autoclosure
xedin Feb 18, 2021
47b068d
[Serialization] Emit an error on deserializing an invalid declaration
bnbarham Feb 17, 2021
082f091
Merge pull request #36029 from slavapestov/reasync-part-2
slavapestov Feb 18, 2021
9acf214
Merge pull request #36002 from lorentey/inline-partitioning-impl
lorentey Feb 18, 2021
15da94f
Merge pull request #36015 from rxwei/74380324-mangle-diff-witness-keys
swift-ci Feb 18, 2021
02784b3
Merge pull request #36025 from gottesmm/pr-36fe6ec4772e3d5e09f5031a50…
gottesmm Feb 18, 2021
7fe1c9c
Merge pull request #36028 from slavapestov/csapply-unreachable-type-c…
slavapestov Feb 18, 2021
077d96c
Merge pull request #36012 from DougGregor/explicit-concurrent-closure
DougGregor Feb 18, 2021
8a0e706
Merge pull request #36026 from bnbarham/allow-errors-sil-crash
bnbarham Feb 18, 2021
b6dc7bf
Merge remote-tracking branch 'apple/main' into katei/merge-main-2021-…
kateinoigakukun Feb 18, 2021
ff78f61
[WASM] Add target_swift_api_extract config in lit.cfg for wasi
kateinoigakukun Feb 18, 2021
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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ CHANGELOG
Swift Next
----------

* Whenever a reference to `Self` does not impede the usage of a protocol as a value type, or a protocol member on a value of protocol type, the same is now true for references to `[Self]` and `[Key : Self]`:

```swift
protocol Copyable {
func copy() -> Self
func copy(count: Int) -> [Self]
}

func test(c: Copyable) {
let copy: Copyable = c.copy() // OK
let copies: [Copyable] = c.copy(count: 5) // also OK
}
```

* [SE-0296][]:

Asynchronous programming is now natively supported using async/await. Asynchronous functions can be defined using `async`:
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ if(SWIFT_PROFDATA_FILE AND EXISTS ${SWIFT_PROFDATA_FILE})
add_definitions("-fprofile-instr-use=${SWIFT_PROFDATA_FILE}")
endif()

option(USE_SWIFT_ASYNC_LOWERING
"Indicates if Swiftc should use async-specific lowering for async
functions if it is supported for the target. The runtime also checks
this setting before using async-specific attributes. This only applies
to the async calling convention and not to the async context attribute."
FALSE)

#
# User-configurable Swift Standard Library specific options.
#
Expand Down
6 changes: 6 additions & 0 deletions docs/ABI/Mangling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ Globals
global ::= protocol-conformance protocol 'Wb' // base protocol witness table accessor
global ::= type protocol-conformance 'Wl' // lazy protocol witness table accessor

global ::= global generic-signature? 'WJ' DIFFERENTIABILITY-KIND INDEX-SUBSET 'p' INDEX-SUBSET 'r' // differentiability witness

global ::= type 'WV' // value witness table
global ::= entity 'Wvd' // field offset
global ::= entity 'WC' // resilient enum tag index
Expand Down Expand Up @@ -222,13 +224,17 @@ types where the metadata itself has unknown layout.)
global ::= from-type to-type generic-signature? 'TR' // reabstraction thunk
global ::= impl-function-type type 'Tz' // objc-to-swift-async completion handler block implementation
global ::= impl-function-type type 'TZ' // objc-to-swift-async completion handler block implementation (predefined by runtime)
global ::= from-type to-type generic-signature? 'TR' // reabstraction thunk
global ::= impl-function-type type generic-signature? 'Tz' // objc-to-swift-async completion handler block implementation
global ::= impl-function-type type generic-signature? 'TZ' // objc-to-swift-async completion handler block implementation (predefined by runtime)
global ::= from-type to-type self-type generic-signature? 'Ty' // reabstraction thunk with dynamic 'Self' capture
global ::= from-type to-type generic-signature? 'Tr' // obsolete mangling for reabstraction thunk
global ::= entity generic-signature? type type* 'TK' // key path getter
global ::= entity generic-signature? type type* 'Tk' // key path setter
global ::= type generic-signature 'TH' // key path equality
global ::= type generic-signature 'Th' // key path hasher
global ::= global generic-signature? 'TJ' AUTODIFF-FUNCTION-KIND INDEX-SUBSET 'p' INDEX-SUBSET 'r' // autodiff function
global ::= global generic-signature? 'TJV' AUTODIFF-FUNCTION-KIND INDEX-SUBSET 'p' INDEX-SUBSET 'r' // autodiff derivative vtable thunk
global ::= from-type to-type 'TJO' AUTODIFF-FUNCTION-KIND // autodiff self-reordering reabstraction thunk
global ::= from-type 'TJS' AUTODIFF-FUNCTION-KIND INDEX-SUBSET 'p' INDEX-SUBSET 'r' INDEX-SUBSET 'P' // autodiff linear map subset parameters thunk
global ::= global to-type 'TJS' AUTODIFF-FUNCTION-KIND INDEX-SUBSET 'p' INDEX-SUBSET 'r' INDEX-SUBSET 'P' // autodiff derivative function subset parameters thunk
Expand Down
9 changes: 7 additions & 2 deletions docs/SIL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1590,12 +1590,15 @@ Differentiability Witnesses
sil-differentiability-witness ::=
'sil_differentiability_witness'
sil-linkage?
'[' differentiability-kind ']'
'[' 'parameters' sil-differentiability-witness-function-index-list ']'
'[' 'results' sil-differentiability-witness-function-index-list ']'
generic-parameter-clause?
sil-function-name ':' sil-type
sil-differentiability-witness-body?

differentiability-kind ::= 'forward' | 'reverse' | 'normal' | 'linear'

sil-differentiability-witness-body ::=
'{' sil-differentiability-witness-entry?
sil-differentiability-witness-entry? '}'
Expand Down Expand Up @@ -1625,7 +1628,7 @@ based on the key.

::

sil_differentiability_witness hidden [parameters 0] [results 0] <T where T : Differentiable> @id : $@convention(thin) (T) -> T {
sil_differentiability_witness hidden [normal] [parameters 0] [results 0] <T where T : Differentiable> @id : $@convention(thin) (T) -> T {
jvp: @id_jvp : $@convention(thin) (T) -> (T, @owned @callee_guaranteed (T.TangentVector) -> T.TangentVector)
vjp: @id_vjp : $@convention(thin) (T) -> (T, @owned @callee_guaranteed (T.TangentVector) -> T.TangentVector)
}
Expand Down Expand Up @@ -7066,6 +7069,7 @@ differentiability_witness_function
sil-instruction ::=
'differentiability_witness_function'
'[' sil-differentiability-witness-function-kind ']'
'[' differentiability-kind ']'
'[' 'parameters' sil-differentiability-witness-function-index-list ']'
'[' 'results' sil-differentiability-witness-function-index-list ']'
generic-parameter-clause?
Expand All @@ -7074,7 +7078,7 @@ differentiability_witness_function
sil-differentiability-witness-function-kind ::= 'jvp' | 'vjp' | 'transpose'
sil-differentiability-witness-function-index-list ::= [0-9]+ (' ' [0-9]+)*

differentiability_witness_function [jvp] [parameters 0] [results 0] \
differentiability_witness_function [vjp] [reverse] [parameters 0] [results 0] \
<T where T: Differentiable> @foo : $(T) -> T

Looks up a differentiability witness function (JVP, VJP, or transpose) for
Expand All @@ -7086,6 +7090,7 @@ look up: ``[jvp]``, ``[vjp]``, or ``[transpose]``.
The remaining components identify the SIL differentiability witness:

- Original function name.
- Differentiability kind.
- Parameter indices.
- Result indices.
- Witness generic parameter clause (optional). When parsing SIL, the parsed
Expand Down
23 changes: 10 additions & 13 deletions include/swift/ABI/Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,15 @@ class AsyncTask : public HeapObject, public Job {
// therefore skip also skip pointing to that parent and point
// to whichever parent it was pointing to as well, it may be its
// immediate parent, or some super-parent.
item->next = reinterpret_cast<uintptr_t>(parentHead->getNext());
item->next = reinterpret_cast<uintptr_t>(parentHead->getNext()) |
static_cast<uintptr_t>(NextLinkType::IsParent);
break;
case NextLinkType::IsNext:
assert(false && "empty taskValue head in parent task, yet parent's 'head' is `IsNext`, "
"this should not happen, as it implies the parent must have stored some value.");
break;
case NextLinkType::IsTerminal:
item->next = reinterpret_cast<uintptr_t>(parentHead->getNext());
item->next = reinterpret_cast<uintptr_t>(parentHead->getNext()) |
static_cast<uintptr_t>(NextLinkType::IsTerminal);
break;
}
Expand Down Expand Up @@ -845,8 +845,10 @@ class AsyncTask : public HeapObject, public Job {
/// The type of the result that will be produced by the future.
const Metadata *resultType;

// Trailing storage for the result itself. The storage will be uninitialized,
// contain an instance of \c resultType, or contain an an \c Error.
SwiftError *error = nullptr;

// Trailing storage for the result itself. The storage will be
// uninitialized, contain an instance of \c resultType.

friend class AsyncTask;

Expand All @@ -865,25 +867,20 @@ class AsyncTask : public HeapObject, public Job {
}

/// Retrieve the error.
SwiftError *&getError() {
return *reinterpret_cast<SwiftError **>(
reinterpret_cast<char *>(this) + storageOffset(resultType));
}
SwiftError *&getError() { return *&error; }

/// Compute the offset of the storage from the base of the future
/// fragment.
static size_t storageOffset(const Metadata *resultType) {
size_t offset = sizeof(FutureFragment);
size_t alignment =
std::max(resultType->vw_alignment(), alignof(SwiftError *));
size_t alignment = resultType->vw_alignment();
return (offset + alignment - 1) & ~(alignment - 1);
}

/// Determine the size of the future fragment given a particular future
/// result type.
static size_t fragmentSize(const Metadata *resultType) {
return storageOffset(resultType) +
std::max(resultType->vw_size(), sizeof(SwiftError *));
return storageOffset(resultType) + resultType->vw_size();
}
};

Expand Down Expand Up @@ -1038,7 +1035,7 @@ class YieldingAsyncContext : public AsyncContext {
/// futures.
class FutureAsyncContext : public AsyncContext {
public:
SwiftError *errorResult = nullptr;
SwiftError **errorResult = nullptr;
OpaqueValue *indirectResult;

using AsyncContext::AsyncContext;
Expand Down
23 changes: 12 additions & 11 deletions include/swift/AST/ASTMangler.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,20 @@ class ASTMangler : public Mangler {
/// predefined in the Swift runtime for the given type signature.
std::string mangleObjCAsyncCompletionHandlerImpl(CanSILFunctionType BlockType,
CanType ResultType,
CanGenericSignature Sig,
bool predefined);

/// Mangle the derivative function (JVP/VJP) for the given:
/// Mangle the derivative function (JVP/VJP), or optionally its vtable entry
/// thunk, for the given:
/// - Mangled original function declaration.
/// - Derivative function kind.
/// - Derivative function configuration: parameter/result indices and
/// derivative generic signature.
std::string
mangleAutoDiffDerivativeFunction(const AbstractFunctionDecl *originalAFD,
AutoDiffDerivativeFunctionKind kind,
AutoDiffConfig config);
AutoDiffConfig config,
bool isVTableThunk = false);

/// Mangle the linear map (differential/pullback) for the given:
/// - Mangled original function declaration.
Expand All @@ -201,6 +204,11 @@ class ASTMangler : public Mangler {
CanType fromType, CanType toType, GenericSignature signature,
AutoDiffLinearMapKind linearMapKind);

/// Mangle a SIL differentiability witness.
std::string mangleSILDifferentiabilityWitness(StringRef originalName,
DifferentiabilityKind kind,
AutoDiffConfig config);

/// Mangle the AutoDiff generated declaration for the given:
/// - Generated declaration kind: linear map struct or branching trace enum.
/// - Mangled original function name.
Expand All @@ -214,14 +222,6 @@ class ASTMangler : public Mangler {
AutoDiffLinearMapKind linearMapKind,
AutoDiffConfig config);

/// Mangle a SIL differentiability witness key:
/// - Mangled original function name.
/// - Parameter indices.
/// - Result indices.
/// - Derivative generic signature (optional).
std::string
mangleSILDifferentiabilityWitnessKey(SILDifferentiabilityWitnessKey key);

std::string mangleKeyPathGetterThunkHelper(const AbstractStorageDecl *property,
GenericSignature signature,
CanType baseType,
Expand Down Expand Up @@ -447,7 +447,8 @@ class ASTMangler : public Mangler {

void beginManglingWithAutoDiffOriginalFunction(
const AbstractFunctionDecl *afd);
void appendAutoDiffFunctionParts(char functionKindCode,
void appendAutoDiffFunctionParts(StringRef op,
Demangle::AutoDiffFunctionKind kind,
AutoDiffConfig config);
void appendIndexSubset(IndexSubset *indexSubset);
};
Expand Down
4 changes: 2 additions & 2 deletions include/swift/AST/ASTTypeIDZone.def
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ SWIFT_TYPEID(PropertyWrapperTypeInfo)
SWIFT_TYPEID(Requirement)
SWIFT_TYPEID(ResilienceExpansion)
SWIFT_TYPEID(FragileFunctionKind)
SWIFT_TYPEID(FunctionRethrowingKind)
SWIFT_TYPEID(ProtocolRethrowsRequirementList)
SWIFT_TYPEID(PolymorphicEffectKind)
SWIFT_TYPEID(PolymorphicEffectRequirementList)
SWIFT_TYPEID(TangentPropertyInfo)
SWIFT_TYPEID(SymbolSourceMap)
SWIFT_TYPEID(Type)
Expand Down
4 changes: 2 additions & 2 deletions include/swift/AST/ASTTypeIDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class ProtocolDecl;
class Requirement;
enum class ResilienceExpansion : unsigned;
struct FragileFunctionKind;
enum class FunctionRethrowingKind : uint8_t;
class ProtocolRethrowsRequirementList;
enum class PolymorphicEffectKind : uint8_t;
class PolymorphicEffectRequirementList;
class SourceFile;
class SymbolSourceMap;
struct TangentPropertyInfo;
Expand Down
27 changes: 19 additions & 8 deletions include/swift/AST/Attr.def
Original file line number Diff line number Diff line change
Expand Up @@ -353,25 +353,25 @@ SIMPLE_DECL_ATTR(testable, Testable,
DECL_ATTR(_alignment, Alignment,
OnStruct | OnEnum |
UserInaccessible |
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove,
56)
SIMPLE_DECL_ATTR(rethrows, Rethrows,
OnFunc | OnAccessor | OnConstructor |
OnFunc | OnConstructor |
RejectByParser |
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
57)
SIMPLE_DECL_ATTR(rethrows, AtRethrows,
OnProtocol |
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
58)
DECL_ATTR(_swift_native_objc_runtime_base, SwiftNativeObjCRuntimeBase,
OnClass |
UserInaccessible |
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove,
59)
CONTEXTUAL_SIMPLE_DECL_ATTR(indirect, Indirect, DeclModifier |
OnEnum | OnEnumElement |
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove,
60)
SIMPLE_DECL_ATTR(warn_unqualified_access, WarnUnqualifiedAccess,
OnFunc | OnAccessor /*| OnVar*/ |
Expand Down Expand Up @@ -469,7 +469,7 @@ DECL_ATTR(_dynamicReplacement, DynamicReplacement,
SIMPLE_DECL_ATTR(_borrowed, Borrowed,
OnVar | OnSubscript | UserInaccessible |
NotSerialized |
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove,
81)
DECL_ATTR(_private, PrivateImport,
OnImport |
Expand All @@ -479,7 +479,7 @@ DECL_ATTR(_private, PrivateImport,
82)
SIMPLE_DECL_ATTR(_alwaysEmitIntoClient, AlwaysEmitIntoClient,
OnVar | OnSubscript | OnAbstractFunction | UserInaccessible |
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
ABIBreakingToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
83)

SIMPLE_DECL_ATTR(_implementationOnly, ImplementationOnly,
Expand Down Expand Up @@ -613,6 +613,17 @@ SIMPLE_DECL_ATTR(_marker, Marker,
APIBreakingToAdd | APIBreakingToRemove,
108)

SIMPLE_DECL_ATTR(reasync, Reasync,
OnFunc | OnConstructor |
RejectByParser |
ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
109)

SIMPLE_DECL_ATTR(reasync, AtReasync,
OnProtocol |
ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
110)

#undef TYPE_ATTR
#undef DECL_ATTR_ALIAS
#undef CONTEXTUAL_DECL_ATTR_ALIAS
Expand Down
Loading