Author: evancheng
Date: Tue Feb 12 20:45:38 2008
New Revision: 47042

URL: http://llvm.org/viewvc/llvm-project?rev=47042&view=rev
Log:
Added debugging routine dumpUses.

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h
    llvm/trunk/lib/CodeGen/MachineRegisterInfo.cpp

Modified: llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h?rev=47042&r1=47041&r2=47042&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h Tue Feb 12 20:45:38 
2008
@@ -110,13 +110,22 @@
     RegNo -= TargetRegisterInfo::FirstVirtualRegister;
     return VRegInfo[RegNo].second;
   }
+
+  /// getVRegDef - Return the machine instr that defines the specified virtual
+  /// register or null if none is found.  This assumes that the code is in SSA
+  /// form, so there should only be one definition.
+  MachineInstr *getVRegDef(unsigned Reg) const;
+  
+#ifndef NDEBUG
+  void dumpUses(unsigned RegNo) const;
+#endif
   
   
//===--------------------------------------------------------------------===//
   // Virtual Register Info
   
//===--------------------------------------------------------------------===//
   
   /// getRegClass - Return the register class of the specified virtual 
register.
-  const TargetRegisterClass *getRegClass(unsigned Reg) {
+  const TargetRegisterClass *getRegClass(unsigned Reg) const {
     Reg -= TargetRegisterInfo::FirstVirtualRegister;
     assert(Reg < VRegInfo.size() && "Invalid vreg!");
     return VRegInfo[Reg].first;
@@ -145,11 +154,6 @@
     return VRegInfo.size()+TargetRegisterInfo::FirstVirtualRegister-1;
   }
   
-  /// getVRegDef - Return the machine instr that defines the specified virtual
-  /// register or null if none is found.  This assumes that the code is in SSA
-  /// form, so there should only be one definition.
-  MachineInstr *getVRegDef(unsigned Reg) const;
-  
   
   
//===--------------------------------------------------------------------===//
   // Physical Register Use Info

Modified: llvm/trunk/lib/CodeGen/MachineRegisterInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineRegisterInfo.cpp?rev=47042&r1=47041&r2=47042&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineRegisterInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineRegisterInfo.cpp Tue Feb 12 20:45:38 2008
@@ -73,3 +73,11 @@
   }
   return 0;
 }
+
+
+#ifndef NDEBUG
+void MachineRegisterInfo::dumpUses(unsigned Reg) const {
+  for (use_iterator I = use_begin(Reg), E = use_end(); I != E; ++I)
+    I.getOperand().getParent()->dump();
+}
+#endif


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to