Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion docs/ABI/Mangling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ Entities
entity-spec ::= 'fP' // property wrapper backing initializer
entity-spec ::= 'fW' // property wrapper init from projected value
entity-spec ::= 'fD' // deallocating destructor; untyped
entity-spec ::= 'fZ' // isolated deallocating destructor; untyped
entity-spec ::= 'fd' // non-deallocating destructor; untyped
entity-spec ::= 'fE' // ivar destroyer; untyped
entity-spec ::= 'fe' // ivar initializer; untyped
Expand Down
1 change: 0 additions & 1 deletion include/swift/ABI/Executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ using ThrowingTaskFutureWaitContinuationFunction =
SWIFT_CC(swiftasync)
void (SWIFT_ASYNC_CONTEXT AsyncContext *, SWIFT_CONTEXT void *);

using DeinitWorkFunction = SWIFT_CC(swift) void(void *);

template <class AsyncSignature>
class AsyncFunctionPointer;
Expand Down
3 changes: 1 addition & 2 deletions include/swift/ABI/MetadataValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -2490,8 +2490,7 @@ enum class JobKind : size_t {
DefaultActorInline = First_Reserved,
DefaultActorSeparate,
DefaultActorOverride,
NullaryContinuation,
IsolatedDeinit,
NullaryContinuation
};

/// The priority of a job. Higher priorities are larger values.
Expand Down
12 changes: 3 additions & 9 deletions include/swift/AST/ASTMangler.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ class RootProtocolConformance;

namespace Mangle {

enum class DestructorKind {
NonDeallocating,
Deallocating,
IsolatedDeallocating
};

/// The mangler for AST declarations.
class ASTMangler : public Mangler {
protected:
Expand Down Expand Up @@ -211,7 +205,7 @@ class ASTMangler : public Mangler {
SymbolKind SKind = SymbolKind::Default);

std::string mangleDestructorEntity(const DestructorDecl *decl,
DestructorKind kind,
bool isDeallocating,
SymbolKind SKind = SymbolKind::Default);

std::string mangleConstructorEntity(const ConstructorDecl *ctor,
Expand Down Expand Up @@ -709,8 +703,8 @@ class ASTMangler : public Mangler {
bool tryAppendStandardSubstitution(const GenericTypeDecl *type);

void appendConstructorEntity(const ConstructorDecl *ctor, bool isAllocating);

void appendDestructorEntity(const DestructorDecl *decl, DestructorKind kind);
void appendDestructorEntity(const DestructorDecl *decl, bool isDeallocating);

/// \param accessorKindCode The code to describe the accessor and addressor
/// kind. Usually retrieved using getCodeForAccessorKind.
Expand Down
12 changes: 0 additions & 12 deletions include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1368,10 +1368,6 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
std::optional<std::pair<CustomAttr *, NominalTypeDecl *>>
getGlobalActorAttr() const;

/// Determine whether there is an explicit isolation attribute
/// of any kind.
bool hasExplicitIsolationAttribute() const;

/// If an alternative module name is specified for this decl, e.g. using
/// @_originalDefinedIn attribute, this function returns this module name.
StringRef getAlternateModuleName() const;
Expand Down Expand Up @@ -3147,10 +3143,6 @@ class ValueDecl : public Decl {
/// Retrieve the declaration that this declaration overrides, if any.
ValueDecl *getOverriddenDecl() const;

/// Retrieve the declaration that this declaration overrides, including super
/// deinit.
ValueDecl *getOverriddenDeclOrSuperDeinit() const;

/// Retrieve the declarations that this declaration overrides, if any.
llvm::TinyPtrVector<ValueDecl *> getOverriddenDecls() const;

Expand Down Expand Up @@ -8915,10 +8907,6 @@ class DestructorDecl : public AbstractFunctionDecl {
/// Retrieve the Objective-C selector for destructors.
ObjCSelector getObjCSelector() const;

/// Retrieves destructor decl from the superclass, or nil if there is no
/// superclass
DestructorDecl *getSuperDeinit() const;

static bool classof(const Decl *D) {
return D->getKind() == DeclKind::Destructor;
}
Expand Down
5 changes: 1 addition & 4 deletions include/swift/AST/DeclAttr.def
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,14 @@ SIMPLE_DECL_ATTR(rethrows, Rethrows,
CONTEXTUAL_SIMPLE_DECL_ATTR(indirect, Indirect,
DeclModifier | OnEnum | OnEnumElement | ABIBreakingToAdd | ABIBreakingToRemove | APIStableToAdd | APIStableToRemove,
60)
CONTEXTUAL_SIMPLE_DECL_ATTR(isolated, Isolated,
DeclModifier | OnDestructor | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
103)
CONTEXTUAL_SIMPLE_DECL_ATTR(async, Async,
DeclModifier | OnVar | OnFunc | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
106)
SIMPLE_DECL_ATTR(reasync, Reasync,
OnFunc | OnConstructor | RejectByParser | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
109)
CONTEXTUAL_DECL_ATTR(nonisolated, Nonisolated,
DeclModifier | OnFunc | OnConstructor | OnDestructor | OnVar | OnSubscript | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove,
DeclModifier | OnFunc | OnConstructor | OnVar | OnSubscript | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove,
112)
CONTEXTUAL_SIMPLE_DECL_ATTR(distributed, DistributedActor,
DeclModifier | OnClass | OnFunc | OnAccessor | OnVar | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
Expand Down
13 changes: 1 addition & 12 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -5883,12 +5883,9 @@ ERROR(global_actor_not_usable_from_inline,none,
NOTE(move_global_actor_attr_to_storage_decl,none,
"move global actor attribute to %kind0", (const ValueDecl *))

ERROR(actor_isolation_multiple_attr_2,none,
ERROR(actor_isolation_multiple_attr,none,
"%kind0 has multiple actor-isolation attributes ('%1' and '%2')",
(const Decl *, StringRef, StringRef))
ERROR(actor_isolation_multiple_attr_3,none,
"%0 %1 has multiple actor-isolation attributes ('%2', '%3' and '%4')",
(const Decl *, StringRef, StringRef, StringRef))
ERROR(actor_isolation_override_mismatch,none,
"%0 %kind1 has different actor isolation from %2 overridden declaration",
(ActorIsolation, const ValueDecl *, ActorIsolation))
Expand All @@ -5905,14 +5902,6 @@ ERROR(async_named_decl_must_be_available_from_async,none,
ERROR(async_unavailable_decl,none,
"%kindbase0 is unavailable from asynchronous contexts%select{|; %1}1",
(const ValueDecl *, StringRef))


ERROR(isolated_deinit_no_isolation,none,
"deinit is marked isolated, but containing class %0 is not isolated to an actor",
(DeclName))
ERROR(isolated_deinit_on_value_type,none,
"only classes and actors can have isolated deinit",
())

//------------------------------------------------------------------------------
// MARK: String Processing
Expand Down
13 changes: 1 addition & 12 deletions include/swift/AST/PrintOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class DeclContext;
class Type;
class ModuleDecl;
enum class DeclAttrKind : unsigned;
class DeclAttribute;
class CustomAttr;
class SynthesizedExtensionAnalyzer;
struct PrintOptions;
class SILPrintContext;
Expand Down Expand Up @@ -344,10 +342,6 @@ struct PrintOptions {
/// Suppress emitting @available(*, noasync)
bool SuppressNoAsyncAvailabilityAttr = false;

/// Suppress emitting isolated or async deinit, and emit open containing class
/// as public
bool SuppressIsolatedDeinit = false;

/// Whether to print the \c{/*not inherited*/} comment on factory initializers.
bool PrintFactoryInitializerComment = true;

Expand Down Expand Up @@ -399,8 +393,6 @@ struct PrintOptions {
DeclAttrKind::FixedLayout, DeclAttrKind::ShowInInterface,
};

std::vector<CustomAttr *> ExcludeCustomAttrList = {};

/// List of attribute kinds that should be printed exclusively.
/// Empty means allow all.
std::vector<AnyAttrKind> ExclusiveAttrList;
Expand Down Expand Up @@ -635,8 +627,6 @@ struct PrintOptions {
return false;
}

bool excludeAttr(const DeclAttribute *DA) const;

/// Retrieve the set of options for verbose printing to users.
static PrintOptions printVerbose() {
PrintOptions result;
Expand Down Expand Up @@ -692,8 +682,7 @@ struct PrintOptions {
result.SkipPrivateSystemDecls = true;
result.SkipUnderscoredSystemProtocols = true;
result.SkipUnsafeCXXMethods = true;
result.SkipDeinit = false; // Deinit may have isolation attributes, which
// are part of the interface
result.SkipDeinit = true;
result.EmptyLineBetweenDecls = true;
result.CascadeDocComment = true;
result.ShouldQualifyNestedDeclarations =
Expand Down
2 changes: 0 additions & 2 deletions include/swift/Basic/Features.def
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,6 @@ SUPPRESSIBLE_EXPERIMENTAL_FEATURE(AllowUnsafeAttribute, true)
/// Warn on use of unsafe constructs.
EXPERIMENTAL_FEATURE(WarnUnsafe, true)

SUPPRESSIBLE_LANGUAGE_FEATURE(IsolatedDeinit, 371, "isolated/async deinit")

#undef EXPERIMENTAL_FEATURE_EXCLUDED_FROM_MODULE_INTERFACE
#undef EXPERIMENTAL_FEATURE
#undef UPCOMING_FEATURE
Expand Down
1 change: 0 additions & 1 deletion include/swift/Demangling/DemangleNodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ NODE(InfixOperator)
CONTEXT_NODE(Initializer)
CONTEXT_NODE(InitAccessor)
NODE(Isolated)
CONTEXT_NODE(IsolatedDeallocator)
NODE(Sending)
NODE(IsolatedAnyFunctionType)
NODE(SendingResultFunctionType)
Expand Down
5 changes: 0 additions & 5 deletions include/swift/Runtime/Concurrency.h
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,6 @@ swift_task_createNullaryContinuationJob(
size_t priority,
AsyncTask *continuation);

SWIFT_EXPORT_FROM(swift_Concurrency)
SWIFT_CC(swift)
void swift_task_deinitOnExecutor(void *object, DeinitWorkFunction *work,
SerialExecutorRef newExecutor, size_t flags);

/// Report error about attempting to bind a task-local value from an illegal context.
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
void swift_task_reportIllegalTaskLocalBindingWithinWithTaskGroup(
Expand Down
16 changes: 1 addition & 15 deletions include/swift/Runtime/RuntimeFunctions.def
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,7 @@ FUNCTION(GetTypeByMangledNameInContextInMetadataState2,
EFFECT(MetaData),
MEMEFFECTS(ArgMemOnly))

// AsyncTask *swift_task_getCurrent();
// AsyncTask *swift_task_getCurrent();s
FUNCTION(GetCurrentTask,
swift_task_getCurrent, SwiftCC,
ConcurrencyAvailability,
Expand Down Expand Up @@ -2347,20 +2347,6 @@ FUNCTION(TaskSwitchFunc,
ATTRS(NoUnwind),
EFFECT(Concurrency),
UNKNOWN_MEMEFFECTS)

// void swift_task_deinitOnExecutor(void *object,
// DeinitWorkFunction *work,
// SerialExecutorRef newExecutor,
// size_t flags);
FUNCTION(DeinitOnExecutorFunc,
swift_task_deinitOnExecutor, SwiftCC,
ConcurrencyAvailability,
RETURNS(VoidTy),
ARGS(Int8PtrTy, Int8PtrTy, ExecutorFirstTy, ExecutorSecondTy, SizeTy),
ATTRS(NoUnwind),
EFFECT(Concurrency),
UNKNOWN_MEMEFFECTS)


// AsyncTask *swift_continuation_init(AsyncContext *continuationContext,
// AsyncContinuationFlags);
Expand Down
13 changes: 4 additions & 9 deletions include/swift/SIL/SILDeclRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,19 @@ struct SILDeclRef {
/// Initializer - this constant references the initializing constructor
/// entry point of the class ConstructorDecl in loc.
Initializer,

/// EnumElement - this constant references the injection function for
/// an EnumElementDecl.
EnumElement,

/// Destroyer - this constant references the destroying destructor for the
/// DestructorDecl in loc.
Destroyer,

/// Deallocator - this constant references the deallocating
/// destructor for the DestructorDecl in loc.
Deallocator,

/// Deallocator - this constant references the isolated deallocating
/// destructor for the DestructorDecl in loc.
IsolatedDeallocator,


/// GlobalAccessor - this constant references the lazy-initializing
/// accessor for the global VarDecl in loc.
GlobalAccessor,
Expand Down Expand Up @@ -343,8 +339,7 @@ struct SILDeclRef {
}
/// True if the SILDeclRef references a destructor entry point.
bool isDestructor() const {
return kind == Kind::Destroyer || kind == Kind::Deallocator ||
kind == Kind::IsolatedDeallocator;
return kind == Kind::Destroyer || kind == Kind::Deallocator;
}
/// True if the SILDeclRef references an enum entry point.
bool isEnumElement() const {
Expand Down
3 changes: 0 additions & 3 deletions include/swift/SIL/SILModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -1113,9 +1113,6 @@ namespace Lowering {
/// Determine whether the given class will be allocated/deallocated using the
/// Objective-C runtime, i.e., +alloc and -dealloc.
LLVM_LIBRARY_VISIBILITY bool usesObjCAllocator(ClassDecl *theClass);
/// Determine if isolating destructor is needed.
LLVM_LIBRARY_VISIBILITY bool needsIsolatingDestructor(DestructorDecl *dd);

} // namespace Lowering
} // namespace swift

Expand Down
26 changes: 8 additions & 18 deletions lib/AST/ASTMangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ std::string ASTMangler::mangleEntity(const ValueDecl *decl, SymbolKind SKind) {
}

std::string ASTMangler::mangleDestructorEntity(const DestructorDecl *decl,
DestructorKind kind,
bool isDeallocating,
SymbolKind SKind) {
llvm::SaveAndRestore X(AllowInverses, inversesAllowed(decl));
beginMangling();
appendDestructorEntity(decl, kind);
appendDestructorEntity(decl, isDeallocating);
appendSymbolKind(SKind);
return finalize();
}
Expand Down Expand Up @@ -838,7 +838,7 @@ void ASTMangler::appendAnyDecl(const ValueDecl *Decl) {
if (auto Ctor = dyn_cast<ConstructorDecl>(Decl)) {
appendConstructorEntity(Ctor, /*isAllocating=*/false);
} else if (auto Dtor = dyn_cast<DestructorDecl>(Decl)) {
appendDestructorEntity(Dtor, DestructorKind::NonDeallocating);
appendDestructorEntity(Dtor, /*isDeallocating=*/false);
} else if (auto GTD = dyn_cast<GenericTypeDecl>(Decl)) {
appendAnyGenericType(GTD);
} else if (isa<AssociatedTypeDecl>(Decl)) {
Expand Down Expand Up @@ -940,7 +940,7 @@ std::string ASTMangler::mangleHasSymbolQuery(const ValueDecl *Decl) {
if (auto Ctor = dyn_cast<ConstructorDecl>(Decl)) {
appendConstructorEntity(Ctor, /*isAllocating=*/false);
} else if (auto Dtor = dyn_cast<DestructorDecl>(Decl)) {
appendDestructorEntity(Dtor, DestructorKind::NonDeallocating);
appendDestructorEntity(Dtor, /*isDeallocating=*/false);
} else if (auto GTD = dyn_cast<GenericTypeDecl>(Decl)) {
appendAnyGenericType(GTD);
} else if (isa<AssociatedTypeDecl>(Decl)) {
Expand Down Expand Up @@ -2447,8 +2447,8 @@ void ASTMangler::appendContext(const DeclContext *ctx,
}

if (auto dtor = dyn_cast<DestructorDecl>(fn))
return appendDestructorEntity(dtor, DestructorKind::NonDeallocating);

return appendDestructorEntity(dtor, /*deallocating*/ false);
return appendEntity(fn);
}

Expand Down Expand Up @@ -3953,20 +3953,10 @@ void ASTMangler::appendConstructorEntity(const ConstructorDecl *ctor,
}

void ASTMangler::appendDestructorEntity(const DestructorDecl *dtor,
DestructorKind kind) {
bool isDeallocating) {
BaseEntitySignature base(dtor);
appendContextOf(dtor, base);
switch (kind) {
case DestructorKind::NonDeallocating:
appendOperator("fd");
break;
case DestructorKind::Deallocating:
appendOperator("fD");
break;
case DestructorKind::IsolatedDeallocating:
appendOperator("fZ");
break;
}
appendOperator(isDeallocating ? "fD" : "fd");
}

void ASTMangler::appendAccessorEntity(StringRef accessorKindCode,
Expand Down
Loading