diff options
author | Davide Italiano <davide@freebsd.org> | 2016-05-14 20:59:09 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2016-05-14 20:59:09 +0000 |
commit | e7c56c5c4f829b618e81518f20cc327448c80251 (patch) | |
tree | 9247e25ecd37519555d677ce921da17920872a77 | |
parent | c048b6c4cd1025ae8144ea77b3ed7c43edb1c153 (diff) | |
download | bcm5719-llvm-e7c56c5c4f829b618e81518f20cc327448c80251.tar.gz bcm5719-llvm-e7c56c5c4f829b618e81518f20cc327448c80251.zip |
[SCCP] Use range-based for loops. NFC.
llvm-svn: 269578
-rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index c75c948329c..e9fe766ba6f 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -1702,32 +1702,32 @@ static bool runIPSCCP(Module &M, const DataLayout &DL, // Loop over all functions, marking arguments to those with their addresses // taken or that are external as overdefined. // - for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) { - if (F->isDeclaration()) + for (Function &F : M) { + if (F.isDeclaration()) continue; // If this is an exact definition of this function, then we can propagate // information about its result into callsites of it. - if (F->hasExactDefinition()) - Solver.AddTrackedFunction(&*F); + if (F.hasExactDefinition()) + Solver.AddTrackedFunction(&F); // If this function only has direct calls that we can see, we can track its // arguments and return value aggressively, and can assume it is not called // unless we see evidence to the contrary. - if (F->hasLocalLinkage()) { - if (AddressIsTaken(&*F)) - AddressTakenFunctions.insert(&*F); + if (F.hasLocalLinkage()) { + if (AddressIsTaken(&F)) + AddressTakenFunctions.insert(&F); else { - Solver.AddArgumentTrackedFunction(&*F); + Solver.AddArgumentTrackedFunction(&F); continue; } } // Assume the function is called. - Solver.MarkBlockExecutable(&F->front()); + Solver.MarkBlockExecutable(&F.front()); // Assume nothing about the incoming arguments. - for (Argument &AI : F->args()) + for (Argument &AI : F.args()) Solver.markAnythingOverdefined(&AI); } |