Eliminated the MemAccessInst class, folding contents into GEP class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3487 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2002-08-22 23:37:20 +00:00
parent d145c2172f
commit cc63f1c674
13 changed files with 114 additions and 184 deletions

View File

@@ -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