aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/ValueHolderImpl.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-06-25 07:31:05 +0000
committerChris Lattner <sabre@nondot.org>2001-06-25 07:31:05 +0000
commit3bcd6394ecd3c928d2ea05bb64cacdcae8dc677a (patch)
treeabd721b18f3210276939233081d5c4c5d2f47f52 /lib/VMCore/ValueHolderImpl.h
parent53b1c0161d7fb6e8eb4bd1c49114a5cf57258364 (diff)
downloadexternal_llvm-3bcd6394ecd3c928d2ea05bb64cacdcae8dc677a.zip
external_llvm-3bcd6394ecd3c928d2ea05bb64cacdcae8dc677a.tar.gz
external_llvm-3bcd6394ecd3c928d2ea05bb64cacdcae8dc677a.tar.bz2
* Rename get.*Operator to create seeing that it would have to be qualified
with the classname anyways. * Add an isPHINode() method to Instruction * Add getUniqueName() to SymbolTable class * Add an insert method to ValueHolder git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ValueHolderImpl.h')
-rw-r--r--lib/VMCore/ValueHolderImpl.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/VMCore/ValueHolderImpl.h b/lib/VMCore/ValueHolderImpl.h
index 9ca5d94..1bfdd25 100644
--- a/lib/VMCore/ValueHolderImpl.h
+++ b/lib/VMCore/ValueHolderImpl.h
@@ -100,4 +100,21 @@ void ValueHolder<ValueSubclass,ItemParentType>::push_back(ValueSubclass *Inst) {
Parent->getSymbolTableSure()->insert(Inst);
}
+// ValueHolder::insert - This method inserts the specified value *BEFORE* the
+// indicated iterator position, and returns an interator to the newly inserted
+// value.
+//
+template<class ValueSubclass, class ItemParentType>
+ValueHolder<ValueSubclass,ItemParentType>::iterator
+ValueHolder<ValueSubclass,ItemParentType>::insert(iterator Pos,
+ ValueSubclass *Inst){
+ assert(Inst->getParent() == 0 && "Value already has parent!");
+ Inst->setParent(ItemParent);
+
+ iterator I = ValueList.insert(Pos, Inst);
+ if (Inst->hasName() && Parent)
+ Parent->getSymbolTableSure()->insert(Inst);
+ return I;
+}
+
#endif