public void AddEdge(Procedure caller, Procedure callee, XRef xref) { if (caller == null) { throw new ArgumentNullException("caller"); } if (callee == null) { throw new ArgumentNullException("callee"); } if (xref == null) { throw new ArgumentNullException("xref"); } System.Diagnostics.Debug.Assert(procedures.Contains(caller)); System.Diagnostics.Debug.Assert(procedures.Contains(callee)); // TBD: check that the xref indeed refers to these two // procedures. XRef xCall = new XRef( type: xref.Type, source: caller.EntryPoint, target: callee.EntryPoint, dataLocation: xref.Source ); graph.Add(xCall); }
public void AddEdge(BasicBlock source, BasicBlock target, XRef xref) { if (source == null) { throw new ArgumentNullException("source"); } if (target == null) { throw new ArgumentNullException("target"); } if (xref == null) { throw new ArgumentNullException("xref"); } System.Diagnostics.Debug.Assert(blocks.Contains(source)); System.Diagnostics.Debug.Assert(blocks.Contains(target)); XRef xFlow = new XRef( type: xref.Type, source: source.Location, target: target.Location, dataLocation: xref.Source ); graph.Add(xFlow); }