-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Distributed] Implement distributed computed properties via special accessor #59700
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
ktoso
merged 18 commits into
swiftlang:main
from
xedin:distributed-computed-properties-via-accessor-thunk
Jun 30, 2022
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
febfef9
[Distributed] Skeleton implementation of distributed computed properties
ktoso 5bdf94f
[Distributed] Remove commented out code and print statements
xedin 927a58f
fix checkDistributedTargetResultType to also return when not diagnosing
ktoso c0479a5
[Distributed] NFC: remove a couple of unused variables from sythensis…
xedin d68961d
[Distributed] Synthesize thunks for distributed computed properties
xedin a016fae
[TypeChecker] Distributed: Verify properties before attempting to syn…
xedin fce3b85
[AST] Add new member access semantics - DistributedThunk
xedin e8987b4
[Distributed] Add a new access strategy - DispatchToDistributedThunk
xedin 59ec5ab
[Distributed] SILGen: Remove `isDistributed` flags from accessor code
xedin b2b1efd
[Distributed] Decl: Add a new distributed-thunk bit
xedin 84fa232
[Distributed] Synthesize 'distributed thunk' accessor for distributed…
xedin 13dbd37
[MiscDiagnostics] Don't diagnose recursive property access in distrib…
xedin 9d5f546
[Distributed] Teach `HasIsolatedSelfRequest` about distributed thunk …
xedin 3006e92
[Distributed] NFC: XFAIL a couple of incorrect attr use tests
xedin 3f3410d
[Distributed] Mangling: Add a comment about distributed accessor thunks
xedin 8d9962e
[Distributed] Allow requesting distributed thunks on `AbstractStorage…
xedin d9a0130
[TypeChecker] Distributed: rework `checkDistributedAccess`
xedin 2480c99
[Distributed] Generate thunk for accessor as a regular method
xedin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3486,10 +3486,33 @@ ASTMangler::mangleOpaqueTypeDescriptorRecord(const OpaqueTypeDecl *decl) { | |
return finalize(); | ||
} | ||
|
||
std::string ASTMangler::mangleDistributedThunk(const FuncDecl *thunk) { | ||
std::string ASTMangler::mangleDistributedThunk(const AbstractFunctionDecl *thunk) { | ||
// Marker protocols cannot be checked at runtime, so there is no point | ||
// in recording them for distributed thunks. | ||
llvm::SaveAndRestore<bool> savedAllowMarkerProtocols(AllowMarkerProtocols, | ||
false); | ||
|
||
// Since computed property SILDeclRef's refer to the "originator" | ||
// of the thunk, we need to mangle distributed thunks of accessors | ||
// specially. | ||
if (auto *accessor = dyn_cast<AccessorDecl>(thunk)) { | ||
// TODO: This needs to use accessor type instead of | ||
// distributed thunk after all SILDeclRefs are switched | ||
// to use "originator" instead of the thunk itself. | ||
// | ||
// ``` | ||
// beginMangling(); | ||
// appendContextOf(thunk); | ||
// appendDeclName(accessor->getStorage()); | ||
// appendDeclType(accessor, FunctionMangling); | ||
// appendOperator("F"); | ||
// appendSymbolKind(SymbolKind::DistributedThunk); | ||
// return finalize(); | ||
// ``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for the TODO, that's on me after we fixed the SILDeclRefs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, no worries! |
||
auto *storage = accessor->getStorage(); | ||
thunk = storage->getDistributedThunk(); | ||
assert(thunk); | ||
} | ||
|
||
return mangleEntity(thunk, SymbolKind::DistributedThunk); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍