X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fopt%2FAnalysisWrappers.cpp;h=4bdc268f8d7594d54bb0b6e5ba9b1c23e38556b8;hb=a37512049cdc8adc0e6fa034095c8afe514ef24d;hp=b9c627d8f5ed6f03d153fb35a6c0c20a8f2a52d3;hpb=4bbfbdf7d7a3c4dbdd2d7bb190ef8a0a8246c218;p=oota-llvm.git diff --git a/tools/opt/AnalysisWrappers.cpp b/tools/opt/AnalysisWrappers.cpp index b9c627d8f5e..4bdc268f8d7 100644 --- a/tools/opt/AnalysisWrappers.cpp +++ b/tools/opt/AnalysisWrappers.cpp @@ -32,17 +32,16 @@ namespace { struct ExternalFunctionsPassedConstants : public ModulePass { static char ID; // Pass ID, replacement for typeid ExternalFunctionsPassedConstants() : ModulePass(ID) {} - virtual bool runOnModule(Module &M) { + bool runOnModule(Module &M) override { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { if (!I->isDeclaration()) continue; bool PrintedFn = false; - for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); - UI != E; ++UI) { - Instruction *User = dyn_cast(*UI); - if (!User) continue; + for (User *U : I->users()) { + Instruction *UI = dyn_cast(U); + if (!UI) continue; - CallSite CS(cast(User)); + CallSite CS(cast(UI)); if (!CS) continue; for (CallSite::arg_iterator AI = CS.arg_begin(), @@ -53,7 +52,7 @@ namespace { errs() << "Function '" << I->getName() << "':\n"; PrintedFn = true; } - errs() << *User; + errs() << *UI; break; } } @@ -62,7 +61,7 @@ namespace { return false; } - virtual void getAnalysisUsage(AnalysisUsage &AU) const { + void getAnalysisUsage(AnalysisUsage &AU) const override { AU.setPreservesAll(); } }; @@ -78,11 +77,11 @@ namespace { static char ID; // Pass ID, replacement for typeid CallGraphPrinter() : ModulePass(ID) {} - virtual void getAnalysisUsage(AnalysisUsage &AU) const { + void getAnalysisUsage(AnalysisUsage &AU) const override { AU.setPreservesAll(); AU.addRequiredTransitive(); } - virtual bool runOnModule(Module &M) { + bool runOnModule(Module &M) override { getAnalysis().print(errs(), &M); return false; }