aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp')
-rw-r--r--lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
index 914fec3576..294fdaec25 100644
--- a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
+++ b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
@@ -111,8 +111,8 @@ Value*
FoldGetElemChain(const InstructionNode* getElemInstrNode,
vector<Value*>& chainIdxVec)
{
- MemAccessInst* getElemInst = (MemAccessInst*)
- getElemInstrNode->getInstruction();
+ GetElementPtrInst* getElemInst =
+ cast<GetElementPtrInst>(getElemInstrNode->getInstruction());
// Return NULL if we don't fold any instructions in.
Value* ptrVal = NULL;
@@ -128,9 +128,9 @@ FoldGetElemChain(const InstructionNode* getElemInstrNode,
ptrChild->getOpLabel() == GetElemPtrIdx)
{
// Child is a GetElemPtr instruction
- getElemInst = cast<MemAccessInst>(ptrChild->getValue());
- MemAccessInst::op_iterator OI, firstIdx = getElemInst->idx_begin();
- MemAccessInst::op_iterator lastIdx = getElemInst->idx_end();
+ getElemInst = cast<GetElementPtrInst>(ptrChild->getValue());
+ User::op_iterator OI, firstIdx = getElemInst->idx_begin();
+ User::op_iterator lastIdx = getElemInst->idx_end();
bool allConstantOffsets = true;
// Check that all offsets are constant for this instruction