aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Function.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/Function.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/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index e918fd5878..ede2ca2097 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -147,6 +147,14 @@ const Type *Function::getReturnType() const {
return getFunctionType()->getReturnType();
}
+void Function::removeFromParent() {
+ getParent()->getFunctionList().remove(this);
+}
+
+void Function::eraseFromParent() {
+ getParent()->getFunctionList().erase(this);
+}
+
// dropAllReferences() - This function causes all the subinstructions to "let
// go" of all references that they are maintaining. This allows one to
// 'delete' a whole class at a time, even though there may be circular