[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Jun 30 00:58:04 PDT 2003
Changes in directory llvm/lib/Analysis/DataStructure:
DataStructure.cpp updated: 1.109 -> 1.110
---
Log message:
Add new method
---
Diffs of the changes:
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.109 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.110
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.109 Mon Jun 30 00:27:18 2003
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Mon Jun 30 00:57:30 2003
@@ -703,6 +703,23 @@
// DSGraph Implementation
//===----------------------------------------------------------------------===//
+/// getFunctionNames - Return a space separated list of the name of the
+/// functions in this graph (if any)
+std::string DSGraph::getFunctionNames() const {
+ switch (getReturnNodes().size()) {
+ case 0: return "Globals graph";
+ case 1: return getReturnNodes().begin()->first->getName();
+ default:
+ std::string Return;
+ for (DSGraph::ReturnNodesTy::const_iterator I = getReturnNodes().begin();
+ I != getReturnNodes().end(); ++I)
+ Return += I->first->getName() + " ";
+ Return.erase(Return.end()-1, Return.end()); // Remove last space character
+ return Return;
+ }
+}
+
+
DSGraph::DSGraph(const DSGraph &G) : GlobalsGraph(0) {
PrintAuxCalls = false;
NodeMapTy NodeMap;
More information about the llvm-commits
mailing list