git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29888 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Laskey 2006-08-25 22:56:30 +00:00
parent 203572552d
commit 08ede262a7
2 changed files with 14 additions and 4 deletions

View File

@ -134,7 +134,7 @@ class MachineFrameInfo {
unsigned MaxCallFrameSize;
/// CSInfo - The prolog/epilog code inserter fills in this vector with each
/// callee saved register saved in the frame. Beyond it's use by the prolog/
/// callee saved register saved in the frame. Beyond its use by the prolog/
/// epilog code inserter, this data used for debug info and exception
/// handling.
std::vector<CalleeSavedInfo> CSInfo;
@ -273,7 +273,15 @@ public:
/// getCalleeSavedInfo - Returns a reference to call saved info vector for the
/// current function.
std::vector<CalleeSavedInfo> &getCalleeSavedInfo() { return CSInfo; }
const std::vector<CalleeSavedInfo> &getCalleeSavedInfo() const {
return CSInfo;
}
/// setCalleeSavedInfo - Used by prolog/epilog inserter to set the function's
/// callee saved information.
void setCalleeSavedInfo(const std::vector<CalleeSavedInfo> &CSI) {
CSInfo = CSI;
}
/// getMachineDebugInfo - Used by a prologue/epilogue emitter (MRegisterInfo)
/// to provide frame layout information.

View File

@ -139,7 +139,7 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
const bool *PhysRegsUsed = Fn.getUsedPhysregs();
const TargetRegisterClass* const *CSRegClasses =
RegInfo->getCalleeSaveRegClasses();
std::vector<CalleeSavedInfo> &CSI = FFI->getCalleeSavedInfo();
std::vector<CalleeSavedInfo> CSI;
for (unsigned i = 0; CSRegs[i]; ++i) {
unsigned Reg = CSRegs[i];
if (PhysRegsUsed[Reg]) {
@ -186,6 +186,8 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
}
CSI[i].setFrameIdx(FrameIdx);
}
FFI->setCalleeSavedInfo(CSI);
}
/// saveCallerSavedRegisters - Insert spill code for any caller saved registers
@ -194,7 +196,7 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
// Get callee saved register information.
MachineFrameInfo *FFI = Fn.getFrameInfo();
std::vector<CalleeSavedInfo> &CSI = FFI->getCalleeSavedInfo();
const std::vector<CalleeSavedInfo> &CSI = FFI->getCalleeSavedInfo();
// Early exit if no caller saved registers are modified!
if (CSI.empty())