summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-02-13 02:45:38 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-02-13 02:45:38 +0000
commit61732d994e4a62ac5acf62073ad08f28f6c928ed (patch)
tree01cd970983c5291fd800955bc6b2980fc315eb12
parent73cc50760288f0e663ba1b068cd43886f9bf9d3b (diff)
downloadbcm5719-llvm-61732d994e4a62ac5acf62073ad08f28f6c928ed.tar.gz
bcm5719-llvm-61732d994e4a62ac5acf62073ad08f28f6c928ed.zip
Added debugging routine dumpUses.
llvm-svn: 47042
-rw-r--r--llvm/include/llvm/CodeGen/MachineRegisterInfo.h16
-rw-r--r--llvm/lib/CodeGen/MachineRegisterInfo.cpp8
2 files changed, 18 insertions, 6 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineRegisterInfo.h b/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
index 5b84922b554..453fe2c8343 100644
--- a/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
@@ -110,13 +110,22 @@ public:
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 @@ public:
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
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
index 62c9506050b..b3ee0358bb1 100644
--- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp
+++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
@@ -73,3 +73,11 @@ MachineInstr *MachineRegisterInfo::getVRegDef(unsigned Reg) const {
}
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
OpenPOWER on IntegriCloud