SIL optimizations: Implement the new API for analysis invalidation.

There are now separate functions for function addition and deletion instead of InvalidationKind::Function.
Also, there is a new function for witness/vtable invalidations.

rdar://problem/29311657
This commit is contained in:
Erik Eckstein
2017-03-14 10:51:50 -07:00
parent ef4b5e1efe
commit a0079ba5be
31 changed files with 309 additions and 166 deletions

View File

@@ -44,10 +44,24 @@ public:
return S->getKind() == AnalysisKind::ClassHierarchy;
}
virtual void invalidate(SILAnalysis::InvalidationKind K) {
// Nothing can invalidate the ClassHierarchyAnalysis!
/// Invalidate all information in this analysis.
virtual void invalidate() override {
// Nothing can invalidate, because types are static and cannot be changed
// during the SIL pass pipeline.
}
/// Invalidate all of the information for a specific function.
virtual void invalidate(SILFunction *F, InvalidationKind K) override { }
/// Notify the analysis about a newly created function.
virtual void notifyAddFunction(SILFunction *F) override { }
/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override { }
/// Notify the analysis about changed witness or vtables.
virtual void invalidateFunctionTables() override { }
/// Returns a list of the known direct subclasses of a class \p C in
/// the current module.
@@ -87,10 +101,6 @@ public:
return ProtocolImplementationsCache.count(C);
}
virtual void invalidate(SILFunction *F, SILAnalysis::InvalidationKind K) {
invalidate(K);
}
private:
/// Compute inheritance properties.
void init();