diff options
author | Bill Wendling <isanbard@gmail.com> | 2006-12-07 20:28:15 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2006-12-07 20:28:15 +0000 |
commit | bcd2498f4f1682dbdc41452add5b9bc72cbd6b3f (patch) | |
tree | c42cc25e701e45736f384bfced29bdbdf66a65a8 /lib/CodeGen | |
parent | 832171cb9724d2d31c8dfb73172e2be8f6dd13ee (diff) |
Removed more <iostream> includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/LLVMTargetMachine.cpp | 21 | ||||
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 19 | ||||
-rw-r--r-- | lib/CodeGen/MachOWriter.cpp | 1 | ||||
-rw-r--r-- | lib/CodeGen/MachineBasicBlock.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/MachineFunction.cpp | 14 | ||||
-rw-r--r-- | lib/CodeGen/RegAllocSimple.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/TwoAddressInstructionPass.cpp | 7 |
8 files changed, 31 insertions, 40 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index f113b16f26..0098a42dc9 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -17,7 +17,6 @@ #include "llvm/CodeGen/Passes.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Transforms/Scalar.h" -#include <iostream> using namespace llvm; bool LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM, @@ -46,18 +45,18 @@ bool LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM, // Print the instruction selected machine code... if (PrintMachineCode) - PM.add(createMachineFunctionPrinterPass(&std::cerr)); + PM.add(createMachineFunctionPrinterPass(cerr.stream())); // Perform register allocation to convert to a concrete x86 representation PM.add(createRegisterAllocator()); if (PrintMachineCode) - PM.add(createMachineFunctionPrinterPass(&std::cerr)); + PM.add(createMachineFunctionPrinterPass(cerr.stream())); // Run post-ra passes. if (addPostRegAlloc(PM, Fast) && PrintMachineCode) - PM.add(createMachineFunctionPrinterPass(&std::cerr)); + PM.add(createMachineFunctionPrinterPass(cerr.stream())); // Insert prolog/epilog code. Eliminate abstract frame index references... @@ -71,11 +70,11 @@ bool LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM, PM.add(createDebugLabelFoldingPass()); if (PrintMachineCode) // Print the register-allocated code - PM.add(createMachineFunctionPrinterPass(&std::cerr)); + PM.add(createMachineFunctionPrinterPass(cerr.stream())); if (addPreEmitPass(PM, Fast) && PrintMachineCode) - PM.add(createMachineFunctionPrinterPass(&std::cerr)); + PM.add(createMachineFunctionPrinterPass(cerr.stream())); switch (FileType) { @@ -127,32 +126,32 @@ bool LLVMTargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM, // Print the instruction selected machine code... if (PrintMachineCode) - PM.add(createMachineFunctionPrinterPass(&std::cerr)); + PM.add(createMachineFunctionPrinterPass(cerr.stream())); // Perform register allocation to convert to a concrete x86 representation PM.add(createRegisterAllocator()); if (PrintMachineCode) - PM.add(createMachineFunctionPrinterPass(&std::cerr)); + PM.add(createMachineFunctionPrinterPass(cerr.stream())); // Run post-ra passes. if (addPostRegAlloc(PM, Fast) && PrintMachineCode) - PM.add(createMachineFunctionPrinterPass(&std::cerr)); + PM.add(createMachineFunctionPrinterPass(cerr.stream())); // Insert prolog/epilog code. Eliminate abstract frame index references... PM.add(createPrologEpilogCodeInserter()); if (PrintMachineCode) // Print the register-allocated code - PM.add(createMachineFunctionPrinterPass(&std::cerr)); + PM.add(createMachineFunctionPrinterPass(cerr.stream())); // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) PM.add(createBranchFoldingPass()); if (addPreEmitPass(PM, Fast) && PrintMachineCode) - PM.add(createMachineFunctionPrinterPass(&std::cerr)); + PM.add(createMachineFunctionPrinterPass(cerr.stream())); addCodeEmitter(PM, Fast, MCE); diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index f5c81da46f..e0713c87c9 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -35,27 +35,26 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/Config/alloca.h" #include <algorithm> -#include <iostream> using namespace llvm; static RegisterPass<LiveVariables> X("livevars", "Live Variable Analysis"); void LiveVariables::VarInfo::dump() const { - std::cerr << "Register Defined by: "; + cerr << "Register Defined by: "; if (DefInst) - std::cerr << *DefInst; + cerr << *DefInst; else - std::cerr << "<null>\n"; - std::cerr << " Alive in blocks: "; + cerr << "<null>\n"; + cerr << " Alive in blocks: "; for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i) - if (AliveBlocks[i]) std::cerr << i << ", "; - std::cerr << "\n Killed by:"; + if (AliveBlocks[i]) cerr << i << ", "; + cerr << "\n Killed by:"; if (Kills.empty()) - std::cerr << " No instructions.\n"; + cerr << " No instructions.\n"; else { for (unsigned i = 0, e = Kills.size(); i != e; ++i) - std::cerr << "\n #" << i << ": " << *Kills[i]; - std::cerr << "\n"; + cerr << "\n #" << i << ": " << *Kills[i]; + cerr << "\n"; } } diff --git a/lib/CodeGen/MachOWriter.cpp b/lib/CodeGen/MachOWriter.cpp index 7c0855a5e1..390676973f 100644 --- a/lib/CodeGen/MachOWriter.cpp +++ b/lib/CodeGen/MachOWriter.cpp @@ -32,7 +32,6 @@ #include "llvm/Support/Mangler.h" #include "llvm/Support/MathExtras.h" #include <algorithm> -#include <iostream> using namespace llvm; //===----------------------------------------------------------------------===// diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 8d8e9b7c59..a626f4fdd1 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -19,7 +19,6 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/LeakDetector.h" -#include <iostream> #include <algorithm> using namespace llvm; @@ -87,7 +86,7 @@ MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator() { } void MachineBasicBlock::dump() const { - print(std::cerr); + print(*cerr.stream()); } void MachineBasicBlock::print(std::ostream &OS) const { diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 5d82f722ef..5aaae6deb5 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -31,9 +31,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/Config/config.h" #include <fstream> -#include <iostream> #include <sstream> - using namespace llvm; static AnnotationID MF_AID( @@ -177,7 +175,7 @@ void MachineFunction::RenumberBlocks(MachineBasicBlock *MBB) { } -void MachineFunction::dump() const { print(std::cerr); } +void MachineFunction::dump() const { print(*cerr.stream()); } void MachineFunction::print(std::ostream &OS) const { OS << "# Machine code for " << Fn->getName () << "():\n"; @@ -268,8 +266,8 @@ void MachineFunction::viewCFG() const #ifndef NDEBUG ViewGraph(this, "mf" + getFunction()->getName()); #else - std::cerr << "SelectionDAG::viewGraph is only available in debug builds on " - << "systems with Graphviz or gv!\n"; + cerr << "SelectionDAG::viewGraph is only available in debug builds on " + << "systems with Graphviz or gv!\n"; #endif // NDEBUG } @@ -350,7 +348,7 @@ void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{ } void MachineFrameInfo::dump(const MachineFunction &MF) const { - print(MF, std::cerr); + print(MF, *cerr.stream()); } @@ -390,7 +388,7 @@ unsigned MachineJumpTableInfo::getAlignment() const { return TD->getPointerAlignment(); } -void MachineJumpTableInfo::dump() const { print(std::cerr); } +void MachineJumpTableInfo::dump() const { print(*cerr.stream()); } //===----------------------------------------------------------------------===// @@ -473,4 +471,4 @@ void MachineConstantPool::print(std::ostream &OS) const { } } -void MachineConstantPool::dump() const { print(std::cerr); } +void MachineConstantPool::dump() const { print(*cerr.stream()); } diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp index 262f8c240e..87ef0031c5 100644 --- a/lib/CodeGen/RegAllocSimple.cpp +++ b/lib/CodeGen/RegAllocSimple.cpp @@ -27,7 +27,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" -#include <iostream> using namespace llvm; namespace { @@ -192,7 +191,7 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) { unsigned virtualReg = (unsigned) op.getReg(); DOUT << "op: " << op << "\n"; DOUT << "\t inst[" << i << "]: "; - DEBUG(MI->print(std::cerr, TM)); + DEBUG(MI->print(*cerr.stream(), TM)); // make sure the same virtual register maps to the same physical // register in any given instruction diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index c279982c00..5f92df3f2d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -26,7 +26,6 @@ #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" -#include <iostream> #include <set> #include <algorithm> #include <cmath> @@ -2887,7 +2886,7 @@ void SDNode::dump(const SelectionDAG *G) const { dyn_cast<GlobalAddressSDNode>(this)) { int offset = GADN->getOffset(); cerr << "<"; - WriteAsOperand(std::cerr, GADN->getGlobal()) << ">"; + WriteAsOperand(*cerr.stream(), GADN->getGlobal()) << ">"; if (offset > 0) cerr << " + " << offset; else diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 932542dd21..be19e46168 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -41,7 +41,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" -#include <iostream> using namespace llvm; namespace { @@ -102,7 +101,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { if (FirstTied) { ++NumTwoAddressInstrs; - DOUT << '\t'; DEBUG(mi->print(std::cerr, &TM)); + DOUT << '\t'; DEBUG(mi->print(*cerr.stream(), &TM)); } FirstTied = false; @@ -195,7 +194,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { MRI.copyRegToReg(*mbbi, mi, regA, regB, rc); MachineBasicBlock::iterator prevMi = prior(mi); - DOUT << "\t\tprepend:\t"; DEBUG(prevMi->print(std::cerr, &TM)); + DOUT << "\t\tprepend:\t"; DEBUG(prevMi->print(*cerr.stream(), &TM)); // Update live variables for regA LiveVariables::VarInfo& varInfo = LV.getVarInfo(regA); @@ -220,7 +219,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { mi->getOperand(ti).setReg(mi->getOperand(si).getReg()); MadeChange = true; - DOUT << "\t\trewrite to:\t"; DEBUG(mi->print(std::cerr, &TM)); + DOUT << "\t\trewrite to:\t"; DEBUG(mi->print(*cerr.stream(), &TM)); } } } |