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:
Nadav Rotem
2015-12-07 15:59:57 -08:00
parent bef5b4301d
commit 9e311aff6c
4 changed files with 15 additions and 4 deletions

View File

@@ -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::