@@ -54,6 +54,11 @@ class CalleeList {
54
54
: CalleeFunctions(llvm::makeArrayRef(List.begin(), List.end())),
55
55
IsIncomplete (IsIncomplete) {}
56
56
57
+ LLVM_ATTRIBUTE_DEPRECATED (void dump () const LLVM_ATTRIBUTE_USED,
58
+ "Only for use in the debugger");
59
+
60
+ void print (llvm::raw_ostream &os) const ;
61
+
57
62
// / Return an iterator for the beginning of the list.
58
63
ArrayRef<SILFunction *>::iterator begin () const {
59
64
return CalleeFunctions.begin ();
@@ -67,7 +72,7 @@ class CalleeList {
67
72
bool isIncomplete () const { return IsIncomplete; }
68
73
69
74
// / Returns true if all callees are known and not external.
70
- bool allCalleesVisible ();
75
+ bool allCalleesVisible () const ;
71
76
};
72
77
73
78
// / CalleeCache is a helper class that builds lists of potential
@@ -106,6 +111,8 @@ class CalleeCache {
106
111
// / given instruction. E.g. it could be destructors.
107
112
CalleeList getCalleeList (SILInstruction *I) const ;
108
113
114
+ CalleeList getCalleeList (SILDeclRef Decl) const ;
115
+
109
116
private:
110
117
void enumerateFunctionsInModule ();
111
118
void sortAndUniqueCallees ();
@@ -115,7 +122,6 @@ class CalleeCache {
115
122
void computeWitnessMethodCalleesForWitnessTable (SILWitnessTable &WT);
116
123
void computeMethodCallees ();
117
124
SILFunction *getSingleCalleeForWitnessMethod (WitnessMethodInst *WMI) const ;
118
- CalleeList getCalleeList (SILDeclRef Decl) const ;
119
125
CalleeList getCalleeList (WitnessMethodInst *WMI) const ;
120
126
CalleeList getCalleeList (ClassMethodInst *CMI) const ;
121
127
CalleeList getCalleeListForCalleeKind (SILValue Callee) const ;
@@ -162,17 +168,23 @@ class BasicCalleeAnalysis : public SILAnalysis {
162
168
Cache.reset ();
163
169
}
164
170
165
- CalleeList getCalleeList (FullApplySite FAS) {
171
+ LLVM_ATTRIBUTE_DEPRECATED (void dump () const LLVM_ATTRIBUTE_USED,
172
+ "Only for use in the debugger");
173
+
174
+ void print (llvm::raw_ostream &os) const ;
175
+
176
+ void updateCache () {
166
177
if (!Cache)
167
178
Cache = llvm::make_unique<CalleeCache>(M);
179
+ }
168
180
181
+ CalleeList getCalleeList (FullApplySite FAS) {
182
+ updateCache ();
169
183
return Cache->getCalleeList (FAS);
170
184
}
171
185
172
186
CalleeList getCalleeList (SILInstruction *I) {
173
- if (!Cache)
174
- Cache = llvm::make_unique<CalleeCache>(M);
175
-
187
+ updateCache ();
176
188
return Cache->getCalleeList (I);
177
189
}
178
190
};
0 commit comments