Changes in directory llvm/lib/Analysis:
AliasAnalysisCounter.cpp updated: 1.15 -> 1.16 AliasAnalysisEvaluator.cpp updated: 1.28 -> 1.29 AliasSetTracker.cpp updated: 1.43 -> 1.44 CFGPrinter.cpp updated: 1.18 -> 1.19 ConstantRange.cpp updated: 1.16 -> 1.17 InstCount.cpp updated: 1.15 -> 1.16 LoopInfo.cpp updated: 1.79 -> 1.80 ProfileInfoLoader.cpp updated: 1.8 -> 1.9 ProfileInfoLoaderPass.cpp updated: 1.15 -> 1.16 ScalarEvolution.cpp updated: 1.59 -> 1.60 Trace.cpp updated: 1.2 -> 1.3 --- Log message: Removed some of the iostream #includes. Moved towards converting to using llvm streams --- Diffs of the changes: (+114 -86) AliasAnalysisCounter.cpp | 23 ++++++++++++----------- AliasAnalysisEvaluator.cpp | 44 ++++++++++++++++++++++---------------------- AliasSetTracker.cpp | 8 ++++---- CFGPrinter.cpp | 8 ++++---- ConstantRange.cpp | 32 +++++++++++++++++++++++++++++--- InstCount.cpp | 5 +++-- LoopInfo.cpp | 5 +++-- ProfileInfoLoader.cpp | 27 +++++++++++++-------------- ProfileInfoLoaderPass.cpp | 5 ++--- ScalarEvolution.cpp | 27 ++++++++++++++------------- Trace.cpp | 16 ++++++++-------- 11 files changed, 114 insertions(+), 86 deletions(-) Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.15 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.16 --- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.15 Sun Aug 27 19:42:29 2006 +++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Tue Nov 28 16:46:12 2006 @@ -17,6 +17,7 @@ #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include <iostream> using namespace llvm; @@ -38,14 +39,14 @@ } void printLine(const char *Desc, unsigned Val, unsigned Sum) { - std::cerr << " " << Val << " " << Desc << " responses (" + llvm_cerr << " " << Val << " " << Desc << " responses (" << Val*100/Sum << "%)\n"; } ~AliasAnalysisCounter() { unsigned AASum = No+May+Must; unsigned MRSum = NoMR+JustRef+JustMod+MR; if (AASum + MRSum) { // Print a report if any counted queries occurred... - std::cerr + llvm_cerr << "\n===== Alias Analysis Counter Report =====\n" << " Analysis counted: " << Name << "\n" << " " << AASum << " Total Alias Queries Performed\n"; @@ -53,19 +54,19 @@ printLine("no alias", No, AASum); printLine("may alias", May, AASum); printLine("must alias", Must, AASum); - std::cerr + llvm_cerr << " Alias Analysis Counter Summary: " << No*100/AASum << "%/" << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n"; } - std::cerr + llvm_cerr << " " << MRSum << " Total Mod/Ref Queries Performed\n"; if (MRSum) { printLine("no mod/ref", NoMR, MRSum); printLine("ref", JustRef, MRSum); printLine("mod", JustMod, MRSum); printLine("mod/ref", MR, MRSum); - std::cerr + llvm_cerr << " Mod/Ref Analysis Counter Summary: " << NoMR*100/MRSum<< "%/" << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/" << MR*100/MRSum <<"%\n\n"; @@ -132,10 +133,10 @@ } if (PrintAll || (PrintAllFailures && R == MayAlias)) { - std::cerr << AliasString << ":\t"; - std::cerr << "[" << V1Size << "B] "; + llvm_cerr << AliasString << ":\t"; + llvm_cerr << "[" << V1Size << "B] "; WriteAsOperand(std::cerr, V1, true, true, M) << ", "; - std::cerr << "[" << V2Size << "B] "; + llvm_cerr << "[" << V2Size << "B] "; WriteAsOperand(std::cerr, V2, true, true, M) << "\n"; } @@ -156,10 +157,10 @@ } if (PrintAll || (PrintAllFailures && R == ModRef)) { - std::cerr << MRString << ": Ptr: "; - std::cerr << "[" << Size << "B] "; + llvm_cerr << MRString << ": Ptr: "; + llvm_cerr << "[" << Size << "B] "; WriteAsOperand(std::cerr, P, true, true, M); - std::cerr << "\t<->" << *CS.getInstruction(); + llvm_cerr << "\t<->" << *CS.getInstruction(); } return R; } Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.28 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.29 --- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.28 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Tue Nov 28 16:46:12 2006 @@ -28,9 +28,9 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/InstIterator.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include <iostream> #include <set> - using namespace llvm; namespace { @@ -79,7 +79,7 @@ static inline void PrintResults(const char *Msg, bool P, Value *V1, Value *V2, Module *M) { if (P) { - std::cerr << " " << Msg << ":\t"; + llvm_cerr << " " << Msg << ":\t"; WriteAsOperand(std::cerr, V1, true, true, M) << ", "; WriteAsOperand(std::cerr, V2, true, true, M) << "\n"; } @@ -89,9 +89,9 @@ PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr, Module *M) { if (P) { - std::cerr << " " << Msg << ": Ptr: "; + llvm_cerr << " " << Msg << ": Ptr: "; WriteAsOperand(std::cerr, Ptr, true, true, M); - std::cerr << "\t<->" << *I; + llvm_cerr << "\t<->" << *I; } } @@ -125,7 +125,7 @@ if (PrintNoAlias || PrintMayAlias || PrintMustAlias || PrintNoModRef || PrintMod || PrintRef || PrintModRef) - std::cerr << "Function: " << F.getName() << ": " << Pointers.size() + llvm_cerr << "Function: " << F.getName() << ": " << Pointers.size() << " pointers, " << CallSites.size() << " call sites\n"; // iterate over the worklist, and run the full (n^2)/2 disambiguations @@ -151,7 +151,7 @@ PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent()); ++MustAlias; break; default: - std::cerr << "Unknown alias query result!\n"; + llvm_cerr << "Unknown alias query result!\n"; } } } @@ -181,7 +181,7 @@ PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent()); ++ModRef; break; default: - std::cerr << "Unknown alias query result!\n"; + llvm_cerr << "Unknown alias query result!\n"; } } } @@ -190,24 +190,24 @@ } static void PrintPercent(unsigned Num, unsigned Sum) { - std::cerr << "(" << Num*100ULL/Sum << "." + llvm_cerr << "(" << Num*100ULL/Sum << "." << ((Num*1000ULL/Sum) % 10) << "%)\n"; } bool AAEval::doFinalization(Module &M) { unsigned AliasSum = NoAlias + MayAlias + MustAlias; - std::cerr << "===== Alias Analysis Evaluator Report =====\n"; + llvm_cerr << "===== Alias Analysis Evaluator Report =====\n"; if (AliasSum == 0) { - std::cerr << " Alias Analysis Evaluator Summary: No pointers!\n"; + llvm_cerr << " Alias Analysis Evaluator Summary: No pointers!\n"; } else { - std::cerr << " " << AliasSum << " Total Alias Queries Performed\n"; - std::cerr << " " << NoAlias << " no alias responses "; + llvm_cerr << " " << AliasSum << " Total Alias Queries Performed\n"; + llvm_cerr << " " << NoAlias << " no alias responses "; PrintPercent(NoAlias, AliasSum); - std::cerr << " " << MayAlias << " may alias responses "; + llvm_cerr << " " << MayAlias << " may alias responses "; PrintPercent(MayAlias, AliasSum); - std::cerr << " " << MustAlias << " must alias responses "; + llvm_cerr << " " << MustAlias << " must alias responses "; PrintPercent(MustAlias, AliasSum); - std::cerr << " Alias Analysis Evaluator Pointer Alias Summary: " + llvm_cerr << " Alias Analysis Evaluator Pointer Alias Summary: " << NoAlias*100/AliasSum << "%/" << MayAlias*100/AliasSum << "%/" << MustAlias*100/AliasSum << "%\n"; } @@ -215,18 +215,18 @@ // Display the summary for mod/ref analysis unsigned ModRefSum = NoModRef + Mod + Ref + ModRef; if (ModRefSum == 0) { - std::cerr << " Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n"; + llvm_cerr << " Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n"; } else { - std::cerr << " " << ModRefSum << " Total ModRef Queries Performed\n"; - std::cerr << " " << NoModRef << " no mod/ref responses "; + llvm_cerr << " " << ModRefSum << " Total ModRef Queries Performed\n"; + llvm_cerr << " " << NoModRef << " no mod/ref responses "; PrintPercent(NoModRef, ModRefSum); - std::cerr << " " << Mod << " mod responses "; + llvm_cerr << " " << Mod << " mod responses "; PrintPercent(Mod, ModRefSum); - std::cerr << " " << Ref << " ref responses "; + llvm_cerr << " " << Ref << " ref responses "; PrintPercent(Ref, ModRefSum); - std::cerr << " " << ModRef << " mod & ref responses "; + llvm_cerr << " " << ModRef << " mod & ref responses "; PrintPercent(ModRef, ModRefSum); - std::cerr << " Alias Analysis Evaluator Mod/Ref Summary: " + llvm_cerr << " Alias Analysis Evaluator Mod/Ref Summary: " << NoModRef*100/ModRefSum << "%/" << Mod*100/ModRefSum << "%/" << Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n"; } Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.43 llvm/lib/Analysis/AliasSetTracker.cpp:1.44 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.43 Sun Sep 17 12:51:00 2006 +++ llvm/lib/Analysis/AliasSetTracker.cpp Tue Nov 28 16:46:12 2006 @@ -19,7 +19,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/InstIterator.h" -#include <iostream> +#include "llvm/Support/Streams.h" using namespace llvm; /// mergeSetIn - Merge the specified alias set into this alias set. @@ -543,8 +543,8 @@ OS << "\n"; } -void AliasSet::dump() const { print (std::cerr); } -void AliasSetTracker::dump() const { print(std::cerr); } +void AliasSet::dump() const { print (llvm_cerr); } +void AliasSetTracker::dump() const { print(llvm_cerr); } //===----------------------------------------------------------------------===// // AliasSetPrinter Pass @@ -564,7 +564,7 @@ for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) Tracker->add(&*I); - Tracker->print(std::cerr); + Tracker->print(llvm_cerr); delete Tracker; return false; } Index: llvm/lib/Analysis/CFGPrinter.cpp diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.18 llvm/lib/Analysis/CFGPrinter.cpp:1.19 --- llvm/lib/Analysis/CFGPrinter.cpp:1.18 Fri Nov 17 03:38:03 2006 +++ llvm/lib/Analysis/CFGPrinter.cpp Tue Nov 28 16:46:12 2006 @@ -25,7 +25,7 @@ #include "llvm/Support/CFG.h" #include "llvm/Support/GraphWriter.h" #include "llvm/Config/config.h" -#include <iostream> +#include <iosfwd> #include <sstream> #include <fstream> using namespace llvm; @@ -92,14 +92,14 @@ struct CFGPrinter : public FunctionPass { virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getName() + ".dot"; - std::cerr << "Writing '" << Filename << "'..."; + llvm_cerr << "Writing '" << Filename << "'..."; std::ofstream File(Filename.c_str()); if (File.good()) WriteGraph(File, (const Function*)&F); else - std::cerr << " error opening file for writing!"; - std::cerr << "\n"; + llvm_cerr << " error opening file for writing!"; + llvm_cerr << "\n"; return false; } Index: llvm/lib/Analysis/ConstantRange.cpp diff -u llvm/lib/Analysis/ConstantRange.cpp:1.16 llvm/lib/Analysis/ConstantRange.cpp:1.17 --- llvm/lib/Analysis/ConstantRange.cpp:1.16 Fri Oct 20 02:07:24 2006 +++ llvm/lib/Analysis/ConstantRange.cpp Tue Nov 28 16:46:12 2006 @@ -25,8 +25,8 @@ #include "llvm/Constants.h" #include "llvm/Instruction.h" #include "llvm/Type.h" -#include <iostream> - +#include "llvm/Support/Streams.h" +#include <ostream> using namespace llvm; static ConstantIntegral *Next(ConstantIntegral *CI) { @@ -50,6 +50,32 @@ return cast<ConstantBool>(C)->getValue(); } + + + + + + + + + + + + + + + + + + + + + + + + + + static bool GT(ConstantIntegral *A, ConstantIntegral *B) { return LT(B, A); } static ConstantIntegral *Min(ConstantIntegral *A, ConstantIntegral *B) { @@ -328,5 +354,5 @@ /// dump - Allow printing from a debugger easily... /// void ConstantRange::dump() const { - print(std::cerr); + print(llvm_cerr); } Index: llvm/lib/Analysis/InstCount.cpp diff -u llvm/lib/Analysis/InstCount.cpp:1.15 llvm/lib/Analysis/InstCount.cpp:1.16 --- llvm/lib/Analysis/InstCount.cpp:1.15 Sun Aug 27 17:30:17 2006 +++ llvm/lib/Analysis/InstCount.cpp Tue Nov 28 16:46:12 2006 @@ -15,8 +15,9 @@ #include "llvm/Pass.h" #include "llvm/Function.h" #include "llvm/Support/InstVisitor.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" -#include <iostream> +#include <ostream> using namespace llvm; namespace { @@ -42,7 +43,7 @@ #include "llvm/Instruction.def" void visitInstruction(Instruction &I) { - std::cerr << "Instruction Count does not know about " << I; + llvm_cerr << "Instruction Count does not know about " << I; abort(); } public: Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.79 llvm/lib/Analysis/LoopInfo.cpp:1.80 --- llvm/lib/Analysis/LoopInfo.cpp:1.79 Fri Oct 27 20:24:05 2006 +++ llvm/lib/Analysis/LoopInfo.cpp Tue Nov 28 16:46:12 2006 @@ -20,9 +20,10 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/DepthFirstIterator.h" #include <algorithm> -#include <iostream> +#include <ostream> using namespace llvm; static RegisterPass<LoopInfo> @@ -79,7 +80,7 @@ } void Loop::dump() const { - print(std::cerr); + print(llvm_cerr); } Index: llvm/lib/Analysis/ProfileInfoLoader.cpp diff -u llvm/lib/Analysis/ProfileInfoLoader.cpp:1.8 llvm/lib/Analysis/ProfileInfoLoader.cpp:1.9 --- llvm/lib/Analysis/ProfileInfoLoader.cpp:1.8 Thu Apr 21 16:04:58 2005 +++ llvm/lib/Analysis/ProfileInfoLoader.cpp Tue Nov 28 16:46:12 2006 @@ -16,10 +16,9 @@ #include "llvm/Analysis/ProfileInfoTypes.h" #include "llvm/Module.h" #include "llvm/InstrTypes.h" +#include "llvm/Support/Streams.h" #include <cstdio> -#include <iostream> #include <map> - using namespace llvm; // ByteSwap - Byteswap 'Var' if 'Really' is true. @@ -38,7 +37,7 @@ // Read the number of entries... unsigned NumEntries; if (fread(&NumEntries, sizeof(unsigned), 1, F) != 1) { - std::cerr << ToolName << ": data packet truncated!\n"; + llvm_cerr << ToolName << ": data packet truncated!\n"; perror(0); exit(1); } @@ -49,7 +48,7 @@ // Read in the block of data... if (fread(&TempSpace[0], sizeof(unsigned)*NumEntries, 1, F) != 1) { - std::cerr << ToolName << ": data packet truncated!\n"; + llvm_cerr << ToolName << ": data packet truncated!\n"; perror(0); exit(1); } @@ -76,7 +75,7 @@ Module &TheModule) : M(TheModule) { FILE *F = fopen(Filename.c_str(), "r"); if (F == 0) { - std::cerr << ToolName << ": Error opening '" << Filename << "': "; + llvm_cerr << ToolName << ": Error opening '" << Filename << "': "; perror(0); exit(1); } @@ -94,7 +93,7 @@ case ArgumentInfo: { unsigned ArgLength; if (fread(&ArgLength, sizeof(unsigned), 1, F) != 1) { - std::cerr << ToolName << ": arguments packet truncated!\n"; + llvm_cerr << ToolName << ": arguments packet truncated!\n"; perror(0); exit(1); } @@ -105,7 +104,7 @@ if (ArgLength) if (fread(&Chars[0], (ArgLength+3) & ~3, 1, F) != 1) { - std::cerr << ToolName << ": arguments packet truncated!\n"; + llvm_cerr << ToolName << ": arguments packet truncated!\n"; perror(0); exit(1); } @@ -130,7 +129,7 @@ break; default: - std::cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n"; + llvm_cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n"; exit(1); } } @@ -157,7 +156,7 @@ Counts.push_back(std::make_pair(BlockCounts[i].first->getParent(), BlockCounts[i].second)); } else { - std::cerr << "Function counts are not available!\n"; + llvm_cerr << "Function counts are not available!\n"; } return; } @@ -201,7 +200,7 @@ if (SuccNum >= TI->getNumSuccessors()) { static bool Warned = false; if (!Warned) { - std::cerr << "WARNING: profile info doesn't seem to match" + llvm_cerr << "WARNING: profile info doesn't seem to match" << " the program!\n"; Warned = true; } @@ -227,7 +226,7 @@ } } else { - std::cerr << "Block counts are not available!\n"; + llvm_cerr << "Block counts are not available!\n"; } return; } @@ -248,7 +247,7 @@ void ProfileInfoLoader::getEdgeCounts(std::vector<std::pair<Edge, unsigned> > &Counts) { if (EdgeCounts.empty()) { - std::cerr << "Edge counts not available, and no synthesis " + llvm_cerr << "Edge counts not available, and no synthesis " << "is implemented yet!\n"; return; } @@ -269,9 +268,9 @@ // void ProfileInfoLoader::getBBTrace(std::vector<BasicBlock *> &Trace) { if (BBTrace.empty ()) { - std::cerr << "Basic block trace is not available!\n"; + llvm_cerr << "Basic block trace is not available!\n"; return; } - std::cerr << "Basic block trace loading is not implemented yet!\n"; + llvm_cerr << "Basic block trace loading is not implemented yet!\n"; } Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.15 llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.16 --- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.15 Sun Aug 27 19:42:29 2006 +++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Tue Nov 28 16:46:12 2006 @@ -19,8 +19,7 @@ #include "llvm/Analysis/ProfileInfo.h" #include "llvm/Analysis/ProfileInfoLoader.h" #include "llvm/Support/CommandLine.h" -#include <iostream> - +#include "llvm/Support/Streams.h" using namespace llvm; namespace { @@ -77,7 +76,7 @@ TerminatorInst *TI = BB->getTerminator(); if (SuccNum >= TI->getNumSuccessors()) { if (!PrintedWarning) { - std::cerr << "WARNING: profile information is inconsistent with " + llvm_cerr << "WARNING: profile information is inconsistent with " << "the current program!\n"; PrintedWarning = true; } Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.59 llvm/lib/Analysis/ScalarEvolution.cpp:1.60 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.59 Sun Nov 26 19:05:09 2006 +++ llvm/lib/Analysis/ScalarEvolution.cpp Tue Nov 28 16:46:12 2006 @@ -74,8 +74,9 @@ #include "llvm/Support/ConstantRange.h" #include "llvm/Support/InstIterator.h" #include "llvm/Support/ManagedStatic.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" -#include <iostream> +#include <ostream> #include <algorithm> using namespace llvm; @@ -116,7 +117,7 @@ // SCEV::~SCEV() {} void SCEV::dump() const { - print(std::cerr); + print(llvm_cerr); } /// getValueRange - Return the tightest constant bounds that this value is @@ -1553,10 +1554,10 @@ break; default: #if 0 - std::cerr << "ComputeIterationCount "; + llvm_cerr << "ComputeIterationCount "; if (ExitCond->getOperand(0)->getType()->isUnsigned()) - std::cerr << "[unsigned] "; - std::cerr << *LHS << " " + llvm_cerr << "[unsigned] "; + llvm_cerr << *LHS << " " << Instruction::getOpcodeName(Cond) << " " << *RHS << "\n"; #endif break; @@ -1673,7 +1674,7 @@ if (!isa<ConstantBool>(Result)) break; // Couldn't decide for sure if (cast<ConstantBool>(Result)->getValue() == false) { #if 0 - std::cerr << "\n***\n*** Computed loop count " << *ItCst + llvm_cerr << "\n***\n*** Computed loop count " << *ItCst << "\n*** From global " << *GV << "*** BB: " << *L->getHeader() << "***\n"; #endif @@ -2142,7 +2143,7 @@ SCEVConstant *R2 = dyn_cast<SCEVConstant>(Roots.second); if (R1) { #if 0 - std::cerr << "HFTZ: " << *V << " - sol#1: " << *R1 + llvm_cerr << "HFTZ: " << *V << " - sol#1: " << *R1 << " sol#2: " << *R2 << "\n"; #endif // Pick the smallest positive root value. @@ -2271,7 +2272,7 @@ default: break; } - //std::cerr << "Computed Loop Trip Count as: " << + //llvm_cerr << "Computed Loop Trip Count as: " << // *SCEV::getMinusSCEV(RHS, AddRec->getOperand(0)) << "\n"; return SCEV::getMinusSCEV(RHS, AddRec->getOperand(0)); } @@ -2487,20 +2488,20 @@ for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I) PrintLoopInfo(OS, SE, *I); - std::cerr << "Loop " << L->getHeader()->getName() << ": "; + llvm_cerr << "Loop " << L->getHeader()->getName() << ": "; std::vector<BasicBlock*> ExitBlocks; L->getExitBlocks(ExitBlocks); if (ExitBlocks.size() != 1) - std::cerr << "<multiple exits> "; + llvm_cerr << "<multiple exits> "; if (SE->hasLoopInvariantIterationCount(L)) { - std::cerr << *SE->getIterationCount(L) << " iterations! "; + llvm_cerr << *SE->getIterationCount(L) << " iterations! "; } else { - std::cerr << "Unpredictable iteration count. "; + llvm_cerr << "Unpredictable iteration count. "; } - std::cerr << "\n"; + llvm_cerr << "\n"; } void ScalarEvolution::print(std::ostream &OS, const Module* ) const { Index: llvm/lib/Analysis/Trace.cpp diff -u llvm/lib/Analysis/Trace.cpp:1.2 llvm/lib/Analysis/Trace.cpp:1.3 --- llvm/lib/Analysis/Trace.cpp:1.2 Sun Jul 4 07:19:55 2004 +++ llvm/lib/Analysis/Trace.cpp Tue Nov 28 16:46:12 2006 @@ -18,8 +18,7 @@ #include "llvm/Analysis/Trace.h" #include "llvm/Function.h" #include "llvm/Assembly/Writer.h" -#include <iostream> - +#include "llvm/Support/Streams.h" using namespace llvm; Function *Trace::getFunction() const { @@ -33,12 +32,13 @@ /// print - Write trace to output stream. /// -void Trace::print (std::ostream &O) const { +void Trace::print(llvm_ostream &O) const { Function *F = getFunction (); - O << "; Trace from function " << F->getName () << ", blocks:\n"; - for (const_iterator i = begin (), e = end (); i != e; ++i) { + O << "; Trace from function " << F->getName() << ", blocks:\n"; + for (const_iterator i = begin(), e = end(); i != e; ++i) { O << "; "; - WriteAsOperand (O, *i, true, true, getModule ()); + if (O.stream()) + WriteAsOperand(*O.stream(), *i, true, true, getModule()); O << "\n"; } O << "; Trace parent function: \n" << *F; @@ -47,6 +47,6 @@ /// dump - Debugger convenience method; writes trace to standard error /// output stream. /// -void Trace::dump () const { - print (std::cerr); +void Trace::dump() const { + print(llvm_cerr); } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits