internal static AstVariableCollection CollectDependencies( AstParserContext <TInstruction> context, IVariable variable, DataDependency <TInstruction> dependency) { var result = new AstVariableCollection(); foreach (long offset in dependency.Select(d => context.Architecture.GetOffset(d.Node.Contents))) { if (context.InstructionVersionStates.TryGetValue(offset, out var versions)) { result.Add(context.VersionedAstVariables[(variable, versions[variable])]);
/// <summary> /// Creates a new Ast parser with the given <see cref="ControlFlowGraph{TInstruction}"/> /// </summary> /// <param name="controlFlowGraph">The <see cref="ControlFlowGraph{TInstruction}"/> to parse</param> /// <param name="dataFlowGraph">The <see cref="DataFlowGraph{TContents}"/> to parse</param> public AstParser(ControlFlowGraph <TInstruction> controlFlowGraph, DataFlowGraph <TInstruction> dataFlowGraph) { var isa = new AstArchitecture <TInstruction>(controlFlowGraph.Architecture); _context = new AstParserContext <TInstruction>(controlFlowGraph, dataFlowGraph, isa); }