diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-08-22 23:37:24 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-08-22 23:37:24 +0000 |
| commit | 02fe752fbdec8dfe1f2b4968d234402426ddca5e (patch) | |
| tree | 89f86ad25b6ff65200ec2a1eb452df694ba8334a /llvm/lib/Target | |
| parent | dfb3a2cd07da96e9052ddd27bfef0d39b4587682 (diff) | |
| download | bcm5719-llvm-02fe752fbdec8dfe1f2b4968d234402426ddca5e.tar.gz bcm5719-llvm-02fe752fbdec8dfe1f2b4968d234402426ddca5e.zip | |
Eliminated the MemAccessInst class, folding contents into GEP class.
llvm-svn: 3488
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/Sparc/SparcInstrSelection.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/Sparc/SparcInstrSelection.cpp b/llvm/lib/Target/Sparc/SparcInstrSelection.cpp index 2c07df5eabe..8d3c443877a 100644 --- a/llvm/lib/Target/Sparc/SparcInstrSelection.cpp +++ b/llvm/lib/Target/Sparc/SparcInstrSelection.cpp @@ -963,7 +963,8 @@ SetOperandsForMemInstr(vector<MachineInstr*>& mvec, 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 @@ SetOperandsForMemInstr(vector<MachineInstr*>& mvec, : 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 @@ SetMemOperands_Internal(vector<MachineInstr*>& mvec, 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 @@ SetMemOperands_Internal(vector<MachineInstr*>& mvec, // 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()); |

