diff options
| author | Jim Grosbach <grosbach@apple.com> | 2009-11-22 20:14:00 +0000 |
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2009-11-22 20:14:00 +0000 |
| commit | bf6d35893fc3521d8dc5f9acdd8d2dee40ff50ca (patch) | |
| tree | 5dbf6beb71548afca5b155e4becc9fb3f51d2987 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
| parent | fd963e11f50456e24b014eb7ecd0ba0674d943b9 (diff) | |
| download | bcm5719-llvm-bf6d35893fc3521d8dc5f9acdd8d2dee40ff50ca.tar.gz bcm5719-llvm-bf6d35893fc3521d8dc5f9acdd8d2dee40ff50ca.zip | |
Add getFrameIndexReference() to TargetRegisterInfo, which allows targets to
tell debug info which base register to use to reference a frame index on a
per-index basis. This is useful, for example, in the presence of dynamic
stack realignment when local variables are indexed via the stack pointer and
stack-based arguments via the frame pointer.
llvm-svn: 89620
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 8d4783be8d3..1241c5ffeb3 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1182,8 +1182,9 @@ DIE *DwarfDebug::createDbgScopeVariable(DbgVariable *DV, CompileUnit *Unit) { // Variables for abstract instances of inlined functions don't get a // location. MachineLocation Location; - Location.set(RI->getFrameRegister(*MF), - RI->getFrameIndexOffset(*MF, DV->getFrameIndex())); + unsigned FrameReg; + int Offset = RI->getFrameIndexReference(*MF, DV->getFrameIndex(), FrameReg); + Location.set(FrameReg, Offset); if (VD.hasComplexAddress()) @@ -1465,9 +1466,9 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, // Add variable address. if (!Scope->isAbstractScope()) { MachineLocation Location; - Location.set(RI->getFrameRegister(*MF), - RI->getFrameIndexOffset(*MF, DV->getFrameIndex())); - + unsigned FrameReg; + int Offset = RI->getFrameIndexReference(*MF, DV->getFrameIndex(), FrameReg); + Location.set(FrameReg, Offset); if (VD.hasComplexAddress()) addComplexAddress(DV, VariableDie, dwarf::DW_AT_location, Location); |

