@@ -204,45 +204,6 @@ inline Operand *getAnyDebugUse(SILValue value) {
204204 return *ii;
205205}
206206
207- // / Erases the instruction \p I from it's parent block and deletes it, including
208- // / all debug instructions which use \p I.
209- // / Precondition: The instruction may only have debug instructions as uses.
210- // / If the iterator \p InstIter references any deleted instruction, it is
211- // / incremented.
212- // /
213- // / \p callBack will be invoked before each instruction is deleted. \p callBack
214- // / is not responsible for deleting the instruction because this utility
215- // / unconditionally deletes the \p I and its debug users.
216- // /
217- // / Returns an iterator to the next non-deleted instruction after \p I.
218- inline SILBasicBlock::iterator eraseFromParentWithDebugInsts (
219- SILInstruction *I, llvm::function_ref<void (SILInstruction *)> callBack =
220- [](SILInstruction *) {}) {
221-
222- auto nextII = std::next (I->getIterator ());
223-
224- auto results = I->getResults ();
225-
226- bool foundAny;
227- do {
228- foundAny = false ;
229- for (auto result : results) {
230- while (!result->use_empty ()) {
231- foundAny = true ;
232- auto *User = result->use_begin ()->getUser ();
233- assert (User->isDebugInstruction ());
234- if (nextII == User->getIterator ())
235- nextII++;
236- callBack (User);
237- User->eraseFromParent ();
238- }
239- }
240- } while (foundAny);
241-
242- I->eraseFromParent ();
243- return nextII;
244- }
245-
246207// / Return true if the def-use graph rooted at \p V contains any non-debug,
247208// / non-trivial users.
248209bool hasNonTrivialNonDebugTransitiveUsers (
0 commit comments