changed heuristic for on-the-fly call graph refinement with a context-sensitive pre-computed call graph
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3090 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
4c37cfc4dd
commit
38f061042f
|
@ -2268,7 +2268,17 @@ public class DemandRefinementPointsTo extends AbstractDemandPointsTo {
|
||||||
// NOTE: if we want to be more precise for queries in dead code,
|
// NOTE: if we want to be more precise for queries in dead code,
|
||||||
// we shouldn't rely on possibleTargets here (since there may be
|
// we shouldn't rely on possibleTargets here (since there may be
|
||||||
// zero targets)
|
// zero targets)
|
||||||
return !refinementPolicy.getCallGraphRefinePolicy().shouldRefine(call) || possibleTargets.size() <= 1;
|
if (!refinementPolicy.getCallGraphRefinePolicy().shouldRefine(call)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// here we compute the number of unique *method* targets, as opposed to call graph nodes.
|
||||||
|
// if we have a context-sensitive call graph, with many targets representing clones of
|
||||||
|
// the same method, we don't want to count the clones twice
|
||||||
|
Set<IMethod> methodTargets = new HashSet<IMethod>();
|
||||||
|
for (CGNode node: possibleTargets) {
|
||||||
|
methodTargets.add(node.getMethod());
|
||||||
|
}
|
||||||
|
return methodTargets.size() <= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue