Beispiel #1
0
        public static CallGraph ComputeAnalyzableMethods(Node node, PointsToAnalysis ptwe)
        {
            Set <AssemblyNode> assemblies = new Set <AssemblyNode>();

            // AnalyzableMethodFinder amf = new AnalyzableMethodFinder(node,);
            AnalyzableMethodFinder amf = new AnalyzableMethodFinder(ptwe);

            if (node is AssemblyNode)
            {
                AssemblyNode assemblyNode = (AssemblyNode)node;
                amf.assemblies.Add(node);
                foreach (AssemblyReference reference in assemblyNode.AssemblyReferences)
                {
                    amf.assemblies.Add(reference.Assembly);
                }
            }
            amf.Visit(node);

            /*
             * foreach (AssemblyNode an in amf.assemblies)
             * {
             *  Console.Out.WriteLine("*ENTRE*");
             *  amf.Visit(an);
             * }
             */

            // amf.Visit(node);
            if (PointsToAnalysis.verbose)
            {
                Set <CallGraph> cgs;
                cgs = new Set <CallGraph>();
                cgs.Add(amf.cg);
                CallGraph.GenerateDotGraph(Console.Out, cgs);
            }
            return(amf.cg);
        }