Add x86 specific getFrameIndexOffset(). This fixes local variable debugging info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46598 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-01-31 04:06:00 +00:00
parent 72bebb9205
commit c67aa7cbd5
2 changed files with 15 additions and 0 deletions

View File

@ -835,6 +835,20 @@ unsigned X86RegisterInfo::getFrameRegister(MachineFunction &MF) const {
return hasFP(MF) ? FramePtr : StackPtr;
}
int
X86RegisterInfo::getFrameIndexOffset(MachineFunction &MF, unsigned FI) const {
int Offset = MF.getFrameInfo()->getObjectOffset(FI) + SlotSize;
if (!hasFP(MF))
return Offset + MF.getFrameInfo()->getStackSize();
Offset += SlotSize; // Skip the saved EBP
// Skip the RETADDR move area
X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
int TailCallReturnAddrDelta = X86FI->getTCReturnAddrDelta();
if (TailCallReturnAddrDelta < 0) Offset -= TailCallReturnAddrDelta;
return Offset;
}
void X86RegisterInfo::getInitialFrameState(std::vector<MachineMove> &Moves)
const {
// Calculate amount of bytes used for return address storing

View File

@ -122,6 +122,7 @@ public:
// Debug information queries.
unsigned getRARegister() const;
unsigned getFrameRegister(MachineFunction &MF) const;
int getFrameIndexOffset(MachineFunction &MF, unsigned FI) const;
void getInitialFrameState(std::vector<MachineMove> &Moves) const;
// Exception handling queries.