[llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Aug 7 18:44:36 PDT 2006
Changes in directory llvm/include/llvm/ADT:
SmallVector.h updated: 1.7 -> 1.8
---
Log message:
add a new assign method
---
Diffs of the changes: (+9 -0)
SmallVector.h | 9 +++++++++
1 files changed, 9 insertions(+)
Index: llvm/include/llvm/ADT/SmallVector.h
diff -u llvm/include/llvm/ADT/SmallVector.h:1.7 llvm/include/llvm/ADT/SmallVector.h:1.8
--- llvm/include/llvm/ADT/SmallVector.h:1.7 Mon Aug 7 19:37:50 2006
+++ llvm/include/llvm/ADT/SmallVector.h Mon Aug 7 20:44:16 2006
@@ -146,6 +146,15 @@
End += NumInputs;
}
+ void assign(unsigned NumElts, const T &Elt) {
+ clear();
+ if (NumElts > Capacity)
+ grow(NumElts);
+ End = Begin+NumElts;
+ for (; NumElts; --NumElts)
+ new (Begin+NumElts-1) T(Elt);
+ }
+
const SmallVector &operator=(const SmallVector &RHS) {
// Avoid self-assignment.
if (this == &RHS) return *this;
More information about the llvm-commits
mailing list