llvm.org GIT mirror llvm / a9d6566
Add new method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7007 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
3 changed file(s) with 25 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
7878 ///
7979 const std::vector &getNodes() const { return Nodes; }
8080 std::vector &getNodes() { return Nodes; }
81
82 /// getFunctionNames - Return a space separated list of the name of the
83 /// functions in this graph (if any)
84 std::string getFunctionNames() const;
8185
8286 /// addNode - Add a new node to the graph.
8387 ///
7878 ///
7979 const std::vector &getNodes() const { return Nodes; }
8080 std::vector &getNodes() { return Nodes; }
81
82 /// getFunctionNames - Return a space separated list of the name of the
83 /// functions in this graph (if any)
84 std::string getFunctionNames() const;
8185
8286 /// addNode - Add a new node to the graph.
8387 ///
701701 //===----------------------------------------------------------------------===//
702702 // DSGraph Implementation
703703 //===----------------------------------------------------------------------===//
704
705 /// getFunctionNames - Return a space separated list of the name of the
706 /// functions in this graph (if any)
707 std::string DSGraph::getFunctionNames() const {
708 switch (getReturnNodes().size()) {
709 case 0: return "Globals graph";
710 case 1: return getReturnNodes().begin()->first->getName();
711 default:
712 std::string Return;
713 for (DSGraph::ReturnNodesTy::const_iterator I = getReturnNodes().begin();
714 I != getReturnNodes().end(); ++I)
715 Return += I->first->getName() + " ";
716 Return.erase(Return.end()-1, Return.end()); // Remove last space character
717 return Return;
718 }
719 }
720
704721
705722 DSGraph::DSGraph(const DSGraph &G) : GlobalsGraph(0) {
706723 PrintAuxCalls = false;