Stop using CreateStackObject(RegClass*)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15775 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-08-15 22:02:22 +00:00
parent 57f1b67c34
commit 26eb14ba51
5 changed files with 8 additions and 9 deletions

View File

@ -261,10 +261,6 @@ int MachineFrameInfo::CreateStackObject(const Type *Ty, const TargetData &TD) {
return CreateStackObject(TD.getTypeSize(Ty), TD.getTypeAlignment(Ty)); return CreateStackObject(TD.getTypeSize(Ty), TD.getTypeAlignment(Ty));
} }
int MachineFrameInfo::CreateStackObject(const TargetRegisterClass *RC) {
return CreateStackObject(RC->getSize(), RC->getAlignment());
}
void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{ void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
int ValOffset = MF.getTarget().getFrameInfo()->getOffsetOfLocalArea(); int ValOffset = MF.getTarget().getFrameInfo()->getOffsetOfLocalArea();

View File

@ -182,7 +182,7 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) { if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) {
// Nope, just spill it anywhere convenient. // Nope, just spill it anywhere convenient.
FrameIdx = FFI->CreateStackObject(RC); FrameIdx = FFI->CreateStackObject(RC->getSize(), RC->getAlignment());
} else { } else {
// Spill it to the stack where we must. // Spill it to the stack where we must.
FrameIdx = FFI->CreateFixedObject(RC->getSize(), FixedSlot->second); FrameIdx = FFI->CreateFixedObject(RC->getSize(), FixedSlot->second);

View File

@ -225,7 +225,8 @@ int RA::getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC) {
return I->second; // Already has space allocated? return I->second; // Already has space allocated?
// Allocate a new stack object for this spill location... // Allocate a new stack object for this spill location...
int FrameIdx = MF->getFrameInfo()->CreateStackObject(RC); int FrameIdx = MF->getFrameInfo()->CreateStackObject(RC->getSize(),
RC->getAlignment());
// Assign the slot... // Assign the slot...
StackSlotForVirtReg.insert(I, std::make_pair(VirtReg, FrameIdx)); StackSlotForVirtReg.insert(I, std::make_pair(VirtReg, FrameIdx));

View File

@ -99,7 +99,8 @@ int RegAllocSimple::getStackSpaceFor(unsigned VirtReg,
return I->second; // Already has space allocated? return I->second; // Already has space allocated?
// Allocate a new stack object for this spill location... // Allocate a new stack object for this spill location...
int FrameIdx = MF->getFrameInfo()->CreateStackObject(RC); int FrameIdx = MF->getFrameInfo()->CreateStackObject(RC->getSize(),
RC->getAlignment());
// Assign the slot... // Assign the slot...
StackSlotForVirtReg.insert(I, std::make_pair(VirtReg, FrameIdx)); StackSlotForVirtReg.insert(I, std::make_pair(VirtReg, FrameIdx));

View File

@ -52,9 +52,10 @@ int VirtRegMap::assignVirt2StackSlot(unsigned virtReg)
assert(MRegisterInfo::isVirtualRegister(virtReg)); assert(MRegisterInfo::isVirtualRegister(virtReg));
assert(v2ssMap_[virtReg] == NO_STACK_SLOT && assert(v2ssMap_[virtReg] == NO_STACK_SLOT &&
"attempt to assign stack slot to already spilled register"); "attempt to assign stack slot to already spilled register");
const TargetRegisterClass* rc = const TargetRegisterClass* RC =
mf_->getSSARegMap()->getRegClass(virtReg); mf_->getSSARegMap()->getRegClass(virtReg);
int frameIndex = mf_->getFrameInfo()->CreateStackObject(rc); int frameIndex = mf_->getFrameInfo()->CreateStackObject(RC->getSize(),
RC->getAlignment());
v2ssMap_[virtReg] = frameIndex; v2ssMap_[virtReg] = frameIndex;
++numSpills; ++numSpills;
return frameIndex; return frameIndex;