public ProgramStepGraph BuildGraphFromMethod(Method method) { if (method == null) { throw new ArgumentNullException("method"); } // create graph this.graph = new ProgramStepGraph(false); this.instructionVertices = new Hashtable(); // first add all instructions foreach (ProgramStep i in method.DataFlow) { // avoid certain instructions if (i.Operation.Flow == ControlFlow.Meta || i.Operation.Flow == ControlFlow.Meta) { continue; } // add vertex ProgramStepVertex iv = graph.AddVertex(); iv.Instruction = i; this.instructionVertices.Add((uint)i.Offset, iv); } // iterating over the instructions search(null, method.DataFlow.GetEnumerator()); // iterating of the the try/catch handler searchExceptions(method.RetrieveEHClauses()); return(this.graph); }
public ProgramStepGraph BuildGraphFromMethod(Method method) { if (method==null) throw new ArgumentNullException("method"); // create graph this.graph = new ProgramStepGraph(false); this.instructionVertices = new Hashtable(); // first add all instructions foreach(ProgramStep i in method.DataFlow) { // avoid certain instructions if (i.Operation.Flow == ControlFlow.Meta || i.Operation.Flow == ControlFlow.Meta) continue; // add vertex ProgramStepVertex iv = graph.AddVertex(); iv.Instruction = i; this.instructionVertices.Add((uint)i.Offset,iv); } // iterating over the instructions search(null, method.DataFlow.GetEnumerator()); // iterating of the the try/catch handler searchExceptions(method.RetrieveEHClauses()); return this.graph; }