Use the PrintReg adaptor to correctly print live-in registers in debug output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130715 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2011-05-02 20:06:30 +00:00
parent 2048e4ab7f
commit e2f669fb3f

View File

@ -300,31 +300,19 @@ void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const {
OS << "Function Live Ins: ";
for (MachineRegisterInfo::livein_iterator
I = RegInfo->livein_begin(), E = RegInfo->livein_end(); I != E; ++I) {
if (TRI)
OS << "%" << TRI->getName(I->first);
else
OS << " %physreg" << I->first;
OS << PrintReg(I->first, TRI);
if (I->second)
OS << " in reg%" << I->second;
OS << " in " << PrintReg(I->second, TRI);
if (llvm::next(I) != E)
OS << ", ";
}
OS << '\n';
}
if (RegInfo && !RegInfo->liveout_empty()) {
OS << "Function Live Outs: ";
OS << "Function Live Outs:";
for (MachineRegisterInfo::liveout_iterator
I = RegInfo->liveout_begin(), E = RegInfo->liveout_end(); I != E; ++I){
if (TRI)
OS << '%' << TRI->getName(*I);
else
OS << "%physreg" << *I;
if (llvm::next(I) != E)
OS << " ";
}
I = RegInfo->liveout_begin(), E = RegInfo->liveout_end(); I != E; ++I)
OS << ' ' << PrintReg(*I, TRI);
OS << '\n';
}