Lexer doesn't create typehandle gross stuff now, parser does.
[oota-llvm.git] / include / llvm / ValueHolder.h
index ef4ed1949f8f3a6f2e123a1b99704c08cb7a70e2..6e251ff5c17aa6583637dd8fc9e0aa0d9fd8ade2 100644 (file)
@@ -25,7 +25,7 @@
 //
 template<class ValueSubclass, class ItemParentType, class SymTabType> 
 class ValueHolder {
-  vector<ValueSubclass*> ValueList;
+  std::vector<ValueSubclass*> ValueList;
 
   ItemParentType *ItemParent;
   SymTabType *Parent;
@@ -66,10 +66,10 @@ public:
   // sub-Definition iterator code
   //===--------------------------------------------------------------------===//
   // 
-  typedef vector<ValueSubclass*>::iterator               iterator;
-  typedef vector<ValueSubclass*>::const_iterator   const_iterator;
-  typedef reverse_iterator<const_iterator> const_reverse_iterator;
-  typedef reverse_iterator<iterator>             reverse_iterator;
+  typedef std::vector<ValueSubclass*>::iterator               iterator;
+  typedef std::vector<ValueSubclass*>::const_iterator   const_iterator;
+  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+  typedef std::reverse_iterator<iterator>             reverse_iterator;
 
   inline iterator                begin()       { return ValueList.begin(); }
   inline const_iterator          begin() const { return ValueList.begin(); }
@@ -90,6 +90,12 @@ public:
   void           remove(ValueSubclass *D);     // Defined in ValueHolderImpl.h
   ValueSubclass *pop_back();                   // Defined in ValueHolderImpl.h
 
+  // replaceWith - This removes the element pointed to by 'Where', and inserts
+  // NewValue in it's place.  The old value is returned.  'Where' must be a
+  // valid iterator!
+  //
+  ValueSubclass *replaceWith(iterator &Where, ValueSubclass *NewValue);
+
   // delete_span - Remove the elements from begin to end, deleting them as we
   // go.  This leaves the iterator pointing to the element that used to be end.
   //
@@ -111,6 +117,16 @@ public:
   // value.
   //
   iterator insert(iterator Pos, ValueSubclass *Inst);
+
+  // ValueHolder::insert - This method inserts the specified _range_ of values
+  // before the 'Pos' iterator.  This currently only works for vector
+  // iterators...
+  //
+  // FIXME: This is not generic so that the code does not have to be around
+  // to be used... is this ok?
+  //
+  void insert(iterator Pos,                     // Where to insert
+              iterator First, iterator Last);   // Vector to read insts from
 };
 
 #endif