Use the getFunctionNames method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7008 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/DataStructure/Printer.cpp b/lib/Analysis/DataStructure/Printer.cpp
index f568c8d..9c0c5d1 100644
--- a/lib/Analysis/DataStructure/Printer.cpp
+++ b/lib/Analysis/DataStructure/Printer.cpp
@@ -68,14 +68,9 @@
 struct DOTGraphTraits<const DSGraph*> : public DefaultDOTGraphTraits {
   static std::string getGraphName(const DSGraph *G) {
     switch (G->getReturnNodes().size()) {
-    case 0: return "Global graph";
-    case 1: return "Function " + G->getReturnNodes().begin()->first->getName();
-    default:
-      std::string Return = "Functions: ";
-      for (DSGraph::ReturnNodesTy::const_iterator I=G->getReturnNodes().begin();
-           I != G->getReturnNodes().end(); ++I)
-        Return += I->first->getName() + " ";
-      return Return;
+    case 0: return G->getFunctionNames();
+    case 1: return "Function " + G->getFunctionNames();
+    default: return "Functions: " + G->getFunctionNames();
     }
   }