Sha256: 6a153d2b68b1fcac9fb1d1a124f991075a8d17b9e69df9643463d982a51ac992
Contents?: true
Size: 785 Bytes
Versions: 9
Compression:
Stored size: 785 Bytes
Contents
module Furnace module ANF class LetNode < Node attr_reader :arguments def initialize(graph, arguments) super(graph) @arguments = arguments end def try_eliminate if identity? entering_edges.each do |edge| edge.target = leaving_edge.target end end end def identity? @arguments.reduce(true) { |r, (k, v)| r && (v === k) } end def try_propagate end def static?(node) [ NilClass, TrueClass, FalseClass, Fixnum, Symbol, AST::LocalVariable, AST::InstanceVariable ].include? node.class end def to_human_readable "let\n#{@arguments.map { |k, v| " #{k} = #{humanize v}" }.join "\n"}" end end end end
Version data entries
9 entries across 9 versions & 1 rubygems