Treat MO_REG 0 location as undefined in DEBUG_VALUE,

per document.

llvm-svn: 94693
This commit is contained in:
Dale Johannesen 2010-01-27 22:11:16 +00:00
parent 7e15aefa15
commit 77b108e17b
1 changed files with 8 additions and 2 deletions

View File

@ -428,10 +428,16 @@ void X86AsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
O << V.getName();
O << " <- ";
if (NOps==3) {
// Register or immediate value
// Register or immediate value. Register 0 means undef.
assert(MI->getOperand(0).getType()==MachineOperand::MO_Register ||
MI->getOperand(0).getType()==MachineOperand::MO_Immediate);
printOperand(MI, 0);
if (MI->getOperand(0).getType()==MachineOperand::MO_Register &&
MI->getOperand(0).getReg()==0) {
// Suppress offset in this case, it is not meaningful.
O << "undef";
return;
} else
printOperand(MI, 0);
} else {
// Frame address. Currently handles register +- offset only.
assert(MI->getOperand(0).getType()==MachineOperand::MO_Register);