@@ -72,7 +72,7 @@ namespace swift {
72
72
// / Utility class for rewiring control-flow of inlined begin_apply functions.
73
73
class BeginApplySite {
74
74
SILLocation Loc;
75
- SILBuilder & Builder;
75
+ SILBuilder * Builder;
76
76
BeginApplyInst *BeginApply;
77
77
bool HasYield = false ;
78
78
@@ -86,11 +86,11 @@ class BeginApplySite {
86
86
87
87
public:
88
88
BeginApplySite (BeginApplyInst *BeginApply, SILLocation Loc,
89
- SILBuilder & Builder)
89
+ SILBuilder * Builder)
90
90
: Loc(Loc), Builder(Builder), BeginApply(BeginApply) {}
91
91
92
92
static Optional<BeginApplySite> get (FullApplySite AI, SILLocation Loc,
93
- SILBuilder & Builder) {
93
+ SILBuilder * Builder) {
94
94
auto *BeginApply = dyn_cast<BeginApplyInst>(AI);
95
95
if (!BeginApply)
96
96
return None;
@@ -150,18 +150,18 @@ class BeginApplySite {
150
150
auto remappedYield = remapValue (calleeYields[i]);
151
151
callerYields[i]->replaceAllUsesWith (remappedYield);
152
152
}
153
- Builder. createBranch (Loc, returnToBB);
153
+ Builder-> createBranch (Loc, returnToBB);
154
154
155
155
// Add branches at the resumption sites to the resume/unwind block.
156
156
if (EndApply) {
157
- SavedInsertionPointRAII savedIP (Builder, EndApplyBB);
157
+ SavedInsertionPointRAII savedIP (* Builder, EndApplyBB);
158
158
auto resumeBB = remapBlock (yield->getResumeBB ());
159
- Builder. createBranch (EndApply->getLoc (), resumeBB);
159
+ Builder-> createBranch (EndApply->getLoc (), resumeBB);
160
160
}
161
161
if (AbortApply) {
162
- SavedInsertionPointRAII savedIP (Builder, AbortApplyBB);
162
+ SavedInsertionPointRAII savedIP (* Builder, AbortApplyBB);
163
163
auto unwindBB = remapBlock (yield->getUnwindBB ());
164
- Builder. createBranch (AbortApply->getLoc (), unwindBB);
164
+ Builder-> createBranch (AbortApply->getLoc (), unwindBB);
165
165
}
166
166
return true ;
167
167
}
@@ -175,9 +175,9 @@ class BeginApplySite {
175
175
bool isNormal = isa<ReturnInst>(terminator);
176
176
auto returnBB = isNormal ? EndApplyReturnBB : AbortApplyReturnBB;
177
177
if (returnBB) {
178
- Builder. createBranch (Loc, returnBB);
178
+ Builder-> createBranch (Loc, returnBB);
179
179
} else {
180
- Builder. createUnreachable (Loc);
180
+ Builder-> createUnreachable (Loc);
181
181
}
182
182
return true ;
183
183
}
@@ -200,18 +200,18 @@ class BeginApplySite {
200
200
if (!HasYield) {
201
201
// Make sure the split resumption blocks have terminators.
202
202
if (EndApplyBB) {
203
- SavedInsertionPointRAII savedIP (Builder, EndApplyBB);
204
- Builder. createUnreachable (Loc);
203
+ SavedInsertionPointRAII savedIP (* Builder, EndApplyBB);
204
+ Builder-> createUnreachable (Loc);
205
205
}
206
206
if (AbortApplyBB) {
207
- SavedInsertionPointRAII savedIP (Builder, AbortApplyBB);
208
- Builder. createUnreachable (Loc);
207
+ SavedInsertionPointRAII savedIP (* Builder, AbortApplyBB);
208
+ Builder-> createUnreachable (Loc);
209
209
}
210
210
211
211
// Replace all the yielded values in the callee with undef.
212
212
for (auto calleeYield : BeginApply->getYieldedValues ()) {
213
- calleeYield->replaceAllUsesWith (SILUndef::get (calleeYield-> getType (),
214
- Builder. getModule ()));
213
+ calleeYield->replaceAllUsesWith (
214
+ SILUndef::get (calleeYield-> getType (), Builder-> getModule ()));
215
215
}
216
216
}
217
217
@@ -380,7 +380,7 @@ SILInlineCloner::SILInlineCloner(
380
380
assert (CallSiteScope->getParentFunction () == &F);
381
381
382
382
// Set up the coroutine-specific inliner if applicable.
383
- BeginApply = BeginApplySite::get (apply, Loc.getValue (), getBuilder ());
383
+ BeginApply = BeginApplySite::get (apply, Loc.getValue (), & getBuilder ());
384
384
}
385
385
386
386
// Clone the entire callee function into the caller function at the apply site.
0 commit comments