bool dumpTo(const ProgramPtr& program, const std::string& dir) { // first of all, we want to dump the callgraph auto callgraph = analysis::callgraph::getCallGraph(program); if (!dumpTo(dir + "/callgraph.dot", toString(callgraph))) return false; // finally, generate a file for each function for (const auto& fun : program->getFunctions()) { if (!dumpTo(dir + "/" + analysis::callgraph::getFunctionName(fun) + ".dot", toString(*fun))) return false; } return true; }