[llvm-commits] CVS: llvm/lib/Analysis/IPA/PrintSCC.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Sep 19 21:44:41 PDT 2004



Changes in directory llvm/lib/Analysis/IPA:

PrintSCC.cpp updated: 1.11 -> 1.12
---
Log message:

Finegrainify namespacification

'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:  (+4 -7)

Index: llvm/lib/Analysis/IPA/PrintSCC.cpp
diff -u llvm/lib/Analysis/IPA/PrintSCC.cpp:1.11 llvm/lib/Analysis/IPA/PrintSCC.cpp:1.12
--- llvm/lib/Analysis/IPA/PrintSCC.cpp:1.11	Wed Sep  1 17:55:35 2004
+++ llvm/lib/Analysis/IPA/PrintSCC.cpp	Sun Sep 19 23:44:31 2004
@@ -31,8 +31,7 @@
 #include "llvm/Support/CFG.h"
 #include "llvm/ADT/SCCIterator.h"
 #include <iostream>
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   struct CFGSCC : public FunctionPass {
@@ -45,9 +44,9 @@
     }
   };
 
-  struct CallGraphSCC : public Pass {
+  struct CallGraphSCC : public ModulePass {
     // run - Print out SCCs in the call graph for the specified module.
-    bool run(Module &M);
+    bool runOnModule(Module &M);
 
     void print(std::ostream &O) const { }
 
@@ -85,7 +84,7 @@
 
 
 // run - Print out SCCs in the call graph for the specified module.
-bool CallGraphSCC::run(Module &M) {
+bool CallGraphSCC::runOnModule(Module &M) {
   CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot();
   unsigned sccNum = 0;
   std::cout << "SCCs for the program in PostOrder:";
@@ -104,5 +103,3 @@
 
   return true;
 }
-
-} // End llvm namespace






More information about the llvm-commits mailing list