forked from OSchip/llvm-project
Add x86 specific getFrameIndexOffset(). This fixes local variable debugging info.
llvm-svn: 46598
This commit is contained in:
parent
a41d3bcb12
commit
6332dbec69
|
@ -835,6 +835,20 @@ unsigned X86RegisterInfo::getFrameRegister(MachineFunction &MF) const {
|
||||||
return hasFP(MF) ? FramePtr : StackPtr;
|
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)
|
void X86RegisterInfo::getInitialFrameState(std::vector<MachineMove> &Moves)
|
||||||
const {
|
const {
|
||||||
// Calculate amount of bytes used for return address storing
|
// Calculate amount of bytes used for return address storing
|
||||||
|
|
|
@ -122,6 +122,7 @@ public:
|
||||||
// Debug information queries.
|
// Debug information queries.
|
||||||
unsigned getRARegister() const;
|
unsigned getRARegister() const;
|
||||||
unsigned getFrameRegister(MachineFunction &MF) const;
|
unsigned getFrameRegister(MachineFunction &MF) const;
|
||||||
|
int getFrameIndexOffset(MachineFunction &MF, unsigned FI) const;
|
||||||
void getInitialFrameState(std::vector<MachineMove> &Moves) const;
|
void getInitialFrameState(std::vector<MachineMove> &Moves) const;
|
||||||
|
|
||||||
// Exception handling queries.
|
// Exception handling queries.
|
||||||
|
|
Loading…
Reference in New Issue