private ISet<MethodDescriptor> GetDelegateCallees(VariableNode delegateNode, PropagationGraph propGraph, ICodeProvider codeProvider) { var callees = new HashSet<MethodDescriptor>(); var typeDescriptors = propGraph.GetTypes(delegateNode); foreach (var delegateInstance in propGraph.GetDelegates(delegateNode)) { if (typeDescriptors.Count() > 0) { foreach (var typeDescriptor in typeDescriptors) { // TO-DO!!! // Ugly: I'll fix it //var aMethod = delegateInstance.FindMethodImplementation(type); var aMethod = codeProvider.FindMethodImplementation(delegateInstance,typeDescriptor); callees.Add(aMethod); } } else { // if Count is 0, it is a delegate that do not came form an instance variable callees.Add(delegateInstance); } } return callees; }
internal override ISet<MethodDescriptor> ComputeCalleesForNode(PropagationGraph propGraph, ICodeProvider codeProvider) { var calleesForNode = new HashSet<MethodDescriptor>(); if (this.Receiver != null) { // I replaced the invocation for a local call to mark that functionality is missing //var callees = GetPotentialTypes(this.Receiver, propGraph) // .Select(t => this.Callee.FindMethodImplementation(t)); var callees = GetPotentialTypes(this.Receiver, propGraph, codeProvider) .Select(t => codeProvider.FindMethodImplementation(this.Callee,t)); calleesForNode.UnionWith(callees); } else { calleesForNode.Add(this.Callee); } return calleesForNode; }