projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f06f35e
)
add a new assign method
author
Chris Lattner
<sabre@nondot.org>
Tue, 8 Aug 2006 01:44:16 +0000
(
01:44
+0000)
committer
Chris Lattner
<sabre@nondot.org>
Tue, 8 Aug 2006 01:44:16 +0000
(
01:44
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29562
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/SmallVector.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/SmallVector.h
b/include/llvm/ADT/SmallVector.h
index a1d226be07ed63d4a91f7a0dd6842f5be580feae..0ade4847b43c0ba219a30533d19343b1835e8f61 100644
(file)
--- a/
include/llvm/ADT/SmallVector.h
+++ b/
include/llvm/ADT/SmallVector.h
@@
-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;