[llvm-commits] [poolalloc] r122746 - /poolalloc/trunk/lib/DSA/BottomUpClosure.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Mon Jan 3 02:57:02 PST 2011


Author: aggarwa4
Date: Mon Jan  3 04:57:02 2011
New Revision: 122746

URL: http://llvm.org/viewvc/llvm-project?rev=122746&view=rev
Log:
Formatting changes. 
No functionality change.

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=122746&r1=122745&r2=122746&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Mon Jan  3 04:57:02 2011
@@ -51,11 +51,8 @@
 // BU:
 // Construct the callgraph from the local graphs
 // Find SCCs
-// inline bottum up
+// inline bottom up
 //
-// We must split these out (they were merged in PLDI07) to handle multiple
-// entry-points correctly.  As a bonus, we can be more aggressive at propagating
-// information upwards, as long as we don't remove unresolved call sites.
 bool BUDataStructures::runOnModuleInternal(Module& M) {
 
   //
@@ -98,7 +95,7 @@
   // Merge the globals variables (not the calls) from the globals graph back
   // into the individual function's graph so that changes made to globals during
   // BU can be reflected. This is specifically needed for correct call graph
-
+  //
   for (Module::iterator F = M.begin(); F != M.end(); ++F) {
     if (!(F->isDeclaration())){
       DSGraph *Graph  = getOrCreateGraph(F);
@@ -112,10 +109,13 @@
       Graph->computeIntPtrFlags();
     }
   }
+
+  // Once the correct flags have been calculated. Update the callgraph.
   for (Module::iterator F = M.begin(); F != M.end(); ++F) {
     if (!(F->isDeclaration())){
       DSGraph *Graph = getOrCreateGraph(F);
-      Graph->buildCompleteCallGraph(callgraph, GlobalFunctionList, filterCallees);
+      Graph->buildCompleteCallGraph(callgraph,
+                                    GlobalFunctionList, filterCallees);
     }
   }
 
@@ -140,11 +140,10 @@
 
   std::vector<const Function*>::iterator I = Callees.begin();
   CallSite CS = DCS.getCallSite();
-  while(I != Callees.end()) {
+  while (I != Callees.end()) {
     if (functionIsCallable(CS, *I)) {
       ++I;
-    }
-    else {
+    } else {
       I = Callees.erase(I);
     }
   }
@@ -229,13 +228,13 @@
   unsigned NextID = 1;
 
 
-  // do post order traversal on the global ctors. Use this information to update
+  // Do post order traversal on the global ctors. Use this information to update
   // the globals graph.
   const char *Name = "llvm.global_ctors";
   GlobalVariable *GV = M.getNamedGlobal(Name);
-  if (GV && !(GV->isDeclaration()) && !(GV->hasLocalLinkage())){
-  // Should be an array of '{ int, void ()* }' structs.  The first value is
-  // the init priority, which we ignore.
+  if (GV && !(GV->isDeclaration()) && !(GV->hasLocalLinkage())) {
+    // Should be an array of '{ int, void ()* }' structs.  The first value is
+    // the init priority, which we ignore.
     ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
     if (InitList) {
       for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i)
@@ -263,7 +262,7 @@
                         DSGraph::DontCloneAuxCallNodes);
           }
         }
-      }
+    }
   }
  
   //
@@ -288,7 +287,6 @@
       calculateGraphs(I, Stack, NextID, ValMap);     // Calculate all graphs.
       CloneAuxIntoGlobal(getDSGraph(*I));
     }
-
   return;
 }
 
@@ -471,7 +469,7 @@
 //
 // Description:
 //  This method takes the specified graph and processes each unresolved call
-//  site (a call site for which all targets are not yet known).  For each
+//  site (a call site for which all targets are not yet known). For each
 //  unresolved call site, it adds it to the globals graph and merges
 //  information about the call site if the globals graph already had the call
 //  site in its own list of unresolved call sites.
@@ -620,7 +618,6 @@
   cloneIntoGlobals(Graph, DSGraph::DontCloneCallNodes |
                         DSGraph::DontCloneAuxCallNodes |
                         DSGraph::StripAllocaBit);
-  //Graph.writeGraphToFile(cerr, "bu_" + F.getName());
-
+  //Graph->writeGraphToFile(cerr, "bu_" + F.getName());
 }
 





More information about the llvm-commits mailing list