aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-06-26 04:47:41 +0000
committerOwen Anderson <resistor@mac.com>2008-06-26 04:47:41 +0000
commitaefacb597298b31f8459970e1b13ef985bfc7a2b (patch)
tree06228d579a3ccba285debc3b0d22b02beb3ea9d5 /lib
parent4e97790682518bf332436310f76b5abf1e38c822 (diff)
downloadexternal_llvm-aefacb597298b31f8459970e1b13ef985bfc7a2b.zip
external_llvm-aefacb597298b31f8459970e1b13ef985bfc7a2b.tar.gz
external_llvm-aefacb597298b31f8459970e1b13ef985bfc7a2b.tar.bz2
Reserve the size we'll need in advance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52763 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ValueTracking.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp
index 3c4e6bc..39a91df 100644
--- a/lib/Analysis/ValueTracking.cpp
+++ b/lib/Analysis/ValueTracking.cpp
@@ -1004,6 +1004,7 @@ bool llvm::GetConstantStringInfo(Value *V, std::string &Str) {
// Traverse the constant array from StartIdx (derived above) which is
// the place the GEP refers to in the array.
+ Str.reserve(NumElts);
for (unsigned i = StartIdx; i < NumElts; ++i) {
Constant *Elt = Array->getOperand(i);
ConstantInt *CI = dyn_cast<ConstantInt>(Elt);