From 418d1d1ea912eadd5c119a98ec5735c36a9e0221 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 9 Jul 2013 20:28:37 +0000 Subject: Reapply an improved version of r180816/180817. Change the informal convention of DBG_VALUE machine instructions so that we can express a register-indirect address with an offset of 0. The old convention was that a DBG_VALUE is a register-indirect value if the offset (operand 1) is nonzero. The new convention is that a DBG_VALUE is register-indirect if the first operand is a register and the second operand is an immediate. For plain register values the combination reg, reg is used. MachineInstrBuilder::BuildMI knows how to build the new DBG_VALUES. rdar://problem/13658587 llvm-svn: 185966 --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index ec7c5bfa4ea..3e6db1cc50a 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -1563,8 +1563,9 @@ DIE *CompileUnit::constructVariableDIE(DbgVariable *DV, assert(DVInsn->getNumOperands() == 3); if (DVInsn->getOperand(0).isReg()) { const MachineOperand RegOp = DVInsn->getOperand(0); - if (int64_t Offset = DVInsn->getOperand(1).getImm()) { - MachineLocation Location(RegOp.getReg(), Offset); + // If the second operand is an immedieate, this is an indirect value. + if (DVInsn->getOperand(1).isImm()) { + MachineLocation Location(RegOp.getReg(), DVInsn->getOperand(1).getImm()); addVariableAddress(*DV, VariableDie, Location); } else if (RegOp.getReg()) addVariableAddress(*DV, VariableDie, MachineLocation(RegOp.getReg())); -- cgit v1.2.3