Move more to raw_ostream, provide support for writing MachineBasicBlock,

LiveInterval, etc to raw_ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76965 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar
2009-07-24 10:36:58 +00:00
parent b95c2fd270
commit 1cd1d98232
8 changed files with 67 additions and 8 deletions

View File

@ -24,6 +24,7 @@
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Streams.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include <algorithm>
#include <ostream>
@ -819,6 +820,9 @@ void LiveInterval::ComputeJoinedWeight(const LiveInterval &Other) {
std::ostream& llvm::operator<<(std::ostream& os, const LiveRange &LR) {
return os << '[' << LR.start << ',' << LR.end << ':' << LR.valno->id << ")";
}
raw_ostream& llvm::operator<<(raw_ostream& os, const LiveRange &LR) {
return os << '[' << LR.start << ',' << LR.end << ':' << LR.valno->id << ")";
}
void LiveRange::dump() const {
cerr << *this << "\n";
@ -826,6 +830,12 @@ void LiveRange::dump() const {
void LiveInterval::print(std::ostream &OS,
const TargetRegisterInfo *TRI) const {
raw_os_ostream RawOS(OS);
print(RawOS, TRI);
}
void LiveInterval::print(raw_ostream &OS,
const TargetRegisterInfo *TRI) const {
if (isStackSlot())
OS << "SS#" << getStackSlotIndex();
else if (TRI && TargetRegisterInfo::isPhysicalRegister(reg))
@ -890,3 +900,6 @@ void LiveInterval::dump() const {
void LiveRange::print(std::ostream &os) const {
os << *this;
}
void LiveRange::print(raw_ostream &os) const {
os << *this;
}