File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
include/swift/SILOptimizer/Analysis Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -138,14 +138,23 @@ class BasicCalleeAnalysis : public SILAnalysis {
138
138
}
139
139
140
140
// / Invalidate all of the information for a specific function.
141
- virtual void invalidate (SILFunction *F, InvalidationKind K) override { }
141
+ virtual void invalidate (SILFunction *F, InvalidationKind K) override {
142
+ // No invalidation needed because the analysis does not cache anything
143
+ // per call-site in functions.
144
+ }
142
145
143
146
// / Notify the analysis about a newly created function.
144
- virtual void notifyAddFunction (SILFunction *F) override { }
147
+ virtual void notifyAddFunction (SILFunction *F) override {
148
+ // Nothing to be done because the analysis does not cache anything
149
+ // per call-site in functions.
150
+ }
145
151
146
152
// / Notify the analysis about a function which will be deleted from the
147
153
// / module.
148
- virtual void notifyDeleteFunction (SILFunction *F) override { };
154
+ virtual void notifyDeleteFunction (SILFunction *F) override {
155
+ // No invalidation needed because the analysis does not cache anything
156
+ // per call-site in functions.
157
+ };
149
158
150
159
// / Notify the analysis about changed witness or vtables.
151
160
virtual void invalidateFunctionTables () override {
Original file line number Diff line number Diff line change @@ -35,10 +35,16 @@ class DestructorAnalysis : public SILAnalysis {
35
35
bool mayStoreToMemoryOnDestruction (SILType T);
36
36
37
37
// / No invalidation is needed.
38
- virtual void invalidate () override { }
38
+ virtual void invalidate () override {
39
+ // Nothing can invalidate, because types are static and cannot be changed
40
+ // during the SIL pass pipeline.
41
+ }
39
42
40
43
// / No invalidation is needed.
41
- virtual void invalidate (SILFunction *F, InvalidationKind K) override { }
44
+ virtual void invalidate (SILFunction *F, InvalidationKind K) override {
45
+ // Nothing can invalidate, because types are static and cannot be changed
46
+ // during the SIL pass pipeline.
47
+ }
42
48
43
49
// / Notify the analysis about a newly created function.
44
50
virtual void notifyAddFunction (SILFunction *F) override { }
Original file line number Diff line number Diff line change @@ -970,9 +970,6 @@ class CapturePromotionPass : public SILModuleTransform {
970
970
for (auto &F : *getModule ())
971
971
processFunction (&F, Worklist);
972
972
973
- if (!Worklist.empty ()) {
974
- }
975
-
976
973
while (!Worklist.empty ())
977
974
processFunction (Worklist.pop_back_val (), Worklist);
978
975
}
You can’t perform that action at this time.
0 commit comments