[llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Aug 31 15:35:10 PDT 2005



Changes in directory llvm/lib/CodeGen:

MachineFunction.cpp updated: 1.79 -> 1.80
---
Log message:

If a function has live ins/outs, print them


---
Diffs of the changes:  (+23 -1)

 MachineFunction.cpp |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/MachineFunction.cpp
diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.79 llvm/lib/CodeGen/MachineFunction.cpp:1.80
--- llvm/lib/CodeGen/MachineFunction.cpp:1.79	Fri May 13 17:54:44 2005
+++ llvm/lib/CodeGen/MachineFunction.cpp	Wed Aug 31 17:34:59 2005
@@ -134,7 +134,29 @@
 
   // Print Constant Pool
   getConstantPool()->print(OS);
-
+  
+  const MRegisterInfo *MRI = getTarget().getRegisterInfo();
+  
+  if (livein_begin() != livein_end()) {
+    OS << "Live Ins:";
+    for (livein_iterator I = livein_begin(), E = livein_end(); I != E; ++I) {
+      if (MRI)
+        OS << " " << MRI->getName(I->first);
+      else
+        OS << " Reg #" << I->first;
+    }
+    OS << "\n";
+  }
+  if (liveout_begin() != liveout_end()) {
+    OS << "Live Outs:";
+    for (liveout_iterator I = liveout_begin(), E = liveout_end(); I != E; ++I)
+      if (MRI)
+        OS << " " << MRI->getName(*I);
+      else
+        OS << " Reg #" << *I;
+    OS << "\n";
+  }
+  
   for (const_iterator BB = begin(); BB != end(); ++BB)
     BB->print(OS);
 






More information about the llvm-commits mailing list