mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Make delete notifications elective
This commit adds a hook that allows passes, analysis or data structures that can be registered as receivers of delete notifications to decide if they want to receive notifications All of the analysis and the currently executing passes are automatically registered to receive notifications and this hook is useful in reducing the runtime overhead. With this change the only analysis that accepts notifications is alias analysis.
This commit is contained in:
@@ -681,7 +681,11 @@ lookUpFunctionInVTable(ClassDecl *Class, SILDeclRef Member) {
|
||||
|
||||
void SILModule::
|
||||
registerDeleteNotificationHandler(DeleteNotificationHandler* Handler) {
|
||||
NotificationHandlers.insert(Handler);
|
||||
// Ask the handler (that can be an analysis, a pass, or some other data
|
||||
// structure) if it wants to receive delete notifications.
|
||||
if (Handler->needsNotifications()) {
|
||||
NotificationHandlers.insert(Handler);
|
||||
}
|
||||
}
|
||||
|
||||
void SILModule::
|
||||
|
||||
Reference in New Issue
Block a user