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 {
368368 const SILArgument *getArgument (unsigned i) const { return ArgumentList[i]; }
369369 SILArgument *getArgument (unsigned i) { return ArgumentList[i]; }
370370
371- void cloneArgumentList (SILBasicBlock *Other);
372-
373371 void moveArgumentList (SILBasicBlock *from);
374372
375373 // / 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) {
840840 SILFunction *newF = &Builder.getFunction ();
841841
842842 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+ }
844849
845850 // Copy the new entry block arguments into a separate vector purely to
846851 // 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() {
151151 eraseFromParent ();
152152}
153153
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-
173154void SILBasicBlock::moveArgumentList (SILBasicBlock *from) {
174155 ArgumentList = std::move (from->ArgumentList );
175156 for (SILArgument *arg : getArguments ()) {
You can’t perform that action at this time.
0 commit comments