1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00

add a new assign method

llvm-svn: 29562
This commit is contained in:
Chris Lattner 2006-08-08 01:44:16 +00:00
parent be2fc7b875
commit 03c7b425a2

View File

@ -146,6 +146,15 @@ public:
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;