[llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Dec 13 04:00:02 PST 2002


Changes in directory llvm/lib/Target/X86:

Printer.cpp updated: 1.26 -> 1.27

---
Log message:

Print X86 PHI nodes in a sane manner


---
Diffs of the changes:

Index: llvm/lib/Target/X86/Printer.cpp
diff -u llvm/lib/Target/X86/Printer.cpp:1.26 llvm/lib/Target/X86/Printer.cpp:1.27
--- llvm/lib/Target/X86/Printer.cpp:1.26	Fri Dec 13 01:56:18 2002
+++ llvm/lib/Target/X86/Printer.cpp	Fri Dec 13 03:59:26 2002
@@ -167,6 +167,22 @@
   unsigned Opcode = MI->getOpcode();
   const MachineInstrDescriptor &Desc = get(Opcode);
 
+  if (Opcode == X86::PHI) {
+    printOp(O, MI->getOperand(0), RI);
+    O << " = phi ";
+    for (unsigned i = 1, e = MI->getNumOperands(); i != e; i+=2) {
+      if (i != 1) O << ", ";
+      O << "[";
+      printOp(O, MI->getOperand(i), RI);
+      O << ", ";
+      printOp(O, MI->getOperand(i+1), RI);
+      O << "]";
+    }
+    O << "\n";
+    return;
+  }
+
+
   switch (Desc.TSFlags & X86II::FormMask) {
   case X86II::RawFrm:
     // The accepted forms of Raw instructions are:





More information about the llvm-commits mailing list