コード例 #1
0
ファイル: core.cpp プロジェクト: sp4r74n-117/mC
	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;
	}