mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Add a new pop_back() method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b9b8959091
commit
a7e26118a2
@ -85,6 +85,7 @@ public:
|
||||
ValueSubclass *remove(iterator &DI); // Defined in ValueHolderImpl.h
|
||||
ValueSubclass *remove(const iterator &DI); // Defined in ValueHolderImpl.h
|
||||
void remove(ValueSubclass *D); // Defined in ValueHolderImpl.h
|
||||
ValueSubclass *pop_back(); // Defined in ValueHolderImpl.h
|
||||
|
||||
void push_front(ValueSubclass *Inst); // Defined in ValueHolderImpl.h
|
||||
void push_back(ValueSubclass *Inst); // Defined in ValueHolderImpl.h
|
||||
|
@ -59,6 +59,21 @@ ValueSubclass *ValueHolder<ValueSubclass,ItemParentType>::remove(iterator &DI) {
|
||||
return i;
|
||||
}
|
||||
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user