[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Mar 23 12:12:21 PST 2005



Changes in directory llvm/lib/Analysis/DataStructure:

DataStructure.cpp updated: 1.229 -> 1.230
---
Log message:

turn a dead conditional into an assert.


---
Diffs of the changes:  (+5 -9)

 DataStructure.cpp |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)


Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.229 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.230
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.229	Wed Mar 23 14:08:59 2005
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp	Wed Mar 23 14:12:08 2005
@@ -1347,6 +1347,9 @@
                            const DSGraph &Graph, unsigned CloneFlags) {
   TIME_REGION(X, "mergeInGraph");
 
+  assert((CloneFlags & DontCloneCallNodes) &&
+         "Doesn't support copying of call nodes!");
+
   // If this is not a recursive call, clone the graph into this graph...
   if (&Graph == this) {
     // Merge the return value with the return value of the context.
@@ -1381,13 +1384,6 @@
     RC.merge(CS.getPtrArg(i), Args[i+1]);
   }
     
-  // If requested, copy all of the calls.
-  if (!(CloneFlags & DontCloneCallNodes)) {
-    // Copy the function calls list.
-    for (fc_iterator I = Graph.fc_begin(), E = Graph.fc_end(); I != E; ++I)
-      FunctionCalls.push_back(DSCallSite(*I, RC));
-  }
-
   // If the user has us copying aux calls (the normal case), set up a data
   // structure to keep track of which ones we've copied over.
   std::set<const DSCallSite*> CopiedAuxCall;
@@ -1405,10 +1401,10 @@
 
       // If requested, copy any aux calls that can reach copied nodes.
       for (afc_iterator I = Graph.afc_begin(), E = Graph.afc_end(); I!=E; ++I)
-        if (CopiedAuxCall.insert(&*I).second &&
-            PathExistsToClonedNode(*I, RC)) {
+        if (!CopiedAuxCall.count(&*I) && PathExistsToClonedNode(*I, RC)) {
           AuxFunctionCalls.push_back(DSCallSite(*I, RC));
           MadeChange = true;
+          CopiedAuxCall.insert(&*I);
         }
     }
 }






More information about the llvm-commits mailing list