If a function has live ins/outs, print them
authorChris Lattner <sabre@nondot.org>
Wed, 31 Aug 2005 22:34:59 +0000 (22:34 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 31 Aug 2005 22:34:59 +0000 (22:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23181 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineFunction.cpp

index aa3226bbf22a9e0fd2da091e965f66a6d5b5009b..2e3088c7e3b1ac9adacc799390632e289d4ef927 100644 (file)
@@ -134,7 +134,29 @@ void MachineFunction::print(std::ostream &OS) const {
 
   // 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);