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

John Criswell criswell at uiuc.edu
Tue Aug 17 13:17:21 PDT 2010


Author: criswell
Date: Tue Aug 17 15:17:21 2010
New Revision: 111272

URL: http://llvm.org/viewvc/llvm-project?rev=111272&view=rev
Log:
Added comments.
No functionality changes.

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=111272&r1=111271&r2=111272&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Tue Aug 17 15:17:21 2010
@@ -690,12 +690,23 @@
     if (CS.isIndirectCall()) {
       eraseCS = false;
       if (CS.getCalleeNode()->isCompleteNode()) {
+        //
+        // Get the list of callees associated with the DSNode and remove those
+        // that are external functions (i.e., have no function body).
+        //
         std::vector<const Function*> NodeCallees;
         CS.getCalleeNode()->addFullFunctionList(NodeCallees);
         std::vector<const Function*>::iterator ErasePoint =
                 std::remove_if(NodeCallees.begin(), NodeCallees.end(),
                                std::mem_fun(&Function::isDeclaration));
         NodeCallees.erase(ErasePoint, NodeCallees.end());
+
+        //
+        // Only erase this call site if there's nothing left to do for it.
+        // This means that all of the function targets recorded in the DSNode
+        // have already been incorporated into the call graph that we've been
+        // constructing.
+        //
         std::sort(CalledFuncs.begin(), CalledFuncs.end());
         std::sort(NodeCallees.begin(), NodeCallees.end());
         eraseCS = std::includes(CalledFuncs.begin(), CalledFuncs.end(),





More information about the llvm-commits mailing list