From a6d8c3f8456e05b3bf0b42aa8050912ce7e92c07 Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Fri, 16 Jan 2004 20:29:42 +0000 Subject: [PATCH] Handle printing of intervals that are not assign to any physical register yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10895 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/RegAllocLinearScan.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index abd13900931..8712e98d850 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -161,21 +161,22 @@ namespace { } std::cerr << '\n'; } + void printIntervals(const char* const str, RA::IntervalPtrs::const_iterator i, RA::IntervalPtrs::const_iterator e) const { if (str) std::cerr << str << " intervals:\n"; for (; i != e; ++i) { std::cerr << "\t\t" << **i << " -> "; - if ((*i)->reg < MRegisterInfo::FirstVirtualRegister) { - std::cerr << mri_->getName((*i)->reg); + unsigned reg = (*i)->reg; + if (reg >= MRegisterInfo::FirstVirtualRegister) { + Virt2PhysMap::const_iterator it = v2pMap_.find(reg); + reg = (it == v2pMap_.end() ? 0 : it->second); } - else { - std::cerr << mri_->getName(v2pMap_.find((*i)->reg)->second); - } - std::cerr << '\n'; + std::cerr << mri_->getName((*i)->reg) << '\n'; } } + void printFreeRegs(const char* const str, const TargetRegisterClass* rc) const { if (str) std::cerr << str << ':';