コード例 #1
0
        public ControlFlowGraph GetCFG(IMethodDefinition method)
        {
            ControlFlowGraph methodCFG = null;

            if (!this.methodCFGMap.ContainsKey(method))
            {
                var assembly = TypeHelper.GetDefiningUnit(method.ContainingType.ResolvedType) as IAssembly;
                var sourceLocationProvider = loader.GetSourceLocationProvider(assembly);
                methodCFG = method.DoAnalysisPhases(this.host, sourceLocationProvider);
                this.methodCFGMap[method] = methodCFG;
            }
            else
            {
                methodCFG = this.methodCFGMap[method];
            }
            return(methodCFG);
        }