Skip to content

Commit 8854438

Browse files
authored
[Distributed] Remove _distributedThunkTarget; it is not necessary (#72245)
1 parent 07d145a commit 8854438

File tree

10 files changed

+2
-51
lines changed

10 files changed

+2
-51
lines changed

include/swift/AST/Attr.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,28 +2609,6 @@ class RawLayoutAttr final : public DeclAttribute {
26092609
}
26102610
};
26112611

2612-
/// The @_distributedThunkTarget(for:) attribute.
2613-
class DistributedThunkTargetAttr final
2614-
: public DeclAttribute {
2615-
2616-
AbstractFunctionDecl *TargetFunction;
2617-
2618-
public:
2619-
DistributedThunkTargetAttr(AbstractFunctionDecl *target)
2620-
: DeclAttribute(DeclAttrKind::DistributedThunkTarget, SourceLoc(),
2621-
SourceRange(),
2622-
/*Implicit=*/false),
2623-
TargetFunction(target) {}
2624-
2625-
AbstractFunctionDecl *getTargetFunction() const {
2626-
return TargetFunction;
2627-
}
2628-
2629-
static bool classof(const DeclAttribute *DA) {
2630-
return DA->getKind() == DeclAttrKind::DistributedThunkTarget;
2631-
}
2632-
};
2633-
26342612
/// Predicate used to filter MatchingAttributeRange.
26352613
template <typename ATTR, bool AllowInvalid> struct ToAttributeKind {
26362614
ToAttributeKind() {}

include/swift/AST/DeclAttr.def

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,7 @@ SIMPLE_DECL_ATTR(_noExistentials, NoExistentials,
485485
SIMPLE_DECL_ATTR(_noObjCBridging, NoObjCBridging,
486486
OnAbstractFunction | OnSubscript | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
487487
155)
488-
DECL_ATTR(_distributedThunkTarget, DistributedThunkTarget,
489-
OnAbstractFunction | UserInaccessible | ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove,
490-
156)
488+
// Unused '156': Used to be `_distributedThunkTarget` but completed implementation in Swift 6.0 does not need it after all
491489
DECL_ATTR(_allowFeatureSuppression, AllowFeatureSuppression,
492490
OnAnyDecl | UserInaccessible | NotSerialized | ABIStableToAdd | APIStableToAdd | ABIStableToRemove | APIStableToRemove,
493491
157)

lib/AST/Attr.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,8 +1918,6 @@ StringRef DeclAttribute::getAttrName() const {
19181918
return "_section";
19191919
case DeclAttrKind::Documentation:
19201920
return "_documentation";
1921-
case DeclAttrKind::DistributedThunkTarget:
1922-
return "_distributedThunkTarget";
19231921
case DeclAttrKind::Nonisolated:
19241922
if (cast<NonisolatedAttr>(this)->isUnsafe()) {
19251923
return "nonisolated(unsafe)";

lib/ASTGen/Sources/ASTGen/DeclAttrs.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ extension ASTGenVisitor {
256256
.usableFromInline,
257257
.used,
258258
.warnUnqualifiedAccess,
259-
.weakLinked,
260-
.distributedThunkTarget:
259+
.weakLinked:
261260

262261
return self.generateSimpleDeclAttr(attribute: node, kind: attrKind)
263262

lib/Parse/ParseDecl.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3704,11 +3704,6 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
37043704
break;
37053705
}
37063706

3707-
case DeclAttrKind::DistributedThunkTarget: {
3708-
assert(false && "Not implemented");
3709-
break;
3710-
}
3711-
37123707
case DeclAttrKind::TypeEraser: {
37133708
// Parse leading '('
37143709
if (Tok.isNot(tok::l_paren)) {

lib/Sema/CodeSynthesisDistributedActor.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,10 +751,6 @@ static FuncDecl *createDistributedThunkFunction(FuncDecl *func) {
751751
if (func->hasBody())
752752
thunk->setBodySynthesizer(deriveBodyDistributed_thunk, func);
753753

754-
/// Record which function this is a thunk for, we'll need this to link back
755-
/// calls in case this is a distributed requirement witness.
756-
thunk->getAttrs().add(new (C) DistributedThunkTargetAttr(func));
757-
758754
return thunk;
759755
}
760756

lib/Sema/TypeCheckAttr.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
163163
IGNORED_ATTR(BackDeployed)
164164
IGNORED_ATTR(Documentation)
165165
IGNORED_ATTR(LexicalLifetimes)
166-
IGNORED_ATTR(DistributedThunkTarget)
167166
IGNORED_ATTR(AllowFeatureSuppression)
168167
IGNORED_ATTR(PreInverseGenerics)
169168
#undef IGNORED_ATTR

lib/Sema/TypeCheckDeclOverride.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,6 @@ namespace {
16361636
UNINTERESTING_ATTR(NonEscapable)
16371637
UNINTERESTING_ATTR(UnsafeNonEscapableResult)
16381638
UNINTERESTING_ATTR(StaticExclusiveOnly)
1639-
UNINTERESTING_ATTR(DistributedThunkTarget)
16401639
UNINTERESTING_ATTR(PreInverseGenerics)
16411640
#undef UNINTERESTING_ATTR
16421641

lib/Serialization/ModuleFormat.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,14 +2387,6 @@ namespace decls_block {
23872387
BCArray<IdentifierIDField>
23882388
>;
23892389

2390-
using DistributedThunkTargetDeclAttrLayout = BCRecordLayout<
2391-
DistributedThunkTarget_DECL_ATTR,
2392-
BCFixed<1>, // implicit flag
2393-
DeclIDField // target function
2394-
// FIXME: not entirely right?
2395-
>;
2396-
2397-
23982390
using TypeEraserDeclAttrLayout = BCRecordLayout<
23992391
TypeEraser_DECL_ATTR,
24002392
BCFixed<1>, // implicit flag

lib/Serialization/Serialization.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3065,9 +3065,6 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
30653065
S.addDeclRef(afd), pieces.size(), pieces);
30663066
return;
30673067
}
3068-
case DeclAttrKind::DistributedThunkTarget: {
3069-
assert(false && "not implemented");
3070-
}
30713068

30723069
case DeclAttrKind::TypeEraser: {
30733070
auto abbrCode = S.DeclTypeAbbrCodes[TypeEraserDeclAttrLayout::Code];

0 commit comments

Comments
 (0)