[llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp
Jim Laskey
jlaskey at apple.com
Fri Aug 25 12:40:06 PDT 2006
Changes in directory llvm/lib/CodeGen:
DwarfWriter.cpp updated: 1.70 -> 1.71
---
Log message:
Allow for register numbers > 31.
---
Diffs of the changes: (+14 -4)
DwarfWriter.cpp | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.70 llvm/lib/CodeGen/DwarfWriter.cpp:1.71
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.70 Mon Aug 21 16:20:18 2006
+++ llvm/lib/CodeGen/DwarfWriter.cpp Fri Aug 25 14:39:52 2006
@@ -1219,12 +1219,22 @@
void DwarfWriter::AddAddress(DIE *Die, unsigned Attribute,
const MachineLocation &Location) {
DIEBlock *Block = new DIEBlock();
+ unsigned Reg = RI->getDwarfRegNum(Location.getRegister());
+
if (Location.isRegister()) {
- Block->AddUInt(DW_FORM_data1,
- DW_OP_reg0 + RI->getDwarfRegNum(Location.getRegister()));
+ if (Reg < 32) {
+ Block->AddUInt(DW_FORM_data1, DW_OP_reg0 + Reg);
+ } else {
+ Block->AddUInt(DW_FORM_data1, DW_OP_regx);
+ Block->AddUInt(DW_FORM_udata, Reg);
+ }
} else {
- Block->AddUInt(DW_FORM_data1,
- DW_OP_breg0 + RI->getDwarfRegNum(Location.getRegister()));
+ if (Reg < 32) {
+ Block->AddUInt(DW_FORM_data1, DW_OP_breg0 + Reg);
+ } else {
+ Block->AddUInt(DW_FORM_data1, DW_OP_bregx);
+ Block->AddUInt(DW_FORM_udata, Reg);
+ }
Block->AddUInt(DW_FORM_sdata, Location.getOffset());
}
Block->ComputeSize(*this);
More information about the llvm-commits
mailing list