mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Print the symbolic register name in a register allocator debug dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22002 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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";
|
||||
}
|
||||
|
||||
void LiveInterval::print(std::ostream &OS, const MRegisterInfo *MRI) const {
|
||||
if (MRI && MRegisterInfo::isPhysicalRegister(reg))
|
||||
OS << MRI->getName(reg);
|
||||
else
|
||||
OS << "%reg" << reg;
|
||||
|
||||
std::ostream& llvm::operator<<(std::ostream& os, const LiveInterval& li) {
|
||||
os << "%reg" << li.reg << ',' << li.weight;
|
||||
if (li.empty())
|
||||
return os << "EMPTY";
|
||||
OS << ',' << weight;
|
||||
|
||||
os << " = ";
|
||||
for (LiveInterval::Ranges::const_iterator i = li.ranges.begin(),
|
||||
e = li.ranges.end(); i != e; ++i)
|
||||
os << *i;
|
||||
return os;
|
||||
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 {
|
||||
|
Reference in New Issue
Block a user