summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-31 19:56:15 +0000
committerChris Lattner <sabre@nondot.org>2007-01-31 19:56:15 +0000
commit3aefeb957b6b25ce62c50c508e3ae8c906bcfa04 (patch)
treeb28224b353d5d6352b3dc9ae36480e9d3b7f20d2 /llvm/lib/Bytecode/Reader/Reader.cpp
parent37ebf9317b1730667b60a976eff6411c5248cfbb (diff)
downloadbcm5719-llvm-3aefeb957b6b25ce62c50c508e3ae8c906bcfa04.tar.gz
bcm5719-llvm-3aefeb957b6b25ce62c50c508e3ae8c906bcfa04.zip
eliminate a temporary vector while parsing gep's from bc files.
llvm-svn: 33710
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index 3c72d639e03..c649a3b19cc 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/lib/Bytecode/Reader/Reader.cpp
@@ -30,6 +30,7 @@
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/Compressor.h"
#include "llvm/Support/MathExtras.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include <sstream>
#include <algorithm>
@@ -799,7 +800,7 @@ void BytecodeReader::ParseInstruction(std::vector<unsigned> &Oprnds,
if (Oprnds.size() == 0 || !isa<PointerType>(InstTy))
error("Invalid getelementptr instruction!");
- std::vector<Value*> Idx;
+ SmallVector<Value*, 8> Idx;
const Type *NextTy = InstTy;
for (unsigned i = 1, e = Oprnds.size(); i != e; ++i) {
@@ -823,10 +824,12 @@ void BytecodeReader::ParseInstruction(std::vector<unsigned> &Oprnds,
ValIdx >>= 1;
}
Idx.push_back(getValue(IdxTy, ValIdx));
- NextTy = GetElementPtrInst::getIndexedType(InstTy, Idx, true);
+ NextTy = GetElementPtrInst::getIndexedType(InstTy, &Idx[0], Idx.size(),
+ true);
}
- Result = new GetElementPtrInst(getValue(iType, Oprnds[0]), Idx);
+ Result = new GetElementPtrInst(getValue(iType, Oprnds[0]),
+ &Idx[0], Idx.size());
break;
}
case 62: // volatile load
OpenPOWER on IntegriCloud