summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-08-27 15:51:16 +0000
committerChris Lattner <sabre@nondot.org>2001-08-27 15:51:16 +0000
commit6c5cbe3f60f1331bb78842cad7c063d991a1164e (patch)
treee308c50b77e10742c6f442222549deb7036363a9 /llvm/lib/CodeGen
parent8dd99f33ea3ebb35435f69b635e722bf38159807 (diff)
downloadbcm5719-llvm-6c5cbe3f60f1331bb78842cad7c063d991a1164e.tar.gz
bcm5719-llvm-6c5cbe3f60f1331bb78842cad7c063d991a1164e.zip
Convert to use the new factored out TargetData class
llvm-svn: 381
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/TargetMachine/Sparc/Sparc.cpp13
-rw-r--r--llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp12
2 files changed, 7 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/TargetMachine/Sparc/Sparc.cpp b/llvm/lib/CodeGen/TargetMachine/Sparc/Sparc.cpp
index a9ea1da02cc..4707b373b95 100644
--- a/llvm/lib/CodeGen/TargetMachine/Sparc/Sparc.cpp
+++ b/llvm/lib/CodeGen/TargetMachine/Sparc/Sparc.cpp
@@ -27,23 +27,14 @@
//---------------------------------------------------------------------------
UltraSparc::UltraSparc()
- : TargetMachine(new UltraSparcInstrInfo)
-{
+ : TargetMachine("UltraSparc-Native", new UltraSparcInstrInfo()) {
optSizeForSubWordData = 4;
- intSize = 4;
- floatSize = 4;
- longSize = 8;
- doubleSize = 8;
- longDoubleSize = 16;
- pointerSize = 8;
minMemOpWordSize = 8;
maxAtomicMemOpWordSize = 8;
zeroRegNum = 0; // %g0 always gives 0 on Sparc
}
-UltraSparc::~UltraSparc()
-{
- delete (UltraSparcInstrInfo*) machineInstrInfo;
+UltraSparc::~UltraSparc() {
}
//**************************************************************************/
diff --git a/llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp b/llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp
index 95cc0ec62be..83962537ce8 100644
--- a/llvm/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp
+++ b/llvm/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
{
OpenPOWER on IntegriCloud