summaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-01-15 22:22:35 +0000
committerDale Johannesen <dalej@apple.com>2010-01-15 22:22:35 +0000
commit06f482e62dcbc1bdc595c9c06700f2286ca8ed6c (patch)
tree6e1570b0dcf8262a32332b7324bf5e326a5a7445 /lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
parent45c45c8f43de3a269381f4e155e428abce7e4488 (diff)
downloadexternal_llvm-06f482e62dcbc1bdc595c9c06700f2286ca8ed6c.zip
external_llvm-06f482e62dcbc1bdc595c9c06700f2286ca8ed6c.tar.gz
external_llvm-06f482e62dcbc1bdc595c9c06700f2286ca8ed6c.tar.bz2
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
Diffstat (limited to 'lib/Target/X86/AsmPrinter/X86MCInstLower.cpp')
-rw-r--r--lib/Target/X86/AsmPrinter/X86MCInstLower.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
index a4939af..931d662 100644
--- a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
+++ b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
@@ -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;