Changes in directory llvm/lib/CodeGen:
DwarfWriter.cpp updated: 1.71 -> 1.72 --- Log message: Handle callee saved registers in dwarf frame info (lead up to exception handling.) --- Diffs of the changes: (+35 -9) DwarfWriter.cpp | 44 +++++++++++++++++++++++++++++++++++--------- 1 files changed, 35 insertions(+), 9 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.71 llvm/lib/CodeGen/DwarfWriter.cpp:1.72 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.71 Fri Aug 25 14:39:52 2006 +++ llvm/lib/CodeGen/DwarfWriter.cpp Tue Aug 29 11:24:26 2006 @@ -35,7 +35,7 @@ static cl::opt<bool> DwarfVerbose("dwarf-verbose", cl::Hidden, - cl::desc("Add comments to Dwarf directives.")); + cl::desc("Add comments to Dwarf directives.")); namespace llvm { @@ -1946,7 +1946,7 @@ // Advance row if new location. if (BaseLabel && LabelID && BaseLabelID != LabelID) { - EmitULEB128Bytes(DW_CFA_advance_loc4); + EmitInt8(DW_CFA_advance_loc4); EOL("DW_CFA_advance_loc4"); EmitDifference("loc", LabelID, BaseLabel, BaseLabelID); EOL(""); @@ -1955,30 +1955,56 @@ BaseLabel = "loc"; } + int stackGrowth = + Asm->TM.getFrameInfo()->getStackGrowthDirection() == + TargetFrameInfo::StackGrowsUp ? + AddressSize : -AddressSize; + // If advancing cfa. if (Dst.isRegister() && Dst.getRegister() == MachineLocation::VirtualFP) { if (!Src.isRegister()) { if (Src.getRegister() == MachineLocation::VirtualFP) { - EmitULEB128Bytes(DW_CFA_def_cfa_offset); + EmitInt8(DW_CFA_def_cfa_offset); EOL("DW_CFA_def_cfa_offset"); } else { - EmitULEB128Bytes(DW_CFA_def_cfa); + EmitInt8(DW_CFA_def_cfa); EOL("DW_CFA_def_cfa"); EmitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister())); EOL("Register"); } - int stackGrowth = - Asm->TM.getFrameInfo()->getStackGrowthDirection() == - TargetFrameInfo::StackGrowsUp ? - AddressSize : -AddressSize; + int Offset = Src.getOffset() / stackGrowth; - EmitULEB128Bytes(Src.getOffset() / stackGrowth); + EmitULEB128Bytes(Offset); EOL("Offset"); } else { + assert(0 && "Machine move no supported yet."); } } else { + unsigned Reg = RI->getDwarfRegNum(Src.getRegister()); + int Offset = Dst.getOffset() / stackGrowth; + + if (Offset < 0) { + EmitInt8(DW_CFA_offset_extended_sf); + EOL("DW_CFA_offset_extended_sf"); + EmitULEB128Bytes(Reg); + EOL("Reg"); + EmitSLEB128Bytes(Offset); + EOL("Offset"); + } else if (Reg < 64) { + EmitInt8(DW_CFA_offset + Reg); + EOL("DW_CFA_offset + Reg"); + EmitULEB128Bytes(Offset); + EOL("Offset"); + } else { + EmitInt8(DW_CFA_offset_extended); + EOL("DW_CFA_offset_extended"); + EmitULEB128Bytes(Reg); + EOL("Reg"); + EmitULEB128Bytes(Offset); + EOL("Offset"); + } } } } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits