mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user