mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add @_neverEmitIntoClient to prohibit SIL serialization for a function
Part of the Embedded Swift linkage model, this attribute ensures that the function it applies to has a strong definition in its owning module, and that its SIL is never serialized. That way, other modules will not have access to its definition. Implements rdar://158364184.
This commit is contained in:
@@ -1068,6 +1068,14 @@ public:
|
||||
/// behaviors for it and, if it's an extension, its members.
|
||||
bool isObjCImplementation() const;
|
||||
|
||||
/// True if this declaration should never have its implementation made
|
||||
/// available to any client. This overrides cross-module optimization and
|
||||
/// optimizations that might use the implementation, such that the only
|
||||
/// implementation of this function is the one compiled into its owning
|
||||
/// module. Practically speaking, this prohibits serialization of the SIL
|
||||
/// for this definition.
|
||||
bool isNeverEmittedIntoClient() const;
|
||||
|
||||
using AuxiliaryDeclCallback = llvm::function_ref<void(Decl *)>;
|
||||
|
||||
/// Iterate over the auxiliary declarations for this declaration,
|
||||
|
||||
@@ -201,7 +201,11 @@ SIMPLE_DECL_ATTR(requires_stored_property_inits, RequiresStoredPropertyInits,
|
||||
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove | UnreachableInABIAttr,
|
||||
27)
|
||||
|
||||
// Unused '28'
|
||||
SIMPLE_DECL_ATTR(_neverEmitIntoClient, NeverEmitIntoClient,
|
||||
OnVar | OnSubscript | OnAbstractFunction,
|
||||
UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove | ForbiddenInABIAttr,
|
||||
28)
|
||||
|
||||
// Unused '29'
|
||||
|
||||
SIMPLE_DECL_ATTR(nonobjc, NonObjC,
|
||||
|
||||
Reference in New Issue
Block a user