From: Jim Laskey Date: Fri, 25 Aug 2006 19:39:52 +0000 (+0000) Subject: Allow for register numbers > 31. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3d3d404b8a22c9e105bdc54bef24fb1dd7c5ad87;p=oota-llvm.git Allow for register numbers > 31. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29879 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index e4f4001df93..54942b8098e 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -1219,12 +1219,22 @@ void DwarfWriter::AddSourceLine(DIE *Die, CompileUnitDesc *File, unsigned Line){ 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);