[Lldb-commits] [lldb] r258481 - [opaque pointer types] [NFC] Fix fallout from DataLayout::getIndexedOffset changes (rL258478).
Eduard Burtescu via lldb-commits
lldb-commits at lists.llvm.org
Thu Jan 21 19:43:24 PST 2016
Author: eddyb
Date: Thu Jan 21 21:43:23 2016
New Revision: 258481
URL: http://llvm.org/viewvc/llvm-project?rev=258481&view=rev
Log:
[opaque pointer types] [NFC] Fix fallout from DataLayout::getIndexedOffset changes (rL258478).
Modified:
lldb/trunk/source/Expression/IRInterpreter.cpp
Modified: lldb/trunk/source/Expression/IRInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRInterpreter.cpp?rev=258481&r1=258480&r2=258481&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRInterpreter.cpp (original)
+++ lldb/trunk/source/Expression/IRInterpreter.cpp Thu Jan 21 21:43:23 2016
@@ -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 &
}
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 &
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;
More information about the lldb-commits
mailing list