Implement two iterator remove method

llvm-svn: 2467
This commit is contained in:
Chris Lattner 2002-05-06 02:59:34 +00:00
parent 3b5ee47ef6
commit 1d4e297a65

View File

@ -96,6 +96,23 @@ ValueSubclass *ValueHolder<ValueSubclass,ItemParentType,SymTabType>
return i;
}
template<class ValueSubclass, class ItemParentType, class SymTabType>
void ValueHolder<ValueSubclass,ItemParentType,SymTabType>
::remove(iterator S, iterator E) {
for (iterator I = S; I != E; ++I) {
ValueSubclass *i = *I;
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);
}
ValueList.erase(S, E);
}
template<class ValueSubclass, class ItemParentType, class SymTabType>
ValueSubclass *ValueHolder<ValueSubclass,ItemParentType,SymTabType>
::replaceWith(iterator &DI, ValueSubclass *NewVal) {