[opaque pointer types] [NFC] Fix fallout from DataLayout::getIndexedOffset changes (rL258478).

llvm-svn: 258481
This commit is contained in:
Eduard Burtescu 2016-01-22 03:43:23 +00:00
parent cc13c2cf47
commit d05b899252
1 changed files with 5 additions and 3 deletions

View File

@ -33,6 +33,7 @@
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/raw_ostream.h"
#include <map>
@ -297,7 +298,8 @@ public:
SmallVector <Value *, 8> indices (op_cursor, op_end);
uint64_t offset = m_target_data.getIndexedOffset(base->getType(), indices);
Type *src_elem_ty = cast<GEPOperator>(constant_expr)->getSourceElementType();
uint64_t offset = m_target_data.getIndexedOffsetInType(src_elem_ty, indices);
const bool is_signed = true;
value += APInt(value.getBitWidth(), offset, is_signed);
@ -999,7 +1001,7 @@ IRInterpreter::Interpret (llvm::Module &module,
}
const Value *pointer_operand = gep_inst->getPointerOperand();
Type *pointer_type = pointer_operand->getType();
Type *src_elem_ty = gep_inst->getSourceElementType();
lldb_private::Scalar P;
@ -1048,7 +1050,7 @@ IRInterpreter::Interpret (llvm::Module &module,
const_indices.push_back(constant_index);
}
uint64_t offset = data_layout.getIndexedOffset(pointer_type, const_indices);
uint64_t offset = data_layout.getIndexedOffsetInType(src_elem_ty, const_indices);
lldb_private::Scalar Poffset = P + offset;