diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-02-13 02:45:38 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-02-13 02:45:38 +0000 |
commit | 92702b9b3a739cc844fc42b305f72b06e69eb27d (patch) | |
tree | 94f1c85489d9d7de41d803ed1f64682430a1dc2f | |
parent | 229fa05f26826290b9d128e7f6ffbc4889478c25 (diff) | |
download | external_llvm-92702b9b3a739cc844fc42b305f72b06e69eb27d.zip external_llvm-92702b9b3a739cc844fc42b305f72b06e69eb27d.tar.gz external_llvm-92702b9b3a739cc844fc42b305f72b06e69eb27d.tar.bz2 |
Added debugging routine dumpUses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47042 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/MachineRegisterInfo.h | 16 | ||||
-rw-r--r-- | lib/CodeGen/MachineRegisterInfo.cpp | 8 |
2 files changed, 18 insertions, 6 deletions
diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h index 5b84922..453fe2c 100644 --- a/include/llvm/CodeGen/MachineRegisterInfo.h +++ b/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/lib/CodeGen/MachineRegisterInfo.cpp b/lib/CodeGen/MachineRegisterInfo.cpp index 62c9506..b3ee035 100644 --- a/lib/CodeGen/MachineRegisterInfo.cpp +++ b/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 |