Skip to content

[pass-manager] notifyDeleteFunction => notifyWillDeleteFunction. #17986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class AccessSummaryAnalysis : public BottomUpIPAnalysis {
virtual void invalidate() override;
virtual void invalidate(SILFunction *F, InvalidationKind K) override;
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {}
virtual void notifyDeleteFunction(SILFunction *F) override {
virtual void notifyWillDeleteFunction(SILFunction *F) override {
invalidate(F, InvalidationKind::Nothing);
}
virtual void invalidateFunctionTables() override {}
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Analysis/AliasAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class AliasAnalysis : public SILAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override { }
virtual void notifyWillDeleteFunction(SILFunction *F) override {}

virtual void invalidateFunctionTables() override { }
};
Expand Down
6 changes: 3 additions & 3 deletions include/swift/SILOptimizer/Analysis/Analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ class SILAnalysis : public DeleteNotificationHandler {
/// Notify the analysis about a newly added or modified function.
virtual void notifyAddedOrModifiedFunction(SILFunction *f) = 0;

/// Notify the analysis about a function which will be deleted from the
/// Notify the analysis about a function that will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *f) = 0;
virtual void notifyWillDeleteFunction(SILFunction *f) = 0;

/// Notify the analysis about changed witness or vtables.
virtual void invalidateFunctionTables() = 0;
Expand Down Expand Up @@ -248,7 +248,7 @@ class FunctionAnalysisBase : public SILAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *f) override {
virtual void notifyWillDeleteFunction(SILFunction *f) override {
invalidateFunction(f);
}

Expand Down
8 changes: 4 additions & 4 deletions include/swift/SILOptimizer/Analysis/BasicCalleeAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ class BasicCalleeAnalysis : public SILAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override {
// No invalidation needed because the analysis does not cache anything
// per call-site in functions.
};
virtual void notifyWillDeleteFunction(SILFunction *F) override {
// No invalidation needed because the analysis does not cache anything per
// call-site in functions.
}

/// Notify the analysis about changed witness or vtables.
virtual void invalidateFunctionTables() override {
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Analysis/CallerAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class CallerAnalysis : public SILAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override {
virtual void notifyWillDeleteFunction(SILFunction *F) override {
invalidateExistingCalleeRelation(F);
RecomputeFunctionList.remove(F);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ClassHierarchyAnalysis : public SILAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override { }
virtual void notifyWillDeleteFunction(SILFunction *F) override {}

/// Notify the analysis about changed witness or vtables.
virtual void invalidateFunctionTables() override { }
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Analysis/ClosureScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class ClosureScopeAnalysis : public SILAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override;
virtual void notifyWillDeleteFunction(SILFunction *F) override;

/// Notify the analysis about changed witness or vtables.
virtual void invalidateFunctionTables() override {
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Analysis/DestructorAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DestructorAnalysis : public SILAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override { }
virtual void notifyWillDeleteFunction(SILFunction *F) override {}

/// Notify the analysis about changed witness or vtables.
virtual void invalidateFunctionTables() override { }
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Analysis/EscapeAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ class EscapeAnalysis : public BottomUpIPAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override {
virtual void notifyWillDeleteFunction(SILFunction *F) override {
invalidate(F, InvalidationKind::Nothing);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ProtocolConformanceAnalysis : public SILAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override {}
virtual void notifyWillDeleteFunction(SILFunction *F) override {}

/// Notify the analysis about changed witness or vtables.
virtual void invalidateFunctionTables() override {}
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Analysis/SideEffectAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class GenericFunctionEffectAnalysis : public BottomUpIPAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override {
virtual void notifyWillDeleteFunction(SILFunction *F) override {
invalidate(F, InvalidationKind::Nothing);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TypeExpansionAnalysis : public SILAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override { }
virtual void notifyWillDeleteFunction(SILFunction *F) override {}

/// Notify the analysis about changed witness or vtables.
virtual void invalidateFunctionTables() override { }
Expand Down
4 changes: 2 additions & 2 deletions include/swift/SILOptimizer/PassManager/PassManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ class SILPassManager {
// Invalidate the analysis (unless they are locked)
for (auto AP : Analysis)
if (!AP->isLocked())
AP->notifyDeleteFunction(F);
AP->notifyWillDeleteFunction(F);

CurrentPassHasInvalidated = true;
// Any change let all passes run again.
CompletedPassesMap[F].reset();
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Analysis/ClosureScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void ClosureScopeAnalysis::invalidate() {
if (scopeData) scopeData->reset();
}

void ClosureScopeAnalysis::notifyDeleteFunction(SILFunction *F) {
void ClosureScopeAnalysis::notifyWillDeleteFunction(SILFunction *F) {
if (scopeData) scopeData->erase(F);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Utils/OptimizerStatsUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class OptimizerStatsAnalysis : public SILAnalysis {

/// Notify the analysis about a function which will be deleted from the
/// module.
virtual void notifyDeleteFunction(SILFunction *F) override {
virtual void notifyWillDeleteFunction(SILFunction *F) override {
DeletedFuncs.push_back(F);
};

Expand Down