diff options
author | Chris Lattner <sabre@nondot.org> | 2001-08-27 15:51:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-08-27 15:51:16 +0000 |
commit | e3860e5be5f3bbbfbe27a097aa38ba21f08e3961 (patch) | |
tree | 06ff2e7583beac887b7c118a5f62ebf98ef9d284 /lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp | |
parent | 3a13c7e56fe7dd722ce8b9be6b4fde7f37569800 (diff) |
Convert to use the new factored out TargetData class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp')
-rw-r--r-- | lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp b/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp index 95cc0ec62b..83962537ce 100644 --- a/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp +++ b/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp @@ -1347,8 +1347,7 @@ SetMemOperands_Internal(MachineInstr* minstr, isConstantOffset = true; // Compute the offset value using the index vector - offset = MemAccessInst::getIndexedOfsetForTarget(ptrType, - idxVec, target); + offset = target.DataLayout.getIndexedOffset(ptrType, idxVec); } else { @@ -1359,13 +1358,12 @@ SetMemOperands_Internal(MachineInstr* minstr, assert(arrayOffsetVal != NULL && "Expect to be given Value* for array offsets"); - if (arrayOffsetVal->getValueType() == Value::ConstantVal) - { + if (ConstPoolVal *CPV = arrayOffsetVal->castConstant()) { isConstantOffset = true; // always constant for structs assert(arrayOffsetVal->getType()->isIntegral()); - offset = (arrayOffsetVal->getType()->isSigned()) - ? ((ConstPoolSInt*) arrayOffsetVal)->getValue() - : (int64_t) ((ConstPoolUInt*) arrayOffsetVal)->getValue(); + offset = (CPV->getType()->isSigned()) + ? ((ConstPoolSInt*)CPV)->getValue() + : (int64_t) ((ConstPoolUInt*)CPV)->getValue(); } else { |