File tree Expand file tree Collapse file tree 3 files changed +6
-22
lines changed Expand file tree Collapse file tree 3 files changed +6
-22
lines changed Original file line number Diff line number Diff line change @@ -368,8 +368,6 @@ public SwiftObjectHeader {
368
368
const SILArgument *getArgument (unsigned i) const { return ArgumentList[i]; }
369
369
SILArgument *getArgument (unsigned i) { return ArgumentList[i]; }
370
370
371
- void cloneArgumentList (SILBasicBlock *Other);
372
-
373
371
void moveArgumentList (SILBasicBlock *from);
374
372
375
373
// / Erase a specific argument from the arg list.
Original file line number Diff line number Diff line change @@ -840,7 +840,12 @@ void SILCloner<ImplClass>::cloneFunction(SILFunction *origF) {
840
840
SILFunction *newF = &Builder.getFunction ();
841
841
842
842
auto *newEntryBB = newF->createBasicBlock ();
843
- newEntryBB->cloneArgumentList (origF->getEntryBlock ());
843
+
844
+ for (auto *funcArg : origF->begin ()->getSILFunctionArguments ()) {
845
+ auto *newArg = newEntryBB->insertFunctionArgument (newEntryBB->getNumArguments (),
846
+ asImpl ().remapType (funcArg->getType ()), funcArg->getOwnershipKind (), funcArg->getDecl ());
847
+ newArg->copyFlags (funcArg);
848
+ }
844
849
845
850
// Copy the new entry block arguments into a separate vector purely to
846
851
// resolve the type mismatch between SILArgument* and SILValue.
Original file line number Diff line number Diff line change @@ -151,25 +151,6 @@ void SILBasicBlock::removeDeadBlock() {
151
151
eraseFromParent ();
152
152
}
153
153
154
- void SILBasicBlock::cloneArgumentList (SILBasicBlock *Other) {
155
- assert (Other->isEntry () == isEntry () &&
156
- " Expected to both blocks to be entries or not" );
157
- if (isEntry ()) {
158
- assert (args_empty () && " Expected to have no arguments" );
159
- for (auto *FuncArg : Other->getSILFunctionArguments ()) {
160
- auto *NewArg =
161
- createFunctionArgument (FuncArg->getType (), FuncArg->getDecl ());
162
- NewArg->copyFlags (FuncArg);
163
- }
164
- return ;
165
- }
166
-
167
- for (auto *PHIArg : Other->getSILPhiArguments ()) {
168
- createPhiArgument (PHIArg->getType (), PHIArg->getOwnershipKind (),
169
- PHIArg->getDecl ());
170
- }
171
- }
172
-
173
154
void SILBasicBlock::moveArgumentList (SILBasicBlock *from) {
174
155
ArgumentList = std::move (from->ArgumentList );
175
156
for (SILArgument *arg : getArguments ()) {
You can’t perform that action at this time.
0 commit comments