File tree Expand file tree Collapse file tree 14 files changed +21
-19
lines changed
include/swift/SILOptimizer Expand file tree Collapse file tree 14 files changed +21
-19
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ class AccessSummaryAnalysis : public BottomUpIPAnalysis {
198
198
virtual void initialize (SILPassManager *PM) override {}
199
199
virtual void invalidate () override ;
200
200
virtual void invalidate (SILFunction *F, InvalidationKind K) override ;
201
- virtual void notifyAddFunction (SILFunction *F) override {}
201
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {}
202
202
virtual void notifyDeleteFunction (SILFunction *F) override {
203
203
invalidate (F, InvalidationKind::Nothing);
204
204
}
Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ class AliasAnalysis : public SILAnalysis {
281
281
}
282
282
283
283
// / Notify the analysis about a newly created function.
284
- virtual void notifyAddFunction (SILFunction *F) override { }
284
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {}
285
285
286
286
// / Notify the analysis about a function which will be deleted from the
287
287
// / module.
Original file line number Diff line number Diff line change @@ -116,8 +116,8 @@ class SILAnalysis : public DeleteNotificationHandler {
116
116
// / Invalidate all of the information for a specific function.
117
117
virtual void invalidate (SILFunction *f, InvalidationKind k) = 0;
118
118
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;
121
121
122
122
// / Notify the analysis about a function which will be deleted from the
123
123
// / module.
@@ -244,7 +244,7 @@ class FunctionAnalysisBase : public SILAnalysis {
244
244
}
245
245
246
246
// / Notify the analysis about a newly created function.
247
- virtual void notifyAddFunction (SILFunction *f) override {}
247
+ virtual void notifyAddedOrModifiedFunction (SILFunction *f) override {}
248
248
249
249
// / Notify the analysis about a function which will be deleted from the
250
250
// / module.
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ class BasicCalleeAnalysis : public SILAnalysis {
144
144
}
145
145
146
146
// / Notify the analysis about a newly created function.
147
- virtual void notifyAddFunction (SILFunction *F) override {
147
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {
148
148
// Nothing to be done because the analysis does not cache anything
149
149
// per call-site in functions.
150
150
}
Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ class CallerAnalysis : public SILAnalysis {
104
104
RecomputeFunctionList.insert (F);
105
105
}
106
106
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 {
109
109
RecomputeFunctionList.insert (F);
110
110
}
111
111
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class ClassHierarchyAnalysis : public SILAnalysis {
54
54
virtual void invalidate (SILFunction *F, InvalidationKind K) override { }
55
55
56
56
// / Notify the analysis about a newly created function.
57
- virtual void notifyAddFunction (SILFunction *F) override { }
57
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {}
58
58
59
59
// / Notify the analysis about a function which will be deleted from the
60
60
// / module.
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ class ClosureScopeAnalysis : public SILAnalysis {
144
144
}
145
145
146
146
// / Notify the analysis about a newly created function.
147
- virtual void notifyAddFunction (SILFunction *F) override {
147
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {
148
148
// Nothing to be done because the analysis does not cache anything
149
149
// per call-site in functions.
150
150
}
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class DestructorAnalysis : public SILAnalysis {
46
46
}
47
47
48
48
// / Notify the analysis about a newly created function.
49
- virtual void notifyAddFunction (SILFunction *F) override { }
49
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {}
50
50
51
51
// / Notify the analysis about a function which will be deleted from the
52
52
// / module.
Original file line number Diff line number Diff line change @@ -802,7 +802,7 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
802
802
virtual void invalidate (SILFunction *F, InvalidationKind K) override ;
803
803
804
804
// / Notify the analysis about a newly created function.
805
- virtual void notifyAddFunction (SILFunction *F) override { }
805
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {}
806
806
807
807
// / Notify the analysis about a function which will be deleted from the
808
808
// / module.
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class ProtocolConformanceAnalysis : public SILAnalysis {
54
54
virtual void invalidate (SILFunction *F, InvalidationKind K) override {}
55
55
56
56
// / Notify the analysis about a newly created function.
57
- virtual void notifyAddFunction (SILFunction *F) override {}
57
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {}
58
58
59
59
// / Notify the analysis about a function which will be deleted from the
60
60
// / module.
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ class GenericFunctionEffectAnalysis : public BottomUpIPAnalysis {
123
123
virtual void invalidate (SILFunction *F, InvalidationKind K) override ;
124
124
125
125
// / Notify the analysis about a newly created function.
126
- virtual void notifyAddFunction (SILFunction *F) override {}
126
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {}
127
127
128
128
// / Notify the analysis about a function which will be deleted from the
129
129
// / module.
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ class TypeExpansionAnalysis : public SILAnalysis {
44
44
virtual void invalidate (SILFunction *F, InvalidationKind K) override { }
45
45
46
46
// / Notify the analysis about a newly created function.
47
- virtual void notifyAddFunction (SILFunction *F) override { }
47
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {}
48
48
49
49
// / Notify the analysis about a function which will be deleted from the
50
50
// / module.
Original file line number Diff line number Diff line change @@ -163,14 +163,16 @@ class SILPassManager {
163
163
// / is derived. This is used to avoid an infinite amount of functions pushed
164
164
// / on the worklist (e.g. caused by a bug in a specializing optimization).
165
165
void addFunctionToWorklist (SILFunction *F, SILFunction *DerivedFrom);
166
-
166
+
167
167
// / \brief Iterate over all analysis and notify them of the function.
168
+ // /
168
169
// / This function does not necessarily have to be newly created function. It
169
170
// / is the job of the analysis to make sure no extra work is done if the
170
171
// / particular analysis has been done on the function.
171
172
void notifyAnalysisOfFunction (SILFunction *F) {
172
- for (auto AP : Analysis)
173
- AP->notifyAddFunction (F);
173
+ for (auto AP : Analysis) {
174
+ AP->notifyAddedOrModifiedFunction (F);
175
+ }
174
176
}
175
177
176
178
// / \brief Broadcast the invalidation of the function to all analysis.
Original file line number Diff line number Diff line change @@ -492,7 +492,7 @@ class OptimizerStatsAnalysis : public SILAnalysis {
492
492
}
493
493
494
494
// / Notify the analysis about a newly created function.
495
- virtual void notifyAddFunction (SILFunction *F) override {
495
+ virtual void notifyAddedOrModifiedFunction (SILFunction *F) override {
496
496
AddedFuncs.push_back (F);
497
497
}
498
498
You can’t perform that action at this time.
0 commit comments