public void RegisterAssignment(PropGraphNodeDescriptor lhs, PropGraphNodeDescriptor rhs)
        {
            if (lhs != null && rhs != null)
            {
                PropagationGraph.AddEdge(rhs, lhs);

                if (!rhs.Type.IsConcreteType)
                {
                    PropagationGraph.Add(rhs, rhs.Type);
                    PropagationGraph.AddToWorkList(rhs);
                }
            }
        }
        public void RegisterPropertyCall(MethodDescriptor callee, PropGraphNodeDescriptor receiver, IList <PropGraphNodeDescriptor> arguments,
                                         VariableNode lhs, AnalysisCallNode callNode)
        {
            Contract.Requires(callNode != null);
            Contract.Requires(callee != null);

            var callExp = new MethodCallInfo(this.Method, callNode, callee, receiver, arguments, lhs, false);

            RegisterInvocation(arguments, callNode, callExp);

            if (receiver != null)
            {
                PropagationGraph.AddEdge(receiver, callNode);
            }
        }
        //public void RegisterVirtualDelegateCall(MethodDescriptor callee, VariableNode receiver,
        //                                    IList<AnalysisNode> arguments,
        //                                    VariableNode lhs, DelegateVariableNode delegateVariableNode)
        //{
        //    Contract.Requires(receiver != null);
        //    Contract.Requires(arguments != null);
        //    Contract.Requires(lhs != null);
        //    Contract.Requires(callee != null);
        //    Contract.Requires(delegateVariableNode != null);

        //    var callExp = new DelegateCallInfo(this.Method, delegateVariableNode, receiver, arguments, lhs);
        //    this.PropagationGraph.AddEdge(receiver, delegateVariableNode);

        //    RegisterInvocation(arguments, delegateVariableNode, callExp);
        //}


        private void RegisterInvocation(IList <PropGraphNodeDescriptor> arguments,
                                        AnalysisCallNode invocationNode,
                                        CallInfo callExp)
        {
            Contract.Requires(callExp != null);
            Contract.Requires(arguments != null);
            Contract.Requires(invocationNode != null);

            this.PropagationGraph.AddCall(callExp, invocationNode);
            this.PropagationGraph.AddToWorkList(invocationNode);

            foreach (var a in arguments)
            {
                if (a != null)
                {
                    PropagationGraph.AddEdge(a, invocationNode);
                }
            }
        }
        public void RegisterConstructorCall(MethodDescriptor callee, IList <PropGraphNodeDescriptor> arguments,
                                            VariableNode lhs, AnalysisCallNode callNode)
        {
            Contract.Requires(callee != null);
            Contract.Requires(callNode != null);
            Contract.Requires(arguments != null);
            //var argumentValues = arguments.Select(a => a!=null?worker.GetTypes(a):new HashSet<Type>());

            var callExp = new MethodCallInfo(this.Method, callNode, callee, lhs, arguments, lhs, true);

            PropagationGraph.AddCall(callExp, callNode);
            PropagationGraph.AddToWorkList(callNode);

            foreach (var argument in arguments)
            {
                if (argument != null)
                {
                    PropagationGraph.AddEdge(argument, callNode);
                }
            }
        }
 public void RegisterRet(PropGraphNodeDescriptor rn)
 {
     PropagationGraph.AddEdge(rn, this.ReturnVariable);
 }