Skip to content

Commit 1fa1154

Browse files
authored
Merge pull request #17981 from gottesmm/pr-bb6b110e15966e87bcdba7920a631ccc9000b500
2 parents 72d4a6f + 1900084 commit 1fa1154

14 files changed

+21
-19
lines changed

include/swift/SILOptimizer/Analysis/AccessSummaryAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class AccessSummaryAnalysis : public BottomUpIPAnalysis {
198198
virtual void initialize(SILPassManager *PM) override {}
199199
virtual void invalidate() override;
200200
virtual void invalidate(SILFunction *F, InvalidationKind K) override;
201-
virtual void notifyAddFunction(SILFunction *F) override {}
201+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {}
202202
virtual void notifyDeleteFunction(SILFunction *F) override {
203203
invalidate(F, InvalidationKind::Nothing);
204204
}

include/swift/SILOptimizer/Analysis/AliasAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ class AliasAnalysis : public SILAnalysis {
281281
}
282282

283283
/// Notify the analysis about a newly created function.
284-
virtual void notifyAddFunction(SILFunction *F) override { }
284+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {}
285285

286286
/// Notify the analysis about a function which will be deleted from the
287287
/// module.

include/swift/SILOptimizer/Analysis/Analysis.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ class SILAnalysis : public DeleteNotificationHandler {
116116
/// Invalidate all of the information for a specific function.
117117
virtual void invalidate(SILFunction *f, InvalidationKind k) = 0;
118118

119-
/// Notify the analysis about a newly created function.
120-
virtual void notifyAddFunction(SILFunction *f) = 0;
119+
/// Notify the analysis about a newly added or modified function.
120+
virtual void notifyAddedOrModifiedFunction(SILFunction *f) = 0;
121121

122122
/// Notify the analysis about a function which will be deleted from the
123123
/// module.
@@ -244,7 +244,7 @@ class FunctionAnalysisBase : public SILAnalysis {
244244
}
245245

246246
/// Notify the analysis about a newly created function.
247-
virtual void notifyAddFunction(SILFunction *f) override {}
247+
virtual void notifyAddedOrModifiedFunction(SILFunction *f) override {}
248248

249249
/// Notify the analysis about a function which will be deleted from the
250250
/// module.

include/swift/SILOptimizer/Analysis/BasicCalleeAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class BasicCalleeAnalysis : public SILAnalysis {
144144
}
145145

146146
/// Notify the analysis about a newly created function.
147-
virtual void notifyAddFunction(SILFunction *F) override {
147+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {
148148
// Nothing to be done because the analysis does not cache anything
149149
// per call-site in functions.
150150
}

include/swift/SILOptimizer/Analysis/CallerAnalysis.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ class CallerAnalysis : public SILAnalysis {
104104
RecomputeFunctionList.insert(F);
105105
}
106106

107-
/// Notify the analysis about a newly created function.
108-
virtual void notifyAddFunction(SILFunction *F) override {
107+
/// Notify the analysis about a newly created or modified function.
108+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {
109109
RecomputeFunctionList.insert(F);
110110
}
111111

include/swift/SILOptimizer/Analysis/ClassHierarchyAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class ClassHierarchyAnalysis : public SILAnalysis {
5454
virtual void invalidate(SILFunction *F, InvalidationKind K) override { }
5555

5656
/// Notify the analysis about a newly created function.
57-
virtual void notifyAddFunction(SILFunction *F) override { }
57+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {}
5858

5959
/// Notify the analysis about a function which will be deleted from the
6060
/// module.

include/swift/SILOptimizer/Analysis/ClosureScope.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class ClosureScopeAnalysis : public SILAnalysis {
144144
}
145145

146146
/// Notify the analysis about a newly created function.
147-
virtual void notifyAddFunction(SILFunction *F) override {
147+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {
148148
// Nothing to be done because the analysis does not cache anything
149149
// per call-site in functions.
150150
}

include/swift/SILOptimizer/Analysis/DestructorAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class DestructorAnalysis : public SILAnalysis {
4646
}
4747

4848
/// Notify the analysis about a newly created function.
49-
virtual void notifyAddFunction(SILFunction *F) override { }
49+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {}
5050

5151
/// Notify the analysis about a function which will be deleted from the
5252
/// module.

include/swift/SILOptimizer/Analysis/EscapeAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
802802
virtual void invalidate(SILFunction *F, InvalidationKind K) override;
803803

804804
/// Notify the analysis about a newly created function.
805-
virtual void notifyAddFunction(SILFunction *F) override { }
805+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {}
806806

807807
/// Notify the analysis about a function which will be deleted from the
808808
/// module.

include/swift/SILOptimizer/Analysis/ProtocolConformanceAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class ProtocolConformanceAnalysis : public SILAnalysis {
5454
virtual void invalidate(SILFunction *F, InvalidationKind K) override {}
5555

5656
/// Notify the analysis about a newly created function.
57-
virtual void notifyAddFunction(SILFunction *F) override {}
57+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {}
5858

5959
/// Notify the analysis about a function which will be deleted from the
6060
/// module.

include/swift/SILOptimizer/Analysis/SideEffectAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class GenericFunctionEffectAnalysis : public BottomUpIPAnalysis {
123123
virtual void invalidate(SILFunction *F, InvalidationKind K) override;
124124

125125
/// Notify the analysis about a newly created function.
126-
virtual void notifyAddFunction(SILFunction *F) override {}
126+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {}
127127

128128
/// Notify the analysis about a function which will be deleted from the
129129
/// module.

include/swift/SILOptimizer/Analysis/TypeExpansionAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class TypeExpansionAnalysis : public SILAnalysis {
4444
virtual void invalidate(SILFunction *F, InvalidationKind K) override { }
4545

4646
/// Notify the analysis about a newly created function.
47-
virtual void notifyAddFunction(SILFunction *F) override { }
47+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {}
4848

4949
/// Notify the analysis about a function which will be deleted from the
5050
/// module.

include/swift/SILOptimizer/PassManager/PassManager.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,16 @@ class SILPassManager {
163163
/// is derived. This is used to avoid an infinite amount of functions pushed
164164
/// on the worklist (e.g. caused by a bug in a specializing optimization).
165165
void addFunctionToWorklist(SILFunction *F, SILFunction *DerivedFrom);
166-
166+
167167
/// \brief Iterate over all analysis and notify them of the function.
168+
///
168169
/// This function does not necessarily have to be newly created function. It
169170
/// is the job of the analysis to make sure no extra work is done if the
170171
/// particular analysis has been done on the function.
171172
void notifyAnalysisOfFunction(SILFunction *F) {
172-
for (auto AP : Analysis)
173-
AP->notifyAddFunction(F);
173+
for (auto AP : Analysis) {
174+
AP->notifyAddedOrModifiedFunction(F);
175+
}
174176
}
175177

176178
/// \brief Broadcast the invalidation of the function to all analysis.

lib/SILOptimizer/Utils/OptimizerStatsUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ class OptimizerStatsAnalysis : public SILAnalysis {
492492
}
493493

494494
/// Notify the analysis about a newly created function.
495-
virtual void notifyAddFunction(SILFunction *F) override {
495+
virtual void notifyAddedOrModifiedFunction(SILFunction *F) override {
496496
AddedFuncs.push_back(F);
497497
}
498498

0 commit comments

Comments
 (0)