aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-23 03:41:05 +0000
committerChris Lattner <sabre@nondot.org>2009-08-23 03:41:05 +0000
commit705e07f578e2b3af47ddab610feb4e7f2d3063a5 (patch)
treee2ef9be09156e5f94f26d20ffd1dde66e40276ee /lib/CodeGen
parent6456d3868d63a093b70ad522951f94b138389690 (diff)
downloadexternal_llvm-705e07f578e2b3af47ddab610feb4e7f2d3063a5.zip
external_llvm-705e07f578e2b3af47ddab610feb4e7f2d3063a5.tar.gz
external_llvm-705e07f578e2b3af47ddab610feb4e7f2d3063a5.tar.bz2
remove various std::ostream version of printing methods from
MachineInstr and MachineOperand. This required eliminating a bunch of stuff that was using DOUT, I hope that bill doesn't mind me stealing his fun. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79813 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/IfConversion.cpp4
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp14
-rw-r--r--lib/CodeGen/LiveVariables.cpp12
-rw-r--r--lib/CodeGen/MachineInstr.cpp12
-rw-r--r--lib/CodeGen/MachineVerifier.cpp2
5 files changed, 18 insertions, 26 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp
index 4a38ce9..62bde60 100644
--- a/lib/CodeGen/IfConversion.cpp
+++ b/lib/CodeGen/IfConversion.cpp
@@ -1133,7 +1133,7 @@ void IfConverter::PredicateBlock(BBInfo &BBI,
continue;
if (!TII->PredicateInstruction(I, Cond)) {
#ifndef NDEBUG
- cerr << "Unable to predicate " << *I << "!\n";
+ errs() << "Unable to predicate " << *I << "!\n";
#endif
llvm_unreachable(0);
}
@@ -1169,7 +1169,7 @@ void IfConverter::CopyAndPredicateBlock(BBInfo &ToBBI, BBInfo &FromBBI,
if (!isPredicated)
if (!TII->PredicateInstruction(MI, Cond)) {
#ifndef NDEBUG
- cerr << "Unable to predicate " << *I << "!\n";
+ errs() << "Unable to predicate " << *I << "!\n";
#endif
llvm_unreachable(0);
}
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 839817c..edd9536 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -517,19 +517,21 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
/// print - Implement the dump method.
void LiveIntervals::print(std::ostream &O, const Module* ) const {
- O << "********** INTERVALS **********\n";
+ raw_os_ostream OS(O);
+ OS << "********** INTERVALS **********\n";
for (const_iterator I = begin(), E = end(); I != E; ++I) {
- I->second->print(O, tri_);
- O << "\n";
+ I->second->print(OS, tri_);
+ OS << "\n";
}
- O << "********** MACHINEINSTRS **********\n";
+ OS << "********** MACHINEINSTRS **********\n";
+
for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end();
mbbi != mbbe; ++mbbi) {
- O << ((Value*)mbbi->getBasicBlock())->getNameStr() << ":\n";
+ OS << ((Value*)mbbi->getBasicBlock())->getName() << ":\n";
for (MachineBasicBlock::iterator mii = mbbi->begin(),
mie = mbbi->end(); mii != mie; ++mii) {
- O << getInstructionIndex(mii) << '\t' << *mii;
+ OS << getInstructionIndex(mii) << '\t' << *mii;
}
}
}
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp
index 2034566..626a76e 100644
--- a/lib/CodeGen/LiveVariables.cpp
+++ b/lib/CodeGen/LiveVariables.cpp
@@ -52,17 +52,17 @@ void LiveVariables::getAnalysisUsage(AnalysisUsage &AU) const {
}
void LiveVariables::VarInfo::dump() const {
- cerr << " Alive in blocks: ";
+ errs() << " Alive in blocks: ";
for (SparseBitVector<>::iterator I = AliveBlocks.begin(),
E = AliveBlocks.end(); I != E; ++I)
- cerr << *I << ", ";
- cerr << "\n Killed by:";
+ errs() << *I << ", ";
+ errs() << "\n Killed by:";
if (Kills.empty())
- cerr << " No instructions.\n";
+ errs() << " No instructions.\n";
else {
for (unsigned i = 0, e = Kills.size(); i != e; ++i)
- cerr << "\n #" << i << ": " << *Kills[i];
- cerr << "\n";
+ errs() << "\n #" << i << ": " << *Kills[i];
+ errs() << "\n";
}
}
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 7d1f15c..f9c3d04 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -183,11 +183,6 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const {
/// print - Print the specified machine operand.
///
-void MachineOperand::print(std::ostream &OS, const TargetMachine *TM) const {
- raw_os_ostream RawOS(OS);
- print(RawOS, TM);
-}
-
void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const {
switch (getType()) {
case MachineOperand::MO_Register:
@@ -948,12 +943,7 @@ bool MachineInstr::hasVolatileMemoryRef() const {
}
void MachineInstr::dump() const {
- cerr << " " << *this;
-}
-
-void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const {
- raw_os_ostream RawOS(OS);
- print(RawOS, TM);
+ errs() << " " << *this;
}
void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM) const {
diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp
index 0eb0535..1d7000c 100644
--- a/lib/CodeGen/MachineVerifier.cpp
+++ b/lib/CodeGen/MachineVerifier.cpp
@@ -254,7 +254,7 @@ MachineVerifier::report(const char *msg, const MachineInstr *MI)
assert(MI);
report(msg, MI->getParent());
*OS << "- instruction: ";
- MI->print(OS, TM);
+ MI->print(*OS, TM);
}
void