mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Distributed] Generate thunk for accessor as a regular method
It used to be an accessor but that is not required because SILDeclRef controls mangling which is the most imprortant and could be used to emit the right reference.
This commit is contained in:
@@ -725,25 +725,10 @@ static FuncDecl *createDistributedThunkFunction(FuncDecl *func) {
|
||||
}
|
||||
ParameterList *params = ParameterList::create(C, paramDecls); // = funcParams->clone(C);
|
||||
|
||||
FuncDecl *thunk = nullptr;
|
||||
if (auto *accessor = dyn_cast<AccessorDecl>(func)) {
|
||||
auto *distributedVar = cast<VarDecl>(accessor->getStorage());
|
||||
|
||||
thunk = AccessorDecl::create(
|
||||
C, /*declLoc=*/accessor->getLoc(), /*accessorKeywordLoc=*/SourceLoc(),
|
||||
AccessorKind::Get, distributedVar,
|
||||
/*staticLoc=*/SourceLoc(), StaticSpellingKind::None,
|
||||
/*async=*/true, /*asyncLoc=*/SourceLoc(),
|
||||
/*throws=*/true, /*throwsLoc=*/SourceLoc(), genericParamList, params,
|
||||
func->getResultInterfaceType(), accessor->getDeclContext());
|
||||
|
||||
thunk->setImplicit();
|
||||
} else {
|
||||
thunk = FuncDecl::createImplicit(
|
||||
C, swift::StaticSpellingKind::None, func->getName(), SourceLoc(),
|
||||
/*async=*/true, /*throws=*/true, genericParamList, params,
|
||||
func->getResultInterfaceType(), DC);
|
||||
}
|
||||
FuncDecl *thunk = FuncDecl::createImplicit(
|
||||
C, swift::StaticSpellingKind::None, thunkName, SourceLoc(),
|
||||
/*async=*/true, /*throws=*/true, genericParamList, params,
|
||||
func->getResultInterfaceType(), DC);
|
||||
|
||||
assert(thunk && "couldn't create a distributed thunk");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user