struct CFGSCC : public FunctionPass {
static char ID; // Pass identification, replacement for typeid
CFGSCC() : FunctionPass(ID) {}
- bool runOnFunction(Function& func);
+ bool runOnFunction(Function& func) override;
- void print(raw_ostream &O, const Module* = 0) const { }
+ void print(raw_ostream &O, const Module* = nullptr) const override { }
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
};
CallGraphSCC() : ModulePass(ID) {}
// run - Print out SCCs in the call graph for the specified module.
- bool runOnModule(Module &M);
+ bool runOnModule(Module &M) override;
- void print(raw_ostream &O, const Module* = 0) const { }
+ void print(raw_ostream &O, const Module* = nullptr) const override { }
// getAnalysisUsage - This pass requires the CallGraph.
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<CallGraphWrapperPass>();
}
unsigned sccNum = 0;
errs() << "SCCs for Function " << F.getName() << " in PostOrder:";
for (scc_iterator<Function*> SCCI = scc_begin(&F); !SCCI.isAtEnd(); ++SCCI) {
- std::vector<BasicBlock*> &nextSCC = *SCCI;
+ const std::vector<BasicBlock *> &nextSCC = *SCCI;
errs() << "\nSCC #" << ++sccNum << " : ";
for (std::vector<BasicBlock*>::const_iterator I = nextSCC.begin(),
E = nextSCC.end(); I != E; ++I)