Add statistic to call graph builder for calls to builtins.

Add a statistic to the new call graph to track calls to builtins (for
which we do not have a call graph node or edge).

Swift SVN r21465
This commit is contained in:
Mark Lacey
2014-08-26 21:53:08 +00:00
parent 8cfc6089e3
commit 2719a13114

View File

@@ -17,12 +17,11 @@ using namespace swift;
#define DEBUG_TYPE "call-graph"
STATISTIC(NumCallGraphNodes,
"# of call graph nodes created");
STATISTIC(NumCallSitesWithEdges,
"# of call sites with edges");
STATISTIC(NumCallGraphNodes, "# of call graph nodes created");
STATISTIC(NumCallSitesWithEdges, "# of call sites with edges");
STATISTIC(NumCallSitesWithoutEdges,
"# of call sites without edges");
"# of non-builtin call sites without call graph edges");
STATISTIC(NumCallSitesOfBuiltins, "# of call sites calling builtins");
CallGraph::CallGraph(SILModule *M, bool completeModule) {
// Build the initial call graph by creating a node for each
@@ -120,7 +119,11 @@ void CallGraph::addEdgesForApply(ApplyInst *AI, CallGraphNode *CallerNode) {
break;
}
case ValueKind::BuiltinFunctionRefInst:
case ValueKind::BuiltinFunctionRefInst: {
++NumCallSitesOfBuiltins;
break;
}
case ValueKind::PartialApplyInst:
case ValueKind::ClassMethodInst:
case ValueKind::ProtocolMethodInst: