'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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16434
91177308-0d34-0410-b5e6-
96231b3b80d8
#include "llvm/Support/CFG.h"
#include "llvm/ADT/SCCIterator.h"
#include <iostream>
-
-namespace llvm {
+using namespace llvm;
namespace {
struct CFGSCC : public FunctionPass {
}
};
- 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 { }
// 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:";
return true;
}
-
-} // End llvm namespace
#include "llvm/Support/CFG.h"
#include "llvm/ADT/SCCIterator.h"
#include <iostream>
-
-namespace llvm {
+using namespace llvm;
namespace {
struct CFGSCC : public FunctionPass {
}
};
- 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 { }
// 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:";
return true;
}
-
-} // End llvm namespace
#include "llvm/Support/CFG.h"
#include "llvm/ADT/SCCIterator.h"
#include <iostream>
-
-namespace llvm {
+using namespace llvm;
namespace {
struct CFGSCC : public FunctionPass {
}
};
- 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 { }
// 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:";
return true;
}
-
-} // End llvm namespace