#include "llvm/CallGraphSCCPass.h"
#include "llvm/Analysis/CallGraph.h"
-#include "Support/SCCIterator.h"
-
-namespace llvm {
+#include "llvm/ADT/SCCIterator.h"
+using namespace llvm;
/// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should
AU.addPreserved<CallGraph>();
}
-bool CallGraphSCCPass::run(Module &M) {
+bool CallGraphSCCPass::runOnModule(Module &M) {
CallGraph &CG = getAnalysis<CallGraph>();
- bool Changed = false;
+ bool Changed = doInitialization(CG);
for (scc_iterator<CallGraph*> I = scc_begin(&CG), E = scc_end(&CG);
I != E; ++I)
Changed = runOnSCC(*I);
- return Changed;
+ return Changed | doFinalization(CG);
}
-
-} // End llvm namespace