[llvm-commits] [poolalloc] r117591 - /poolalloc/trunk/lib/DSA/TopDownClosure.cpp

Will Dietz wdietz2 at illinois.edu
Thu Oct 28 12:57:01 PDT 2010


Author: wdietz2
Date: Thu Oct 28 14:57:00 2010
New Revision: 117591

URL: http://llvm.org/viewvc/llvm-project?rev=117591&view=rev
Log:
Mark functions that are Incomplete or External in the globals as 'externally callable'.
We used to only make functions /reachable/ from incomplete or external as such.

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

Modified: poolalloc/trunk/lib/DSA/TopDownClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TopDownClosure.cpp?rev=117591&r1=117590&r2=117591&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/TopDownClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/TopDownClosure.cpp Thu Oct 28 14:57:00 2010
@@ -58,6 +58,13 @@
   if (!N || Visited.count(N)) return;
   Visited.insert(N);
 
+  // Handle this node
+  {
+    std::vector<const Function*> Functions;
+    N->addFullFunctionList(Functions);
+    ArgsRemainIncomplete.insert(Functions.begin(), Functions.end());
+  }
+
   for (DSNode::edge_iterator ii = N->edge_begin(),
           ee = N->edge_end(); ii != ee; ++ii)
     if (!ii->second.isNull()) {
@@ -112,6 +119,14 @@
     if (!I->isDeclaration() && !I->hasInternalLinkage())
       ArgsRemainIncomplete.insert(I);
 
+  // Debug code to print the functions that are externally callable
+#if 0
+  for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
+    if (ArgsRemainIncomplete.count(I)) {
+      errs() << "ArgsRemainIncomplete: " << I->getNameStr() << "\n";
+    }
+#endif
+
   // We want to traverse the call graph in reverse post-order.  To do this, we
   // calculate a post-order traversal, then reverse it.
   svset<DSGraph*> VisitedGraph;





More information about the llvm-commits mailing list