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 | a2f20b20a8dc7f053599840557405554a0848aec (patch) | |
tree | bfc706ed738609b2a1e005312cd04306d543cc39 /lib/CodeGen | |
parent | a37aa546224ec03ba1f1a1598e0781af4b692673 (diff) | |
download | external_llvm-a2f20b20a8dc7f053599840557405554a0848aec.zip external_llvm-a2f20b20a8dc7f053599840557405554a0848aec.tar.gz external_llvm-a2f20b20a8dc7f053599840557405554a0848aec.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89620 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 8d4783b..1241c5f 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/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); |