[llvm-commits] [poolalloc] r108170 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp

John Criswell criswell at uiuc.edu
Mon Jul 12 11:18:35 PDT 2010


Author: criswell
Date: Mon Jul 12 13:18:34 2010
New Revision: 108170

URL: http://llvm.org/viewvc/llvm-project?rev=108170&view=rev
Log:
If the target of an indirect function call has no body, don't transform the
call.
This fixes PR#7628.

Modified:
    poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp

Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=108170&r1=108169&r2=108170&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Mon Jul 12 13:18:34 2010
@@ -30,15 +30,6 @@
 using namespace llvm;
 using namespace PA;
 
-//
-// Flag: UsingBugpoint
-//
-// Description:
-//  There are certain assertions that interfere with bugpoint's ability to
-//  reduce test cases.  When using bugpoint, set this variable to true.
-//
-static bool UsingBugpoint = false;
-
 namespace {
   /// FuncTransform - This class implements transformation required of pool
   /// allocated functions.
@@ -828,11 +819,18 @@
     //
     if (!CF) return;
 
+    //
+    // It's possible that this program has indirect call targets that are
+    // not defined in this module.  Do not transformation for such functions.
+    //
+    if (!(Graphs.hasDSGraph(*CF))) return;
+
+    //
     // Get the common graph for the set of functions this call may invoke.
-    if (UsingBugpoint && (!(Graphs.hasDSGraph(*CF)))) return;
+    //
     assert ((Graphs.hasDSGraph(*CF)) && "Function has no DSGraph!\n");
     CalleeGraph = Graphs.getDSGraph(*CF);
-    
+
 #ifndef NDEBUG
     // Verify that all potential callees at call site have the same DS graph.
     DSCallGraph::callee_iterator E = Graphs.getCallGraph().callee_end(OrigInst);





More information about the llvm-commits mailing list