diff options
Diffstat (limited to 'tools/opt')
-rw-r--r-- | tools/opt/AnalysisWrappers.cpp | 1 | ||||
-rw-r--r-- | tools/opt/GraphPrinters.cpp | 7 | ||||
-rw-r--r-- | tools/opt/opt.cpp | 9 |
3 files changed, 7 insertions, 10 deletions
diff --git a/tools/opt/AnalysisWrappers.cpp b/tools/opt/AnalysisWrappers.cpp index 18360f837e93a..f548d007d78ed 100644 --- a/tools/opt/AnalysisWrappers.cpp +++ b/tools/opt/AnalysisWrappers.cpp @@ -22,7 +22,6 @@ #include "llvm/Support/CallSite.h" #include "llvm/Analysis/CallGraph.h" #include "llvm/Support/raw_ostream.h" -#include <iostream> using namespace llvm; namespace { diff --git a/tools/opt/GraphPrinters.cpp b/tools/opt/GraphPrinters.cpp index bbf8d122e7c7e..86f99324b953a 100644 --- a/tools/opt/GraphPrinters.cpp +++ b/tools/opt/GraphPrinters.cpp @@ -19,12 +19,11 @@ #include "llvm/Value.h" #include "llvm/Analysis/CallGraph.h" #include "llvm/Analysis/Dominators.h" -#include <iostream> -#include <fstream> +#include "llvm/Support/raw_ostream.h" using namespace llvm; template<typename GraphType> -static void WriteGraphToFile(std::ostream &O, const std::string &GraphName, +static void WriteGraphToFile(raw_ostream &O, const std::string &GraphName, const GraphType >) { std::string Filename = GraphName + ".dot"; O << "Writing '" << Filename << "'..."; @@ -69,7 +68,7 @@ namespace { CallGraphPrinter() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { - WriteGraphToFile(std::cerr, "callgraph", &getAnalysis<CallGraph>()); + WriteGraphToFile(llvm::errs(), "callgraph", &getAnalysis<CallGraph>()); return false; } diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 311f67173f376..ff19942ead890 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -141,15 +141,14 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass { CallGraphSCCPassPrinter(const PassInfo *PI) : CallGraphSCCPass(&ID), PassToPrint(PI) {} - virtual bool runOnSCC(std::vector<CallGraphNode *>&SCC) { + virtual bool runOnSCC(CallGraphSCC &SCC) { if (!Quiet) { outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - for (unsigned i = 0, e = SCC.size(); i != e; ++i) { - Function *F = SCC[i]->getFunction(); - if (F) { + for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { + Function *F = (*I)->getFunction(); + if (F) getAnalysisID<Pass>(PassToPrint).print(outs(), F->getParent()); - } } } // Get and print pass... |