Return iterator from Instruction::eraseFromParent.

Summary:
This is necessary in order to make removal while using reverse iterators work.

(See http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/084122.html)

Updates to other eraseFromParent's to come in later patches.

Reviewers: chandlerc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8783

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233869 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Berlin
2015-04-02 00:03:07 +00:00
parent 76a7f072ab
commit 525a9598d6
3 changed files with 35 additions and 30 deletions

View File

@@ -62,8 +62,8 @@ void Instruction::removeFromParent() {
getParent()->getInstList().remove(this);
}
void Instruction::eraseFromParent() {
getParent()->getInstList().erase(this);
iplist<Instruction>::iterator Instruction::eraseFromParent() {
return getParent()->getInstList().erase(this);
}
/// insertBefore - Insert an unlinked instructions into a basic block