class SyntaxTree::YARV::DataFlowGraph::Compiler
This class is responsible for creating a data flow graph from the given control flow graph.
Attributes
This data structure will hold the data flow between basic blocks.
This is the control flow graph that is being compiled.
This data structure will hold the data flow between instructions within individual basic blocks.
Public Class Methods
Source
# File lib/syntax_tree/yarv/data_flow_graph.rb, line 221 def initialize(cfg) @cfg = cfg @insn_flows = cfg.insns.to_h { |length, _| [length, DataFlow.new] } @block_flows = cfg.blocks.to_h { |block| [block.id, DataFlow.new] } end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/data_flow_graph.rb, line 227 def compile find_internal_flow find_external_flow DataFlowGraph.new(cfg, insn_flows, block_flows).tap(&:verify) end