aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-06-30 04:35:21 +0000
committerChris Lattner <sabre@nondot.org>2001-06-30 04:35:21 +0000
commita7e26118a24eb65321cc89675dcdc473714c4eaf (patch)
treee2090f53edb41207385512e7ed16bfe4a4786758 /lib/VMCore
parentb9b8959091517b47675f7126b40bd50bcfdbb384 (diff)
downloadexternal_llvm-a7e26118a24eb65321cc89675dcdc473714c4eaf.zip
external_llvm-a7e26118a24eb65321cc89675dcdc473714c4eaf.tar.gz
external_llvm-a7e26118a24eb65321cc89675dcdc473714c4eaf.tar.bz2
Add a new pop_back() method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/ValueHolderImpl.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/VMCore/ValueHolderImpl.h b/lib/VMCore/ValueHolderImpl.h
index 9d0e874..f19d71f 100644
--- a/lib/VMCore/ValueHolderImpl.h
+++ b/lib/VMCore/ValueHolderImpl.h
@@ -60,6 +60,21 @@ ValueSubclass *ValueHolder<ValueSubclass,ItemParentType>::remove(iterator &DI) {
}
template<class ValueSubclass, class ItemParentType>
+ValueSubclass *ValueHolder<ValueSubclass,ItemParentType>::pop_back() {
+ assert(!ValueList.empty() && "Can't pop_back an empty valuelist!");
+ ValueSubclass *i = ValueList.back();
+ ValueList.pop_back();
+ i->setParent(0); // I don't own you anymore... byebye...
+
+ // You don't get to be in the symbol table anymore... byebye
+ if (i->hasName() && Parent)
+ Parent->getSymbolTable()->remove(i);
+
+ return i;
+}
+
+
+template<class ValueSubclass, class ItemParentType>
ValueSubclass *ValueHolder<ValueSubclass,ItemParentType>
::remove(const iterator &DI) {
assert(DI != ValueList.end() &&