summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-01 06:08:16 +0000
committerChris Lattner <sabre@nondot.org>2006-09-01 06:08:16 +0000
commit0750bec272350cbbf23aa4d43a46785324ee212e (patch)
tree14f9949f7865639b3424864149dfa89d56aedbff /include
parenta2a8f0919d6d000e894f31b8cb416b4fbe17bb07 (diff)
downloadllvm-0750bec272350cbbf23aa4d43a46785324ee212e.tar.gz
llvm-0750bec272350cbbf23aa4d43a46785324ee212e.tar.bz2
llvm-0750bec272350cbbf23aa4d43a46785324ee212e.tar.xz
add a simple reserve method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/SmallVector.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h
index d972ea6e84..e3aec7fec0 100644
--- a/include/llvm/ADT/SmallVector.h
+++ b/include/llvm/ADT/SmallVector.h
@@ -136,6 +136,11 @@ public:
}
}
+ 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.