[poolalloc] r238380 - BU: Avoid variable shadowing, C++11-ify loops while at it. NFC.

Will Dietz wdietz2 at illinois.edu
Wed May 27 16:33:00 PDT 2015


Author: wdietz2
Date: Wed May 27 18:33:00 2015
New Revision: 238380

URL: http://llvm.org/viewvc/llvm-project?rev=238380&view=rev
Log:
BU: Avoid variable shadowing, C++11-ify loops while at it.  NFC.

Modified:
    poolalloc/trunk/lib/DSA/BottomUpClosure.cpp

Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=238380&r1=238379&r2=238380&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Wed May 27 18:33:00 2015
@@ -632,11 +632,9 @@ void BUDataStructures::calculateGraph(DS
   DSGraph::FunctionListTy &AuxCallsList = Graph->getAuxFunctionCalls();
   TempFCs.swap(AuxCallsList);
 
-  for(DSGraph::FunctionListTy::iterator I = TempFCs.begin(), E = TempFCs.end();
-      I != E; ++I) {
+  for (auto &CS : TempFCs) {
     DEBUG(Graph->AssertGraphOK(); Graph->getGlobalsGraph()->AssertGraphOK());
 
-    DSCallSite &CS = *I;
 
     // Fast path for noop calls.  Note that we don't care about merging globals
     // in the callee with nodes in the caller here.
@@ -676,9 +674,7 @@ void BUDataStructures::calculateGraph(DS
 
     DSGraph *GI;
 
-    for (FuncSet::iterator I = CalledFuncs.begin(), E = CalledFuncs.end();
-         I != E; ++I) {
-      const Function *Callee = *I;
+    for (auto *Callee : CalledFuncs) {
       // Get the data structure graph for the called function.
 
       GI = getDSGraph(*Callee);  // Graph to inline





More information about the llvm-commits mailing list