#include "llvm/Module.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Support/CFG.h"
-#include "Support/SCCIterator.h"
+#include "llvm/ADT/SCCIterator.h"
#include <iostream>
-
-namespace llvm {
+using namespace llvm;
namespace {
struct CFGSCC : public FunctionPass {
bool runOnFunction(Function& func);
- void print(std::ostream &O) const { }
+ void print(std::ostream &O, const Module* = 0) const { }
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
}
};
- 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 { }
+ void print(std::ostream &O, const Module* = 0) const { }
// getAnalysisUsage - This pass requires the CallGraph.
virtual void getAnalysisUsage(AnalysisUsage &AU) 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