[llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h

Chris Lattner lattner at cs.uiuc.edu
Thu Aug 31 23:08:30 PDT 2006



Changes in directory llvm/include/llvm/ADT:

SmallVector.h updated: 1.17 -> 1.18
---
Log message:

add a simple reserve method.


---
Diffs of the changes:  (+5 -0)

 SmallVector.h |    5 +++++
 1 files changed, 5 insertions(+)


Index: llvm/include/llvm/ADT/SmallVector.h
diff -u llvm/include/llvm/ADT/SmallVector.h:1.17 llvm/include/llvm/ADT/SmallVector.h:1.18
--- llvm/include/llvm/ADT/SmallVector.h:1.17	Mon Aug 28 16:52:08 2006
+++ llvm/include/llvm/ADT/SmallVector.h	Fri Sep  1 01:08:16 2006
@@ -136,6 +136,11 @@
     }
   }
   
+  void reserve(unsigned N) {
+    if (unsigned(Capacity-Begin) < N)
+      grow(N);
+  }
+  
   void swap(SmallVectorImpl &RHS);
   
   /// append - Add the specified range to the end of the SmallVector.






More information about the llvm-commits mailing list