summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRInterpreter.cpp
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2016-01-22 03:43:23 +0000
committerEduard Burtescu <edy.burt@gmail.com>2016-01-22 03:43:23 +0000
commitd05b899252b6108ba73bbd88dbd4f51dc09e5119 (patch)
tree8cfe964455297284a92d129e18a81695d74a1e41 /lldb/source/Expression/IRInterpreter.cpp
parentcc13c2cf4785d1e79896f66eca065953e59f23b4 (diff)
downloadbcm5719-llvm-d05b899252b6108ba73bbd88dbd4f51dc09e5119.tar.gz
bcm5719-llvm-d05b899252b6108ba73bbd88dbd4f51dc09e5119.zip
[opaque pointer types] [NFC] Fix fallout from DataLayout::getIndexedOffset changes (rL258478).
llvm-svn: 258481
Diffstat (limited to 'lldb/source/Expression/IRInterpreter.cpp')
-rw-r--r--lldb/source/Expression/IRInterpreter.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp
index a2b0c5b8685..29c6742fa87 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -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;
OpenPOWER on IntegriCloud