File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
include/swift/SILOptimizer/Analysis Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ class CalleeCache {
118
118
119
119
class BasicCalleeAnalysis : public SILAnalysis {
120
120
SILModule &M;
121
- CalleeCache * Cache;
121
+ std::unique_ptr< CalleeCache> Cache;
122
122
123
123
public:
124
124
BasicCalleeAnalysis (SILModule *M)
@@ -129,17 +129,15 @@ class BasicCalleeAnalysis : public SILAnalysis {
129
129
}
130
130
131
131
virtual void invalidate (SILAnalysis::InvalidationKind K) {
132
- if (K & InvalidationKind::Functions) {
133
- delete Cache;
134
- Cache = nullptr ;
135
- }
132
+ if (K & InvalidationKind::Functions)
133
+ Cache.reset ();
136
134
}
137
135
138
136
virtual void invalidate (SILFunction *F, InvalidationKind K) { invalidate (K); }
139
137
140
138
CalleeList getCalleeList (FullApplySite FAS) {
141
139
if (!Cache)
142
- Cache = new CalleeCache (M);
140
+ Cache = llvm::make_unique< CalleeCache> (M);
143
141
144
142
return Cache->getCalleeList (FAS);
145
143
}
You can’t perform that action at this time.
0 commit comments