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:
70e674e
)
Add 2nd form of resize
author
Chris Lattner
<sabre@nondot.org>
Mon, 28 Aug 2006 21:52:08 +0000
(21:52 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Mon, 28 Aug 2006 21:52:08 +0000
(21:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29945
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 ad08db33eef9a46417813435e5d099e543bb554f..d972ea6e844f0f443a85f0da21c3aaa390914011 100644
(file)
--- a/
include/llvm/ADT/SmallVector.h
+++ b/
include/llvm/ADT/SmallVector.h
@@
-124,6
+124,18
@@
public:
}
}
}
}
+ void resize(unsigned N, const T &NV) {
+ if (N < size()) {
+ destroy_range(Begin+N, End);
+ End = Begin+N;
+ } else if (N > size()) {
+ if (Begin+N > Capacity)
+ grow(N);
+ construct_range(End, Begin+N, NV);
+ End = Begin+N;
+ }
+ }
+
void swap(SmallVectorImpl &RHS);
/// append - Add the specified range to the end of the SmallVector.
void swap(SmallVectorImpl &RHS);
/// append - Add the specified range to the end of the SmallVector.