fix a regression with the new instprinter: we lost the ability to

print DBG_VALUE instructions.  This should unbreak the llvm-gcc-powerpc-darwin9
buildbot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119132 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-11-15 07:52:06 +00:00
parent 8ae082bf19
commit f3b6e06679

View File

@ -298,6 +298,28 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
// Lower multi-instruction pseudo operations. // Lower multi-instruction pseudo operations.
switch (MI->getOpcode()) { switch (MI->getOpcode()) {
default: break; default: break;
case TargetOpcode::DBG_VALUE: {
if (!isVerbose() || !OutStreamer.hasRawTextSupport()) return;
SmallString<32> Str;
raw_svector_ostream O(Str);
unsigned NOps = MI->getNumOperands();
assert(NOps==4);
O << '\t' << MAI->getCommentString() << "DEBUG_VALUE: ";
// cast away const; DIetc do not take const operands for some reason.
DIVariable V(const_cast<MDNode *>(MI->getOperand(NOps-1).getMetadata()));
O << V.getName();
O << " <- ";
// Frame address. Currently handles register +- offset only.
assert(MI->getOperand(0).isReg() && MI->getOperand(1).isImm());
O << '['; printOperand(MI, 0, O); O << '+'; printOperand(MI, 1, O);
O << ']';
O << "+";
printOperand(MI, NOps-2, O);
OutStreamer.EmitRawText(O.str());
return;
}
case PPC::MovePCtoLR: case PPC::MovePCtoLR:
case PPC::MovePCtoLR8: { case PPC::MovePCtoLR8: {
// Transform %LR = MovePCtoLR // Transform %LR = MovePCtoLR