class SyntaxTree::YARV::DataFlowGraph::Compiler
This class is responsible for creating a data flow graph from the given control flow graph.
Attributes
block_flows[R]
This data structure will hold the data flow between basic blocks.
cfg[R]
This is the control flow graph that is being compiled.
insn_flows[R]
This data structure will hold the data flow between instructions within individual basic blocks.
Public Class Methods
new(cfg)
click to toggle 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
compile()
click to toggle 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