diff options
Diffstat (limited to 'llvm/lib/Analysis')
24 files changed, 166 insertions, 174 deletions
| diff --git a/llvm/lib/Analysis/AliasAnalysisCounter.cpp b/llvm/lib/Analysis/AliasAnalysisCounter.cpp index d563c13c10b..b2b6739ae10 100644 --- a/llvm/lib/Analysis/AliasAnalysisCounter.cpp +++ b/llvm/lib/Analysis/AliasAnalysisCounter.cpp @@ -39,37 +39,33 @@ namespace {      }      void printLine(const char *Desc, unsigned Val, unsigned Sum) { -      llvm_cerr <<  "  " << Val << " " << Desc << " responses (" -                << Val*100/Sum << "%)\n"; +      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... -        llvm_cerr -          << "\n===== Alias Analysis Counter Report =====\n" -          << "  Analysis counted: " << Name << "\n" -          << "  " << AASum << " Total Alias Queries Performed\n"; +        cerr << "\n===== Alias Analysis Counter Report =====\n" +             << "  Analysis counted: " << Name << "\n" +             << "  " << AASum << " Total Alias Queries Performed\n";          if (AASum) {            printLine("no alias",     No, AASum);            printLine("may alias",   May, AASum);            printLine("must alias", Must, AASum); -          llvm_cerr -            << "  Alias Analysis Counter Summary: " << No*100/AASum << "%/" -            << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n"; +          cerr << "  Alias Analysis Counter Summary: " << No*100/AASum << "%/" +               << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n";          } -        llvm_cerr -          << "  " << MRSum    << " Total Mod/Ref Queries Performed\n"; +        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); -          llvm_cerr -            << "  Mod/Ref Analysis Counter Summary: " << NoMR*100/MRSum<< "%/" -            << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/" -            << MR*100/MRSum <<"%\n\n"; +          cerr << "  Mod/Ref Analysis Counter Summary: " <<NoMR*100/MRSum<< "%/" +               << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/" +               << MR*100/MRSum <<"%\n\n";          }        }      } @@ -133,10 +129,10 @@ AliasAnalysisCounter::alias(const Value *V1, unsigned V1Size,    }    if (PrintAll || (PrintAllFailures && R == MayAlias)) { -    llvm_cerr << AliasString << ":\t"; -    llvm_cerr << "[" << V1Size << "B] "; +    cerr << AliasString << ":\t"; +    cerr << "[" << V1Size << "B] ";      WriteAsOperand(std::cerr, V1, true, M) << ", "; -    llvm_cerr << "[" << V2Size << "B] "; +    cerr << "[" << V2Size << "B] ";      WriteAsOperand(std::cerr, V2, true, M) << "\n";    } @@ -157,10 +153,10 @@ AliasAnalysisCounter::getModRefInfo(CallSite CS, Value *P, unsigned Size) {    }    if (PrintAll || (PrintAllFailures && R == ModRef)) { -    llvm_cerr << MRString << ":  Ptr: "; -    llvm_cerr << "[" << Size << "B] "; +    cerr << MRString << ":  Ptr: "; +    cerr << "[" << Size << "B] ";      WriteAsOperand(std::cerr, P, true, M); -    llvm_cerr << "\t<->" << *CS.getInstruction(); +    cerr << "\t<->" << *CS.getInstruction();    }    return R;  } diff --git a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp index d64394a8796..31875f87104 100644 --- a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp +++ b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp @@ -79,7 +79,7 @@ FunctionPass *llvm::createAAEvalPass() { return new AAEval(); }  static inline void PrintResults(const char *Msg, bool P, Value *V1, Value *V2,                                  Module *M) {    if (P) { -    llvm_cerr << "  " << Msg << ":\t"; +    cerr << "  " << Msg << ":\t";      WriteAsOperand(std::cerr, V1, true, M) << ", ";      WriteAsOperand(std::cerr, V2, true, M) << "\n";    } @@ -89,9 +89,9 @@ static inline void  PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr,                     Module *M) {    if (P) { -    llvm_cerr << "  " << Msg << ":  Ptr: "; +    cerr << "  " << Msg << ":  Ptr: ";      WriteAsOperand(std::cerr, Ptr, true, M); -    llvm_cerr << "\t<->" << *I; +    cerr << "\t<->" << *I;    }  } @@ -125,8 +125,8 @@ bool AAEval::runOnFunction(Function &F) {    if (PrintNoAlias || PrintMayAlias || PrintMustAlias ||        PrintNoModRef || PrintMod || PrintRef || PrintModRef) -    llvm_cerr << "Function: " << F.getName() << ": " << Pointers.size() -              << " pointers, " << CallSites.size() << " call sites\n"; +    cerr << "Function: " << F.getName() << ": " << Pointers.size() +         << " pointers, " << CallSites.size() << " call sites\n";    // iterate over the worklist, and run the full (n^2)/2 disambiguations    for (std::set<Value *>::iterator I1 = Pointers.begin(), E = Pointers.end(); @@ -151,7 +151,7 @@ bool AAEval::runOnFunction(Function &F) {          PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent());          ++MustAlias; break;        default: -        llvm_cerr << "Unknown alias query result!\n"; +        cerr << "Unknown alias query result!\n";        }      }    } @@ -181,7 +181,7 @@ bool AAEval::runOnFunction(Function &F) {          PrintModRefResults("  ModRef", PrintModRef, I, *V, F.getParent());          ++ModRef; break;        default: -        llvm_cerr << "Unknown alias query result!\n"; +        cerr << "Unknown alias query result!\n";        }      }    } @@ -190,45 +190,45 @@ bool AAEval::runOnFunction(Function &F) {  }  static void PrintPercent(unsigned Num, unsigned Sum) { -  llvm_cerr << "(" << Num*100ULL/Sum << "." +  cerr << "(" << Num*100ULL/Sum << "."              << ((Num*1000ULL/Sum) % 10) << "%)\n";  }  bool AAEval::doFinalization(Module &M) {    unsigned AliasSum = NoAlias + MayAlias + MustAlias; -  llvm_cerr << "===== Alias Analysis Evaluator Report =====\n"; +  cerr << "===== Alias Analysis Evaluator Report =====\n";    if (AliasSum == 0) { -    llvm_cerr << "  Alias Analysis Evaluator Summary: No pointers!\n"; +    cerr << "  Alias Analysis Evaluator Summary: No pointers!\n";    } else { -    llvm_cerr << "  " << AliasSum << " Total Alias Queries Performed\n"; -    llvm_cerr << "  " << NoAlias << " no alias responses "; +    cerr << "  " << AliasSum << " Total Alias Queries Performed\n"; +    cerr << "  " << NoAlias << " no alias responses ";      PrintPercent(NoAlias, AliasSum); -    llvm_cerr << "  " << MayAlias << " may alias responses "; +    cerr << "  " << MayAlias << " may alias responses ";      PrintPercent(MayAlias, AliasSum); -    llvm_cerr << "  " << MustAlias << " must alias responses "; +    cerr << "  " << MustAlias << " must alias responses ";      PrintPercent(MustAlias, AliasSum); -    llvm_cerr << "  Alias Analysis Evaluator Pointer Alias Summary: " -              << NoAlias*100/AliasSum  << "%/" << MayAlias*100/AliasSum << "%/" -              << MustAlias*100/AliasSum << "%\n"; +    cerr << "  Alias Analysis Evaluator Pointer Alias Summary: " +         << NoAlias*100/AliasSum  << "%/" << MayAlias*100/AliasSum << "%/" +         << MustAlias*100/AliasSum << "%\n";    }    // Display the summary for mod/ref analysis    unsigned ModRefSum = NoModRef + Mod + Ref + ModRef;    if (ModRefSum == 0) { -    llvm_cerr << "  Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n"; +    cerr << "  Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n";    } else { -    llvm_cerr << "  " << ModRefSum << " Total ModRef Queries Performed\n"; -    llvm_cerr << "  " << NoModRef << " no mod/ref responses "; +    cerr << "  " << ModRefSum << " Total ModRef Queries Performed\n"; +    cerr << "  " << NoModRef << " no mod/ref responses ";      PrintPercent(NoModRef, ModRefSum); -    llvm_cerr << "  " << Mod << " mod responses "; +    cerr << "  " << Mod << " mod responses ";      PrintPercent(Mod, ModRefSum); -    llvm_cerr << "  " << Ref << " ref responses "; +    cerr << "  " << Ref << " ref responses ";      PrintPercent(Ref, ModRefSum); -    llvm_cerr << "  " << ModRef << " mod & ref responses "; +    cerr << "  " << ModRef << " mod & ref responses ";      PrintPercent(ModRef, ModRefSum); -    llvm_cerr << "  Alias Analysis Evaluator Mod/Ref Summary: " -              << NoModRef*100/ModRefSum  << "%/" << Mod*100/ModRefSum << "%/" -              << Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n"; +    cerr << "  Alias Analysis Evaluator Mod/Ref Summary: " +         << NoModRef*100/ModRefSum  << "%/" << Mod*100/ModRefSum << "%/" +         << Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n";    }    return false; diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp index f07ff6f8675..9ab2b8ad262 100644 --- a/llvm/lib/Analysis/AliasSetTracker.cpp +++ b/llvm/lib/Analysis/AliasSetTracker.cpp @@ -543,8 +543,8 @@ void AliasSetTracker::print(std::ostream &OS) const {    OS << "\n";  } -void AliasSet::dump() const { print (llvm_cerr); } -void AliasSetTracker::dump() const { print(llvm_cerr); } +void AliasSet::dump() const { print (cerr); } +void AliasSetTracker::dump() const { print(cerr); }  //===----------------------------------------------------------------------===//  //                            AliasSetPrinter Pass @@ -564,7 +564,7 @@ namespace {        for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)          Tracker->add(&*I); -      Tracker->print(llvm_cerr); +      Tracker->print(cerr);        delete Tracker;        return false;      } diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 26bcb438a2e..ce55b4de42b 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -745,8 +745,8 @@ BasicAliasAnalysis::CheckGEPInstructions(      assert(Offset1<Offset2 && "There is at least one different constant here!");      if ((uint64_t)(Offset2-Offset1) >= SizeMax) { -      //llvm_cerr << "Determined that these two GEP's don't alias [" -      //          << SizeMax << " bytes]: \n" << *GEP1 << *GEP2; +      //cerr << "Determined that these two GEP's don't alias [" +      //     << SizeMax << " bytes]: \n" << *GEP1 << *GEP2;        return NoAlias;      }    } diff --git a/llvm/lib/Analysis/CFGPrinter.cpp b/llvm/lib/Analysis/CFGPrinter.cpp index bfc71c6686c..f16dca833cd 100644 --- a/llvm/lib/Analysis/CFGPrinter.cpp +++ b/llvm/lib/Analysis/CFGPrinter.cpp @@ -92,14 +92,14 @@ namespace {    struct CFGPrinter : public FunctionPass {      virtual bool runOnFunction(Function &F) {        std::string Filename = "cfg." + F.getName() + ".dot"; -      llvm_cerr << "Writing '" << Filename << "'..."; +      cerr << "Writing '" << Filename << "'...";        std::ofstream File(Filename.c_str());        if (File.good())          WriteGraph(File, (const Function*)&F);        else -        llvm_cerr << "  error opening file for writing!"; -      llvm_cerr << "\n"; +        cerr << "  error opening file for writing!"; +      cerr << "\n";        return false;      } diff --git a/llvm/lib/Analysis/ConstantRange.cpp b/llvm/lib/Analysis/ConstantRange.cpp index 1f1a1b5757f..2c215866c6d 100644 --- a/llvm/lib/Analysis/ConstantRange.cpp +++ b/llvm/lib/Analysis/ConstantRange.cpp @@ -370,5 +370,5 @@ void ConstantRange::print(std::ostream &OS) const {  /// dump - Allow printing from a debugger easily...  ///  void ConstantRange::dump() const { -  print(llvm_cerr); +  print(cerr);  } diff --git a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp index f5ca5fd6f58..e8592b13b67 100644 --- a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp @@ -501,7 +501,7 @@ DSGraph &BUDataStructures::CreateGraphForExternalFunction(const Function &Fn) {      DSG->getNodeForValue(F->arg_begin()).mergeWith(N);    } else { -    llvm_cerr << "Unrecognized external function: " << F->getName() << "\n"; +    cerr << "Unrecognized external function: " << F->getName() << "\n";      abort();    } @@ -588,21 +588,21 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {          ++NumBUInlines;        } else {          if (!Printed) -          llvm_cerr << "In Fns: " << Graph.getFunctionNames() << "\n"; -        llvm_cerr << "  calls " << CalledFuncs.size() -                  << " fns from site: " << CS.getCallSite().getInstruction() -                  << "  " << *CS.getCallSite().getInstruction(); -        llvm_cerr << "   Fns ="; +          cerr << "In Fns: " << Graph.getFunctionNames() << "\n"; +        cerr << "  calls " << CalledFuncs.size() +             << " fns from site: " << CS.getCallSite().getInstruction() +             << "  " << *CS.getCallSite().getInstruction(); +        cerr << "   Fns =";          unsigned NumPrinted = 0;          for (std::vector<Function*>::iterator I = CalledFuncs.begin(),                 E = CalledFuncs.end(); I != E; ++I) { -          if (NumPrinted++ < 8) llvm_cerr << " " << (*I)->getName(); +          if (NumPrinted++ < 8) cerr << " " << (*I)->getName();            // Add the call edges to the call graph.            ActualCallees.insert(std::make_pair(TheCall, *I));          } -        llvm_cerr << "\n"; +        cerr << "\n";          // See if we already computed a graph for this set of callees.          std::sort(CalledFuncs.begin(), CalledFuncs.end()); @@ -645,7 +645,7 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {            // Clean up the final graph!            GI->removeDeadNodes(DSGraph::KeepUnreachableGlobals);          } else { -          llvm_cerr << "***\n*** RECYCLED GRAPH ***\n***\n"; +          cerr << "***\n*** RECYCLED GRAPH ***\n***\n";          }          GI = IndCallGraph.first; @@ -685,7 +685,7 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {           E = MainSM.global_end(); I != E; ++I)      RC.getClonedNH(MainSM[*I]); -  //Graph.writeGraphToFile(llvm_cerr, "bu_" + F.getName()); +  //Graph.writeGraphToFile(cerr, "bu_" + F.getName());  }  static const Function *getFnForValue(const Value *V) { @@ -746,8 +746,8 @@ void BUDataStructures::copyValue(Value *From, Value *To) {      return;    } -  llvm_cerr << *From; -  llvm_cerr << *To; +  cerr << *From; +  cerr << *To;    assert(0 && "Do not know how to copy this yet!");    abort();  } diff --git a/llvm/lib/Analysis/DataStructure/CallTargets.cpp b/llvm/lib/Analysis/DataStructure/CallTargets.cpp index 5ed44574180..bae866fd343 100644 --- a/llvm/lib/Analysis/DataStructure/CallTargets.cpp +++ b/llvm/lib/Analysis/DataStructure/CallTargets.cpp @@ -17,15 +17,15 @@  //  //===----------------------------------------------------------------------===// +#include "llvm/Analysis/DataStructure/CallTargets.h"  #include "llvm/Module.h"  #include "llvm/Instructions.h"  #include "llvm/Analysis/DataStructure/DataStructure.h"  #include "llvm/Analysis/DataStructure/DSGraph.h" -#include "llvm/Analysis/DataStructure/CallTargets.h"  #include "llvm/ADT/Statistic.h"  #include "llvm/Support/Streams.h" -#include <ostream>  #include "llvm/Constants.h" +#include <ostream>  using namespace llvm;  namespace { @@ -58,11 +58,11 @@ void CallTargetFinder::findIndTargets(Module &M)                }                 if (N->isComplete() && !IndMap[cs].size()) {                  ++CompleteEmpty; -                llvm_cerr << "Call site empty: '" -                << cs.getInstruction()->getName()  -                          << "' In '" -                << cs.getInstruction()->getParent()->getParent()->getName() -                          << "'\n"; +                cerr << "Call site empty: '" +                     << cs.getInstruction()->getName()  +                     << "' In '" +                     << cs.getInstruction()->getParent()->getParent()->getName() +                     << "'\n";                }              } else {                ++DirCall; diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp index 80237c4f0bf..c81fd6ad341 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp +++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp @@ -25,7 +25,6 @@  #include "llvm/ADT/STLExtras.h"  #include "llvm/ADT/SCCIterator.h"  #include "llvm/ADT/Statistic.h" -#include "llvm/Support/Streams.h"  #include "llvm/Support/Timer.h"  #include <iostream>  #include <algorithm> @@ -1263,7 +1262,7 @@ DSGraph::~DSGraph() {  }  // dump - Allow inspection of graph in a debugger. -void DSGraph::dump() const { print(llvm_cerr); } +void DSGraph::dump() const { print(cerr); }  /// remapLinks - Change all of the Links in the current node according to the diff --git a/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp b/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp index f7fbe3b33cd..1357a334eb1 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp +++ b/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp @@ -92,18 +92,18 @@ void DSGraphStats::countCallees(const Function& F) {          totalNumCallees  += Callees.size();          ++numIndirectCalls;        } else -        llvm_cerr << "WARNING: No callee in Function '" << F.getName() -                  << "' at call: \n" -                  << *I->getCallSite().getInstruction(); +        cerr << "WARNING: No callee in Function '" << F.getName() +             << "' at call: \n" +             << *I->getCallSite().getInstruction();      }    TotalNumCallees  += totalNumCallees;    NumIndirectCalls += numIndirectCalls;    if (numIndirectCalls) -    llvm_cout << "  In function " << F.getName() << ":  " -              << (totalNumCallees / (double) numIndirectCalls) -              << " average callees per indirect call\n"; +    cout << "  In function " << F.getName() << ":  " +         << (totalNumCallees / (double) numIndirectCalls) +         << " average callees per indirect call\n";  }  DSNode *DSGraphStats::getNodeForValue(Value *V) { diff --git a/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp index 49c93ffc4f4..2813b943ad2 100644 --- a/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp +++ b/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp @@ -90,7 +90,7 @@ bool EquivClassGraphs::runOnModule(Module &M) {    if (MainFunc && !MainFunc->isExternal()) {      processSCC(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap);    } else { -    llvm_cerr << "Fold Graphs: No 'main' function found!\n"; +    cerr << "Fold Graphs: No 'main' function found!\n";    }    for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) diff --git a/llvm/lib/Analysis/DataStructure/GraphChecker.cpp b/llvm/lib/Analysis/DataStructure/GraphChecker.cpp index cef3efed8f7..8e4d3fce87d 100644 --- a/llvm/lib/Analysis/DataStructure/GraphChecker.cpp +++ b/llvm/lib/Analysis/DataStructure/GraphChecker.cpp @@ -84,8 +84,8 @@ FunctionPass *llvm::createDataStructureGraphCheckerPass() {  DSGC::DSGC() {    if (!AbortIfAnyCollapsed && AbortIfCollapsed.empty() &&        CheckFlags.empty() && AbortIfMerged.empty()) { -    llvm_cerr << "The -datastructure-gc is useless if you don't specify any" -                 " -dsgc-* options.  See the -help-hidden output for a list.\n"; +    cerr << "The -datastructure-gc is useless if you don't specify any" +         << " -dsgc-* options.  See the -help-hidden output for a list.\n";      abort();    }  } @@ -123,8 +123,8 @@ void DSGC::verify(const DSGraph &G) {      for (DSGraph::node_const_iterator I = G.node_begin(), E = G.node_end();           I != E; ++I)        if (I->isNodeCompletelyFolded()) { -        llvm_cerr << "Node is collapsed: "; -        I->print(llvm_cerr, &G); +        cerr << "Node is collapsed: "; +        I->print(cerr, &G);          abort();        }    } @@ -142,8 +142,8 @@ void DSGC::verify(const DSGraph &G) {             E = CheckFlags.end(); I != E; ++I) {        std::string::size_type ColonPos = I->rfind(':');        if (ColonPos == std::string::npos) { -        llvm_cerr << "Error: '" << *I -               << "' is an invalid value for the --dsgc-check-flags option!\n"; +        cerr << "Error: '" << *I +             << "' is an invalid value for the --dsgc-check-flags option!\n";          abort();        } @@ -158,7 +158,7 @@ void DSGC::verify(const DSGraph &G) {          case 'M': Flags |= DSNode::Modified;    break;          case 'R': Flags |= DSNode::Read;        break;          case 'A': Flags |= DSNode::Array;       break; -        default: llvm_cerr << "Invalid DSNode flag!\n"; abort(); +        default: cerr << "Invalid DSNode flag!\n"; abort();          }        CheckFlagsM[std::string(I->begin(), I->begin()+ColonPos)] = Flags;      } @@ -176,25 +176,25 @@ void DSGC::verify(const DSGraph &G) {          // Verify it is not collapsed if it is not supposed to be...          if (N->isNodeCompletelyFolded() && AbortIfCollapsedS.count(Name)) { -          llvm_cerr << "Node for value '%" << Name << "' is collapsed: "; -          N->print(llvm_cerr, &G); +          cerr << "Node for value '%" << Name << "' is collapsed: "; +          N->print(cerr, &G);            abort();          }          if (CheckFlagsM.count(Name) && CheckFlagsM[Name] != N->getNodeFlags()) { -          llvm_cerr << "Node flags are not as expected for node: " << Name  -                    << " (" << CheckFlagsM[Name] << ":" <<N->getNodeFlags() -                    << ")\n"; -          N->print(llvm_cerr, &G); +          cerr << "Node flags are not as expected for node: " << Name  +               << " (" << CheckFlagsM[Name] << ":" <<N->getNodeFlags() +               << ")\n"; +          N->print(cerr, &G);            abort();          }          // Verify that it is not merged if it is not supposed to be...          if (AbortIfMergedS.count(Name)) {            if (AbortIfMergedNodes.count(N)) { -            llvm_cerr << "Nodes for values '%" << Name << "' and '%" -                      << AbortIfMergedNodes[N] << "' is merged: "; -            N->print(llvm_cerr, &G); +            cerr << "Nodes for values '%" << Name << "' and '%" +                 << AbortIfMergedNodes[N] << "' is merged: "; +            N->print(cerr, &G);              abort();            }            AbortIfMergedNodes[N] = Name; diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp index 436218be9e1..66ca33d8765 100644 --- a/llvm/lib/Analysis/DataStructure/Local.cpp +++ b/llvm/lib/Analysis/DataStructure/Local.cpp @@ -434,7 +434,7 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) {          // Variable index into a node.  We must merge all of the elements of the          // sequential type here.          if (isa<PointerType>(STy)) -          llvm_cerr << "Pointer indexing not handled yet!\n"; +          cerr << "Pointer indexing not handled yet!\n";          else {            const ArrayType *ATy = cast<ArrayType>(STy);            unsigned ElSize = TD.getTypeSize(CurTy); @@ -1061,7 +1061,7 @@ void GraphBuilder::visitCallSite(CallSite CS) {    if (DisableDirectCallOpt || !isa<Function>(Callee)) {      CalleeNode = getValueDest(*Callee).getNode();      if (CalleeNode == 0) { -      llvm_cerr << "WARNING: Program is calling through a null pointer?\n"<< *I; +      cerr << "WARNING: Program is calling through a null pointer?\n"<< *I;        return;  // Calling a null pointer?      }    } diff --git a/llvm/lib/Analysis/DataStructure/Printer.cpp b/llvm/lib/Analysis/DataStructure/Printer.cpp index 2e86bda5486..21d75c08bc0 100644 --- a/llvm/lib/Analysis/DataStructure/Printer.cpp +++ b/llvm/lib/Analysis/DataStructure/Printer.cpp @@ -37,7 +37,7 @@ namespace {    Statistic NumFoldedNodes ("dsa", "Number of folded nodes (in final graph)");  } -void DSNode::dump() const { print(llvm_cerr, 0); } +void DSNode::dump() const { print(cerr, 0); }  static std::string getCaption(const DSNode *N, const DSGraph *G) {    std::stringstream OS; diff --git a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp b/llvm/lib/Analysis/DataStructure/Steensgaard.cpp index 292dfffa0dc..5ff3c3f8522 100644 --- a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp +++ b/llvm/lib/Analysis/DataStructure/Steensgaard.cpp @@ -53,7 +53,7 @@ namespace {      }      // print - Implement the Pass::print method... -    void print(llvm_ostream O, const Module *M) const { +    void print(OStream O, const Module *M) const {        if (O.stream()) print(*O.stream(), M);      }      void print(std::ostream &O, const Module *M) const { diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp index 28875030416..69462279a9a 100644 --- a/llvm/lib/Analysis/IPA/Andersens.cpp +++ b/llvm/lib/Analysis/IPA/Andersens.cpp @@ -533,7 +533,7 @@ Andersens::Node *Andersens::getNodeForConstantPointer(Constant *C) {      case Instruction::BitCast:        return getNodeForConstantPointer(CE->getOperand(0));      default: -      llvm_cerr << "Constant Expr not yet handled: " << *CE << "\n"; +      cerr << "Constant Expr not yet handled: " << *CE << "\n";        assert(0);      }    } else { @@ -560,7 +560,7 @@ Andersens::Node *Andersens::getNodeForConstantPointerTarget(Constant *C) {      case Instruction::BitCast:        return getNodeForConstantPointerTarget(CE->getOperand(0));      default: -      llvm_cerr << "Constant Expr not yet handled: " << *CE << "\n"; +      cerr << "Constant Expr not yet handled: " << *CE << "\n";        assert(0);      }    } else { @@ -786,7 +786,7 @@ void Andersens::visitInstruction(Instruction &I) {      return;    default:      // Is this something we aren't handling yet? -    llvm_cerr << "Unknown instruction: " << I; +    cerr << "Unknown instruction: " << I;      abort();    }  } @@ -1104,13 +1104,13 @@ void Andersens::SolveConstraints() {  void Andersens::PrintNode(Node *N) {    if (N == &GraphNodes[UniversalSet]) { -    llvm_cerr << "<universal>"; +    cerr << "<universal>";      return;    } else if (N == &GraphNodes[NullPtr]) { -    llvm_cerr << "<nullptr>"; +    cerr << "<nullptr>";      return;    } else if (N == &GraphNodes[NullObject]) { -    llvm_cerr << "<null>"; +    cerr << "<null>";      return;    } @@ -1119,56 +1119,56 @@ void Andersens::PrintNode(Node *N) {    if (Function *F = dyn_cast<Function>(V)) {      if (isa<PointerType>(F->getFunctionType()->getReturnType()) &&          N == getReturnNode(F)) { -      llvm_cerr << F->getName() << ":retval"; +      cerr << F->getName() << ":retval";        return;      } else if (F->getFunctionType()->isVarArg() && N == getVarargNode(F)) { -      llvm_cerr << F->getName() << ":vararg"; +      cerr << F->getName() << ":vararg";        return;      }    }    if (Instruction *I = dyn_cast<Instruction>(V)) -    llvm_cerr << I->getParent()->getParent()->getName() << ":"; +    cerr << I->getParent()->getParent()->getName() << ":";    else if (Argument *Arg = dyn_cast<Argument>(V)) -    llvm_cerr << Arg->getParent()->getName() << ":"; +    cerr << Arg->getParent()->getName() << ":";    if (V->hasName()) -    llvm_cerr << V->getName(); +    cerr << V->getName();    else -    llvm_cerr << "(unnamed)"; +    cerr << "(unnamed)";    if (isa<GlobalValue>(V) || isa<AllocationInst>(V))      if (N == getObject(V)) -      llvm_cerr << "<mem>"; +      cerr << "<mem>";  }  void Andersens::PrintConstraints() { -  llvm_cerr << "Constraints:\n"; +  cerr << "Constraints:\n";    for (unsigned i = 0, e = Constraints.size(); i != e; ++i) { -    llvm_cerr << "  #" << i << ":  "; +    cerr << "  #" << i << ":  ";      Constraint &C = Constraints[i];      if (C.Type == Constraint::Store) -      llvm_cerr << "*"; +      cerr << "*";      PrintNode(C.Dest); -    llvm_cerr << " = "; +    cerr << " = ";      if (C.Type == Constraint::Load) -      llvm_cerr << "*"; +      cerr << "*";      PrintNode(C.Src); -    llvm_cerr << "\n"; +    cerr << "\n";    }  }  void Andersens::PrintPointsToGraph() { -  llvm_cerr << "Points-to graph:\n"; +  cerr << "Points-to graph:\n";    for (unsigned i = 0, e = GraphNodes.size(); i != e; ++i) {      Node *N = &GraphNodes[i]; -    llvm_cerr << "[" << (N->end() - N->begin()) << "] "; +    cerr << "[" << (N->end() - N->begin()) << "] ";      PrintNode(N); -    llvm_cerr << "\t--> "; +    cerr << "\t--> ";      for (Node::iterator I = N->begin(), E = N->end(); I != E; ++I) { -      if (I != N->begin()) llvm_cerr << ", "; +      if (I != N->begin()) cerr << ", ";        PrintNode(*I);      } -    llvm_cerr << "\n"; +    cerr << "\n";    }  } diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index 128e11ebd7f..6e8ca184b43 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/lib/Analysis/IPA/CallGraph.cpp @@ -74,7 +74,7 @@ public:      AU.setPreservesAll();    } -  void print(llvm_ostream &o, const Module *M) const { +  void print(OStream &o, const Module *M) const {      if (o.stream()) print(*o.stream(), M);    } @@ -95,7 +95,7 @@ public:    /// dump - Print out this call graph.    ///    inline void dump() const { -    print(llvm_cerr, Mod); +    print(cerr, Mod);    }    CallGraphNode* getExternalCallingNode() const { return ExternalCallingNode; } @@ -212,7 +212,7 @@ void CallGraph::print(std::ostream &OS, const Module *M) const {  }  void CallGraph::dump() const { -  print(llvm_cerr, 0); +  print(cerr, 0);  }  //===----------------------------------------------------------------------===// @@ -275,7 +275,7 @@ void CallGraphNode::print(std::ostream &OS) const {    OS << "\n";  } -void CallGraphNode::dump() const { print(llvm_cerr); } +void CallGraphNode::dump() const { print(cerr); }  void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) {    for (unsigned i = CalledFunctions.size(); ; --i) { diff --git a/llvm/lib/Analysis/InstCount.cpp b/llvm/lib/Analysis/InstCount.cpp index 38f0bbaa9a7..04dfbf4cf97 100644 --- a/llvm/lib/Analysis/InstCount.cpp +++ b/llvm/lib/Analysis/InstCount.cpp @@ -43,7 +43,7 @@ namespace {  #include "llvm/Instruction.def"      void visitInstruction(Instruction &I) { -      llvm_cerr << "Instruction Count does not know about " << I; +      cerr << "Instruction Count does not know about " << I;        abort();      }    public: diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index 18957607ffe..b33e414bf04 100644 --- a/llvm/lib/Analysis/LoopInfo.cpp +++ b/llvm/lib/Analysis/LoopInfo.cpp @@ -80,7 +80,7 @@ void Loop::print(std::ostream &OS, unsigned Depth) const {  }  void Loop::dump() const { -  print(llvm_cerr); +  print(cerr);  } diff --git a/llvm/lib/Analysis/ProfileInfoLoader.cpp b/llvm/lib/Analysis/ProfileInfoLoader.cpp index 3c19f5e9b9f..b1ed235c10c 100644 --- a/llvm/lib/Analysis/ProfileInfoLoader.cpp +++ b/llvm/lib/Analysis/ProfileInfoLoader.cpp @@ -37,7 +37,7 @@ static void ReadProfilingBlock(const char *ToolName, FILE *F,    // Read the number of entries...    unsigned NumEntries;    if (fread(&NumEntries, sizeof(unsigned), 1, F) != 1) { -    llvm_cerr << ToolName << ": data packet truncated!\n"; +    cerr << ToolName << ": data packet truncated!\n";      perror(0);      exit(1);    } @@ -48,7 +48,7 @@ static void ReadProfilingBlock(const char *ToolName, FILE *F,    // Read in the block of data...    if (fread(&TempSpace[0], sizeof(unsigned)*NumEntries, 1, F) != 1) { -    llvm_cerr << ToolName << ": data packet truncated!\n"; +    cerr << ToolName << ": data packet truncated!\n";      perror(0);      exit(1);    } @@ -75,7 +75,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,                                       Module &TheModule) : M(TheModule) {    FILE *F = fopen(Filename.c_str(), "r");    if (F == 0) { -    llvm_cerr << ToolName << ": Error opening '" << Filename << "': "; +    cerr << ToolName << ": Error opening '" << Filename << "': ";      perror(0);      exit(1);    } @@ -93,7 +93,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,      case ArgumentInfo: {        unsigned ArgLength;        if (fread(&ArgLength, sizeof(unsigned), 1, F) != 1) { -        llvm_cerr << ToolName << ": arguments packet truncated!\n"; +        cerr << ToolName << ": arguments packet truncated!\n";          perror(0);          exit(1);        } @@ -104,7 +104,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,        if (ArgLength)          if (fread(&Chars[0], (ArgLength+3) & ~3, 1, F) != 1) { -          llvm_cerr << ToolName << ": arguments packet truncated!\n"; +          cerr << ToolName << ": arguments packet truncated!\n";            perror(0);            exit(1);          } @@ -129,7 +129,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,        break;      default: -      llvm_cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n"; +      cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n";        exit(1);      }    } @@ -156,7 +156,7 @@ void ProfileInfoLoader::getFunctionCounts(std::vector<std::pair<Function*,            Counts.push_back(std::make_pair(BlockCounts[i].first->getParent(),                                            BlockCounts[i].second));      } else { -      llvm_cerr << "Function counts are not available!\n"; +      cerr << "Function counts are not available!\n";      }      return;    } @@ -200,8 +200,8 @@ void ProfileInfoLoader::getBlockCounts(std::vector<std::pair<BasicBlock*,          if (SuccNum >= TI->getNumSuccessors()) {            static bool Warned = false;            if (!Warned) { -            llvm_cerr << "WARNING: profile info doesn't seem to match" -                      << " the program!\n"; +            cerr << "WARNING: profile info doesn't seem to match" +                 << " the program!\n";              Warned = true;            }          } else { @@ -226,7 +226,7 @@ void ProfileInfoLoader::getBlockCounts(std::vector<std::pair<BasicBlock*,        }      } else { -      llvm_cerr << "Block counts are not available!\n"; +      cerr << "Block counts are not available!\n";      }      return;    } @@ -247,8 +247,8 @@ void ProfileInfoLoader::getBlockCounts(std::vector<std::pair<BasicBlock*,  void ProfileInfoLoader::getEdgeCounts(std::vector<std::pair<Edge,                                                    unsigned> > &Counts) {    if (EdgeCounts.empty()) { -    llvm_cerr << "Edge counts not available, and no synthesis " -              << "is implemented yet!\n"; +    cerr << "Edge counts not available, and no synthesis " +         << "is implemented yet!\n";      return;    } @@ -268,9 +268,8 @@ void ProfileInfoLoader::getEdgeCounts(std::vector<std::pair<Edge,  //  void ProfileInfoLoader::getBBTrace(std::vector<BasicBlock *> &Trace) {    if (BBTrace.empty ()) { -    llvm_cerr << "Basic block trace is not available!\n"; +    cerr << "Basic block trace is not available!\n";      return;    } -  llvm_cerr << "Basic block trace loading is not implemented yet!\n"; +  cerr << "Basic block trace loading is not implemented yet!\n";  } - diff --git a/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp b/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp index 08a45c62c55..426bd18746e 100644 --- a/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp +++ b/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp @@ -76,8 +76,8 @@ bool LoaderPass::runOnModule(Module &M) {      TerminatorInst *TI = BB->getTerminator();      if (SuccNum >= TI->getNumSuccessors()) {        if (!PrintedWarning) { -        llvm_cerr << "WARNING: profile information is inconsistent with " -                  << "the current program!\n"; +        cerr << "WARNING: profile information is inconsistent with " +             << "the current program!\n";          PrintedWarning = true;        }      } else { diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index ba903e01406..9fc0c76b0e7 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -118,7 +118,7 @@ namespace {  //  SCEV::~SCEV() {}  void SCEV::dump() const { -  print(llvm_cerr); +  print(cerr);  }  /// getValueRange - Return the tightest constant bounds that this value is @@ -1558,11 +1558,11 @@ SCEVHandle ScalarEvolutionsImpl::ComputeIterationCount(const Loop *L) {      break;    default:  #if 0 -    llvm_cerr << "ComputeIterationCount "; +    cerr << "ComputeIterationCount ";      if (ExitCond->getOperand(0)->getType()->isUnsigned()) -      llvm_cerr << "[unsigned] "; -    llvm_cerr << *LHS << "   " -              << Instruction::getOpcodeName(Cond) << "   " << *RHS << "\n"; +      cerr << "[unsigned] "; +    cerr << *LHS << "   " +         << Instruction::getOpcodeName(Cond) << "   " << *RHS << "\n";  #endif      break;    } @@ -1678,9 +1678,9 @@ ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS,      if (!isa<ConstantBool>(Result)) break;  // Couldn't decide for sure      if (cast<ConstantBool>(Result)->getValue() == false) {  #if 0 -      llvm_cerr << "\n***\n*** Computed loop count " << *ItCst -                << "\n*** From global " << *GV << "*** BB: " << *L->getHeader() -                << "***\n"; +      cerr << "\n***\n*** Computed loop count " << *ItCst +           << "\n*** From global " << *GV << "*** BB: " << *L->getHeader() +           << "***\n";  #endif        ++NumArrayLenItCounts;        return SCEVConstant::get(ItCst);   // Found terminating iteration! @@ -2147,8 +2147,8 @@ SCEVHandle ScalarEvolutionsImpl::HowFarToZero(SCEV *V, const Loop *L) {      SCEVConstant *R2 = dyn_cast<SCEVConstant>(Roots.second);      if (R1) {  #if 0 -      llvm_cerr << "HFTZ: " << *V << " - sol#1: " << *R1 -                << "  sol#2: " << *R2 << "\n"; +      cerr << "HFTZ: " << *V << " - sol#1: " << *R1 +           << "  sol#2: " << *R2 << "\n";  #endif        // Pick the smallest positive root value.        assert(R1->getType()->isUnsigned()&&"Didn't canonicalize to unsigned?"); @@ -2276,8 +2276,8 @@ HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L) {      default: break;      } -    //llvm_cerr << "Computed Loop Trip Count as: " << -    //  *SCEV::getMinusSCEV(RHS, AddRec->getOperand(0)) << "\n"; +    //cerr << "Computed Loop Trip Count as: " +    //     << *SCEV::getMinusSCEV(RHS, AddRec->getOperand(0)) << "\n";      return SCEV::getMinusSCEV(RHS, AddRec->getOperand(0));    } @@ -2492,20 +2492,20 @@ static void PrintLoopInfo(std::ostream &OS, const ScalarEvolution *SE,    for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)      PrintLoopInfo(OS, SE, *I); -  llvm_cerr << "Loop " << L->getHeader()->getName() << ": "; +  cerr << "Loop " << L->getHeader()->getName() << ": ";    std::vector<BasicBlock*> ExitBlocks;    L->getExitBlocks(ExitBlocks);    if (ExitBlocks.size() != 1) -    llvm_cerr << "<multiple exits> "; +    cerr << "<multiple exits> ";    if (SE->hasLoopInvariantIterationCount(L)) { -    llvm_cerr << *SE->getIterationCount(L) << " iterations! "; +    cerr << *SE->getIterationCount(L) << " iterations! ";    } else { -    llvm_cerr << "Unpredictable iteration count. "; +    cerr << "Unpredictable iteration count. ";    } -  llvm_cerr << "\n"; +  cerr << "\n";  }  void ScalarEvolution::print(std::ostream &OS, const Module* ) const { diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp index 2698ace5b3a..9432cc278b9 100644 --- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp @@ -13,9 +13,8 @@  //  //===----------------------------------------------------------------------===// -#include "llvm/Analysis/LoopInfo.h"  #include "llvm/Analysis/ScalarEvolutionExpander.h" - +#include "llvm/Analysis/LoopInfo.h"  using namespace llvm;  /// InsertCastOfTo - Insert a cast of V to the specified type, doing what @@ -175,7 +174,7 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) {    SCEVHandle IH = SCEVUnknown::get(I);   // Get I as a "symbolic" SCEV.    SCEVHandle V = S->evaluateAtIteration(IH); -  //llvm_cerr << "Evaluated: " << *this << "\n     to: " << *V << "\n"; +  //cerr << "Evaluated: " << *this << "\n     to: " << *V << "\n";    return expandInTy(V, Ty);  } diff --git a/llvm/lib/Analysis/Trace.cpp b/llvm/lib/Analysis/Trace.cpp index d0457557c8e..a0aa955ebed 100644 --- a/llvm/lib/Analysis/Trace.cpp +++ b/llvm/lib/Analysis/Trace.cpp @@ -25,14 +25,13 @@ Function *Trace::getFunction() const {    return getEntryBasicBlock()->getParent();  } -  Module *Trace::getModule() const {    return getFunction()->getParent();  }  /// print - Write trace to output stream.  /// -void Trace::print(llvm_ostream &O) const { +void Trace::print(OStream &O) const {    Function *F = getFunction ();    O << "; Trace from function " << F->getName() << ", blocks:\n";    for (const_iterator i = begin(), e = end(); i != e; ++i) { @@ -48,5 +47,5 @@ void Trace::print(llvm_ostream &O) const {  /// output stream.  ///  void Trace::dump() const { -  print(llvm_cerr); +  print(cerr);  } | 

