[llvm-commits] CVS: llvm/tools/analyze/AnalysisWrappers.cpp GraphPrinters.cpp analyze.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Sep 19 21:48:16 PDT 2004



Changes in directory llvm/tools/analyze:

AnalysisWrappers.cpp updated: 1.14 -> 1.15
GraphPrinters.cpp updated: 1.8 -> 1.9
analyze.cpp updated: 1.61 -> 1.62
---
Log message:

'Pass' should now not be derived from by clients.  Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement 
ModulePass::runOnModule.


---
Diffs of the changes:  (+6 -6)

Index: llvm/tools/analyze/AnalysisWrappers.cpp
diff -u llvm/tools/analyze/AnalysisWrappers.cpp:1.14 llvm/tools/analyze/AnalysisWrappers.cpp:1.15
--- llvm/tools/analyze/AnalysisWrappers.cpp:1.14	Sun Jul 18 18:43:34 2004
+++ llvm/tools/analyze/AnalysisWrappers.cpp	Sun Sep 19 23:48:03 2004
@@ -28,8 +28,8 @@
   /// external functions that are called with constant arguments.  This can be
   /// useful when looking for standard library functions we should constant fold
   /// or handle in alias analyses.
-  struct ExternalFunctionsPassedConstants : public Pass {
-    virtual bool run(Module &M) {
+  struct ExternalFunctionsPassedConstants : public ModulePass {
+    virtual bool runOnModule(Module &M) {
       for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
         if (I->isExternal()) {
           bool PrintedFn = false;


Index: llvm/tools/analyze/GraphPrinters.cpp
diff -u llvm/tools/analyze/GraphPrinters.cpp:1.8 llvm/tools/analyze/GraphPrinters.cpp:1.9
--- llvm/tools/analyze/GraphPrinters.cpp:1.8	Wed Sep  1 17:55:37 2004
+++ llvm/tools/analyze/GraphPrinters.cpp	Sun Sep 19 23:48:03 2004
@@ -58,8 +58,8 @@
 
 
 namespace {
-  struct CallGraphPrinter : public Pass {
-    virtual bool run(Module &M) {
+  struct CallGraphPrinter : public ModulePass {
+    virtual bool runOnModule(Module &M) {
       WriteGraphToFile(std::cerr, "callgraph", &getAnalysis<CallGraph>());
       return false;
     }


Index: llvm/tools/analyze/analyze.cpp
diff -u llvm/tools/analyze/analyze.cpp:1.61 llvm/tools/analyze/analyze.cpp:1.62
--- llvm/tools/analyze/analyze.cpp:1.61	Wed Sep  1 17:55:37 2004
+++ llvm/tools/analyze/analyze.cpp	Sun Sep 19 23:48:03 2004
@@ -30,11 +30,11 @@
 
 using namespace llvm;
 
-struct ModulePassPrinter : public Pass {
+struct ModulePassPrinter : public ModulePass {
   const PassInfo *PassToPrint;
   ModulePassPrinter(const PassInfo *PI) : PassToPrint(PI) {}
 
-  virtual bool run(Module &M) {
+  virtual bool runOnModule(Module &M) {
     std::cout << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
     getAnalysisID<Pass>(PassToPrint).print(std::cout, &M);
     






More information about the llvm-commits mailing list