aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/BasicBlock.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-11 22:21:39 +0000
committerChris Lattner <sabre@nondot.org>2004-10-11 22:21:39 +0000
commit4b83380f330b1c77bb9b4ad8f63bdcf1a596afd6 (patch)
tree7fb6b7a7996f2faeda2f96657ce06ac830492135 /lib/VMCore/BasicBlock.cpp
parentb92f50fe6091a7a12f54f9884529b1127b1a14e5 (diff)
Implement remove/eraseFromParent methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16922 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/BasicBlock.cpp')
-rw-r--r--lib/VMCore/BasicBlock.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp
index 32c86c4ce6..2e8560cb65 100644
--- a/lib/VMCore/BasicBlock.cpp
+++ b/lib/VMCore/BasicBlock.cpp
@@ -105,6 +105,15 @@ void BasicBlock::setName(const std::string &name, SymbolTable *ST) {
if (P && hasName()) P->getSymbolTable().insert(this);
}
+void BasicBlock::removeFromParent() {
+ getParent()->getBasicBlockList().remove(this);
+}
+
+void BasicBlock::eraseFromParent() {
+ getParent()->getBasicBlockList().erase(this);
+}
+
+
TerminatorInst *BasicBlock::getTerminator() {
if (InstList.empty()) return 0;
return dyn_cast<TerminatorInst>(&InstList.back());