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

Chris Lattner lattner at cs.uiuc.edu
Wed Mar 3 14:59:25 PST 2004


Changes in directory llvm/lib/Analysis/DataStructure:

DataStructure.cpp updated: 1.164 -> 1.165

---
Log message:

Deinline methods, add fast exit


---
Diffs of the changes:  (+27 -0)

Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.164 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.165
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.164	Tue Mar  2 23:34:31 2004
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp	Wed Mar  3 14:55:27 2004
@@ -1191,6 +1191,10 @@
                            const DSGraph &Graph, unsigned CloneFlags) {
   TIME_REGION(X, "mergeInGraph");
 
+  // Fastpath for a noop inline.
+  if (CS.getNumPtrArgs() == 0 && CS.getRetVal().isNull())
+    return;
+
   // If this is not a recursive call, clone the graph into this graph...
   if (&Graph != this) {
     // Clone the callee's graph into the current graph, keeping track of where
@@ -1797,6 +1801,29 @@
     delete DeadNodes[i];
 
   DEBUG(AssertGraphOK(); GlobalsGraph->AssertGraphOK());
+}
+
+void DSGraph::AssertCallSiteInGraph(const DSCallSite &CS) const {
+  if (CS.isIndirectCall()) {
+    AssertNodeInGraph(CS.getCalleeNode());
+#if 0
+    if (CS.getNumPtrArgs() && CS.getCalleeNode() == CS.getPtrArg(0).getNode() &&
+        CS.getCalleeNode() && CS.getCalleeNode()->getGlobals().empty())
+      std::cerr << "WARNING: WIERD CALL SITE FOUND!\n";      
+#endif
+  }
+  AssertNodeInGraph(CS.getRetVal().getNode());
+  for (unsigned j = 0, e = CS.getNumPtrArgs(); j != e; ++j)
+    AssertNodeInGraph(CS.getPtrArg(j).getNode());
+}
+
+void DSGraph::AssertCallNodesInGraph() const {
+  for (unsigned i = 0, e = FunctionCalls.size(); i != e; ++i)
+    AssertCallSiteInGraph(FunctionCalls[i]);
+}
+void DSGraph::AssertAuxCallNodesInGraph() const {
+  for (unsigned i = 0, e = AuxFunctionCalls.size(); i != e; ++i)
+    AssertCallSiteInGraph(AuxFunctionCalls[i]);
 }
 
 void DSGraph::AssertGraphOK() const {





More information about the llvm-commits mailing list