1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00

Allow for register numbers > 31.

llvm-svn: 29879
This commit is contained in:
Jim Laskey 2006-08-25 19:39:52 +00:00
parent 39c3b906cb
commit 7369725a36

View File

@ -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);