//---------------------------------------------------------------------------
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() {
}
//**************************************************************************/
isConstantOffset = true;
// Compute the offset value using the index vector
- offset = MemAccessInst::getIndexedOfsetForTarget(ptrType,
- idxVec, target);
+ offset = target.DataLayout.getIndexedOffset(ptrType, idxVec);
}
else
{
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
{