diff options
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r-- | lib/CodeGen/LiveInterval.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index ffa4caa..01298e9 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -20,6 +20,7 @@ #include "LiveInterval.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/Target/MRegisterInfo.h" #include <algorithm> #include <iostream> #include <map> @@ -351,17 +352,22 @@ void LiveRange::dump() const { std::cerr << *this << "\n"; } - -std::ostream& llvm::operator<<(std::ostream& os, const LiveInterval& li) { - os << "%reg" << li.reg << ',' << li.weight; - if (li.empty()) - return os << "EMPTY"; - - os << " = "; - for (LiveInterval::Ranges::const_iterator i = li.ranges.begin(), - e = li.ranges.end(); i != e; ++i) - os << *i; - return os; +void LiveInterval::print(std::ostream &OS, const MRegisterInfo *MRI) const { + if (MRI && MRegisterInfo::isPhysicalRegister(reg)) + OS << MRI->getName(reg); + else + OS << "%reg" << reg; + + OS << ',' << weight; + + if (empty()) + OS << "EMPTY"; + else { + OS << " = "; + for (LiveInterval::Ranges::const_iterator I = ranges.begin(), + E = ranges.end(); I != E; ++I) + OS << *I; + } } void LiveInterval::dump() const { |