示例#1
0
        // keep this internal so that users can't delete files that the provider manages
        internal void DisposeFileHandles()
        {
            PrimaryModule.DisposeFileStream();

            if (DocumentationFile != null)
            {
                DocumentationFile.DisposeFileStream();
            }
        }
示例#2
0
        public bool AnalyzeMethods()
        {
            foreach (INamedTypeDefinition t in PrimaryModule.GetAllTypes())
            {
                if (t.IsClass && t.Methods.Count() > 0 && !t.Name.Value.StartsWith("<"))
                {
                    Environment.Message("Class {0} has {1} members, {2} methods.", t.Name.Value, t.Members.Count(), t.Methods.Count());
                    List <IMethodDefinition> methods = t.Methods.ToList();
                    foreach (IMethodDefinition m in methods)
                    {
                        ControlAndDataFlowGraph <EnhancedBasicBlock <Instruction>, Instruction> cdfg = ControlAndDataFlowGraph <EnhancedBasicBlock <Instruction>, Instruction> .GetControlAndDataFlowGraphFor(MetadataReaderHost, m.Body);

                        ControlGraphQueries <EnhancedBasicBlock <Instruction>, Instruction> query = new ControlGraphQueries <EnhancedBasicBlock <Instruction>, Instruction>(cdfg);

                        Environment.Message("  Method {0} has visibility {3}, {1} parameters, {2} local variables in body, {4} total basic blocks or nodes and {5} successor edges in CFG.\n", m.Name.Value, m.ParameterCount,
                                            m.Body.LocalVariables.Count(), m.Visibility.ToString(), cdfg.AllBlocks.Count,
                                            cdfg.SuccessorEdges.Count);
                    }
                }
            }
            return(true);
        }
 internal void DisposeFileHandles()
 {
     PrimaryModule.DisposeFileStream();
     DocumentationFile?.DisposeFileStream();
 }