Add new method

llvm-svn: 7007
This commit is contained in:
Chris Lattner
2003-06-30 05:57:30 +00:00
parent f8865a4389
commit bfce1115e3
2 changed files with 21 additions and 0 deletions

View File

@@ -703,6 +703,23 @@ Function &DSCallSite::getCaller() const {
// 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;