Eliminated the MemAccessInst class, folding contents into GEP class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3488 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index 2c07df5..8d3c4438 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -963,7 +963,8 @@
const InstructionNode* vmInstrNode,
const TargetMachine& target)
{
- MemAccessInst* memInst = (MemAccessInst*) vmInstrNode->getInstruction();
+ GetElementPtrInst* memInst =
+ cast<GetElementPtrInst>(vmInstrNode->getInstruction());
// Variables to hold the index vector and ptr value.
// The major work here is to extract these for all 3 instruction types
@@ -982,7 +983,7 @@
: vmInstrNode->leftChild());
// Check if all indices are constant for this instruction
- for (MemAccessInst::op_iterator OI=memInst->idx_begin(),OE=memInst->idx_end();
+ for (User::op_iterator OI=memInst->idx_begin(),OE=memInst->idx_end();
allConstantIndices && OI != OE; ++OI)
if (! isa<Constant>(*OI))
allConstantIndices = false;
@@ -1024,7 +1025,8 @@
bool allConstantIndices,
const TargetMachine& target)
{
- MemAccessInst* memInst = (MemAccessInst*) vmInstrNode->getInstruction();
+ GetElementPtrInst* memInst =
+ cast<GetElementPtrInst>(vmInstrNode->getInstruction());
// Initialize so we default to storing the offset in a register.
int64_t smallConstOffset = 0;
@@ -1035,7 +1037,7 @@
// Check if there is an index vector and if so, compute the
// right offset for structures and for arrays
//
- if (idxVec.size() > 0)
+ if (!idxVec.empty())
{
const PointerType* ptrType = cast<PointerType>(ptrVal->getType());