5 #include <AstInterface.h>
6 #include <GraphDotOutput.h>
7 #include <VirtualGraphCreate.h>
9 #include "AstDiagnostics.h"
16 #include <boost/foreach.hpp>
17 #include <boost/unordered_map.hpp>
31 namespace CallTargetSet
56 Rose_STL_Container<SgFunctionDeclaration*>& propList,
57 bool includePureVirtualFunc =
false);
65 Rose_STL_Container<SgFunctionDefinition*>& calleeList);
71 Rose_STL_Container<SgFunctionDeclaration*>& calleeList,
72 bool includePureVirtualFunc =
false);
79 Rose_STL_Container<SgExpression*>& exps);
108 struct dummyFilter :
public std::unary_function<bool,SgFunctionDeclaration*>
125 void buildCallGraph();
127 template<
typename Predicate>
128 void buildCallGraph(Predicate pred);
140 typedef boost::unordered_map<SgFunctionDeclaration*, SgGraphNode*>
GraphNodes;
152 result_type operator()(
SgNode* node );
155 template<
typename Predicate>
162 isSelected(Predicate &pred): pred(pred) {}
163 bool operator()(
SgNode *node) {
173 std::vector<FunctionData> callGraphData;
178 std::vector<SgNode*> fdecl_nodes = NodeQuery::queryMemoryPool(defFunc, &vv);
179 BOOST_FOREACH(
SgNode *node, fdecl_nodes) {
184 callGraphData.push_back(fdata);
194 BOOST_FOREACH(
FunctionData ¤tFunction, callGraphData) {
196 std::vector<SgFunctionDeclaration*> &callees = currentFunction.
functionList;
198 if (isSelected(pred)(callee)) {
199 GraphNodes::iterator dstNodeFound =
graphNodes.find(callee);