eliminate use of TargetData::getIndexedOffset that takes a vector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34163 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2007-02-10 20:35:22 +00:00
parent 309f87e34a
commit 829621c59e
2 changed files with 14 additions and 7 deletions

View File

@ -334,9 +334,10 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
case Instruction::GetElementPtr: {
// Compute the index
Result = getConstantValue(CE->getOperand(0));
std::vector<Value*> Indexes(CE->op_begin()+1, CE->op_end());
SmallVector<Value*, 8> Indices(CE->op_begin()+1, CE->op_end());
uint64_t Offset =
TD->getIndexedOffset(CE->getOperand(0)->getType(), Indexes);
TD->getIndexedOffset(CE->getOperand(0)->getType(),
&Indices[0], Indices.size());
if (getTargetData()->getPointerSize() == 4)
Result.Int32Val += Offset;