From becb20825e1c0d57bc52c387c86500e9cbcb29ee Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 6 Oct 2014 22:59:29 +0000 Subject: [PATCH] range-for some loops in DAE git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219167 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/DeadArgumentElimination.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index 7b22e921814..da4f0326f19 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -1093,8 +1093,8 @@ bool DAE::runOnModule(Module &M) { // determine that dead arguments passed into recursive functions are dead). // DEBUG(dbgs() << "DAE - Determining liveness\n"); - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - SurveyFunction(*I); + for (auto &F : M) + SurveyFunction(F); // Now, remove all dead arguments and return values from each function in // turn. @@ -1107,11 +1107,8 @@ bool DAE::runOnModule(Module &M) { // Finally, look for any unused parameters in functions with non-local // linkage and replace the passed in parameters with undef. - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { - Function& F = *I; - + for (auto &F : M) Changed |= RemoveDeadArgumentsFromCallers(F); - } return Changed; }