[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp
Chris Lattner
sabre at nondot.org
Wed Jan 31 11:56:31 PST 2007
Changes in directory llvm/lib/Bytecode/Reader:
Reader.cpp updated: 1.227 -> 1.228
---
Log message:
eliminate a temporary vector while parsing gep's from bc files.
---
Diffs of the changes: (+6 -3)
Reader.cpp | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.227 llvm/lib/Bytecode/Reader/Reader.cpp:1.228
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.227 Tue Jan 30 22:43:00 2007
+++ llvm/lib/Bytecode/Reader/Reader.cpp Wed Jan 31 13:56:15 2007
@@ -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 @@
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 @@
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
More information about the llvm-commits
mailing list