DEBUG_VALUE is now variable sized, as it has a

target-dependent memory address representation in it.
Restore X86 printing of DEBUG_VALUE; lowering is
done in X86RegisterInfo using the normal algorithm.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93565 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen 2010-01-15 22:22:35 +00:00
parent 98793b9468
commit 23cdb0bdcf
2 changed files with 25 additions and 1 deletions

View File

@ -479,7 +479,7 @@ def COPY_TO_REGCLASS : Instruction {
}
def DEBUG_VALUE : Instruction {
let OutOperandList = (ops);
let InOperandList = (ops unknown:$value, i64imm:$offset, unknown:$meta);
let InOperandList = (ops variable_ops);
let AsmString = "DEBUG_VALUE";
let Namespace = "TargetInstrInfo";
let isAsCheapAsAMove = 1;

View File

@ -25,6 +25,7 @@
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Mangler.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Analysis/DebugInfo.h"
using namespace llvm;
@ -420,6 +421,29 @@ void X86AsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
case TargetInstrInfo::GC_LABEL:
printLabel(MI);
return;
case TargetInstrInfo::DEBUG_VALUE: {
if (!VerboseAsm)
return;
O << '\t' << MAI->getCommentString() << "DEBUG_VALUE: ";
unsigned NOps = MI->getNumOperands();
// cast away const; DIetc do not take const operands for some reason
DIVariable V((MDNode*)(MI->getOperand(NOps-1).getMetadata()));
O << V.getName();
O << " <- ";
if (NOps==3) {
// Variable is in register
assert(MI->getOperand(0).getType()==MachineOperand::MO_Register);
printOperand(MI, 0);
} else {
// Frame address. Currently handles ESP or ESP + offset only
assert(MI->getOperand(0).getType()==MachineOperand::MO_Register);
assert(MI->getOperand(3).getType()==MachineOperand::MO_Immediate);
O << '['; printOperand(MI, 0); O << '+'; printOperand(MI, 3); O << ']';
}
O << "+";
printOperand(MI, NOps-2);
return;
}
case TargetInstrInfo::INLINEASM:
printInlineAsm(MI);
return;