[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/EquivClassGraphs.h PoolAllocate.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Mar 10 16:01:12 PST 2005



Changes in directory llvm-poolalloc/lib/PoolAllocate:

EquivClassGraphs.h updated: 1.13 -> 1.14
PoolAllocate.cpp updated: 1.106 -> 1.107
---
Log message:

Fix some crashes noted by John Mellor-Crummey's group.


---
Diffs of the changes:  (+11 -3)

 EquivClassGraphs.h |    6 ++++++
 PoolAllocate.cpp   |    8 +++++---
 2 files changed, 11 insertions(+), 3 deletions(-)


Index: llvm-poolalloc/lib/PoolAllocate/EquivClassGraphs.h
diff -u llvm-poolalloc/lib/PoolAllocate/EquivClassGraphs.h:1.13 llvm-poolalloc/lib/PoolAllocate/EquivClassGraphs.h:1.14
--- llvm-poolalloc/lib/PoolAllocate/EquivClassGraphs.h:1.13	Tue Nov  2 11:51:11 2004
+++ llvm-poolalloc/lib/PoolAllocate/EquivClassGraphs.h	Thu Mar 10 18:00:56 2005
@@ -71,6 +71,12 @@
       return *I->second;
     }
 
+    /// ContainsDSGraphFor - Return true if we have a graph for the specified
+    /// function.
+    bool ContainsDSGraphFor(const Function &F) const {
+      return DSInfo.find(&F) != DSInfo.end();
+    }
+
     /// getSomeCalleeForCallSite - Return any one callee function at
     /// a call site.
     /// 


Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.106 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.107
--- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.106	Sun Feb 27 16:30:33 2005
+++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp	Thu Mar 10 18:00:56 2005
@@ -87,7 +87,7 @@
   // Loop over the functions in the original program finding the pool desc.
   // arguments necessary for each function that is indirectly callable.
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal())
+    if (!I->isExternal() && ECGraphs->ContainsDSGraphFor(*I))
       FindFunctionPoolArgs(*I);
 
   std::map<Function*, Function*> FuncMap;
@@ -98,7 +98,8 @@
   // its clone.
   std::set<Function*> ClonedFunctions;
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal() && !ClonedFunctions.count(I))
+    if (!I->isExternal() && !ClonedFunctions.count(I) &&
+        ECGraphs->ContainsDSGraphFor(*I))
       if (Function *Clone = MakeFunctionClone(*I)) {
         FuncMap[I] = Clone;
         ClonedFunctions.insert(Clone);
@@ -107,7 +108,8 @@
   // Now that all call targets are available, rewrite the function bodies of the
   // clones.
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal() && !ClonedFunctions.count(I)) {
+    if (!I->isExternal() && !ClonedFunctions.count(I) &&
+        ECGraphs->ContainsDSGraphFor(*I)) {
       std::map<Function*, Function*>::iterator FI = FuncMap.find(I);
       ProcessFunctionBody(*I, FI != FuncMap.end() ? *FI->second : *I);
     }






More information about the llvm-commits mailing list