@@ -1516,6 +1516,7 @@ void SwiftPassInvocation::finishedModulePassRun() {
15161516 endPass ();
15171517 assert (!function && transform && " not running a pass" );
15181518 assert (changeNotifications == SILAnalysis::InvalidationKind::Nothing
1519+ && !functionTablesChanged
15191520 && " unhandled change notifications at end of module pass" );
15201521 transform = nullptr ;
15211522}
@@ -1551,6 +1552,7 @@ void SwiftPassInvocation::endPass() {
15511552void SwiftPassInvocation::beginTransformFunction (SILFunction *function) {
15521553 assert (!this ->function && transform && " not running a pass" );
15531554 assert (changeNotifications == SILAnalysis::InvalidationKind::Nothing
1555+ && !functionTablesChanged
15541556 && " change notifications not cleared" );
15551557 this ->function = function;
15561558}
@@ -1561,6 +1563,10 @@ void SwiftPassInvocation::endTransformFunction() {
15611563 passManager->invalidateAnalysis (function, changeNotifications);
15621564 changeNotifications = SILAnalysis::InvalidationKind::Nothing;
15631565 }
1566+ if (functionTablesChanged) {
1567+ passManager->invalidateFunctionTables ();
1568+ functionTablesChanged = false ;
1569+ }
15641570 function = nullptr ;
15651571 assert (numBlockSetsAllocated == 0 && " Not all BasicBlockSets deallocated" );
15661572 assert (numNodeSetsAllocated == 0 && " Not all NodeSets deallocated" );
@@ -1580,6 +1586,7 @@ void SwiftPassInvocation::endVerifyFunction() {
15801586 assert (function);
15811587 if (!transform) {
15821588 assert (changeNotifications == SILAnalysis::InvalidationKind::Nothing &&
1589+ !functionTablesChanged &&
15831590 " verifyication must not change the SIL of a function" );
15841591 assert (numBlockSetsAllocated == 0 && " Not all BasicBlockSets deallocated" );
15851592 assert (numNodeSetsAllocated == 0 && " Not all NodeSets deallocated" );
@@ -1634,6 +1641,9 @@ void BridgedChangeNotificationHandler::notifyChanges(Kind changeKind) const {
16341641 case Kind::effectsChanged:
16351642 invocation->notifyChanges (SILAnalysis::InvalidationKind::Effects);
16361643 break ;
1644+ case Kind::functionTablesChanged:
1645+ invocation->notifyFunctionTablesChanged ();
1646+ break ;
16371647 }
16381648}
16391649
0 commit comments