diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-09 03:05:53 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-09 03:05:53 +0000 |
commit | 4314268128be6d54c9a7f0709680e5a5b40f3ab3 (patch) | |
tree | e9b258ca806b76fbeaa4a614c0f421e0ac26dea7 /lib/CodeGen/MachineBasicBlock.cpp | |
parent | 994c727b5790e5c976e32c75364d78eb9b22a568 (diff) | |
download | llvm-4314268128be6d54c9a7f0709680e5a5b40f3ab3.tar.gz llvm-4314268128be6d54c9a7f0709680e5a5b40f3ab3.tar.bz2 llvm-4314268128be6d54c9a7f0709680e5a5b40f3ab3.tar.xz |
Replace TargetRegisterInfo::printReg with a PrintReg class that also works without a TRI instance.
Print virtual registers numbered from 0 instead of the arbitrary
FirstVirtualRegister. The first virtual register is printed as %vreg0.
TRI::NoRegister is printed as %noreg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | lib/CodeGen/MachineBasicBlock.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 31d12ebdc4..97aee996db 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -166,17 +166,6 @@ void MachineBasicBlock::dump() const { print(dbgs()); } -static inline void OutputReg(raw_ostream &os, unsigned RegNo, - const TargetRegisterInfo *TRI = 0) { - if (RegNo != 0 && TargetRegisterInfo::isPhysicalRegister(RegNo)) { - if (TRI) - os << " %" << TRI->get(RegNo).Name; - else - os << " %physreg" << RegNo; - } else - os << " %reg" << RegNo; -} - StringRef MachineBasicBlock::getName() const { if (const BasicBlock *LBB = getBasicBlock()) return LBB->getName(); @@ -214,7 +203,7 @@ void MachineBasicBlock::print(raw_ostream &OS, SlotIndexes *Indexes) const { if (Indexes) OS << '\t'; OS << " Live Ins:"; for (livein_iterator I = livein_begin(),E = livein_end(); I != E; ++I) - OutputReg(OS, *I, TRI); + OS << PrintReg(*I, TRI); OS << '\n'; } // Print the preds of this block according to the CFG. |