Class: MilkTea::ControlFlow::ConstantPropagation::Result

Inherits:
Data
  • Object
show all
Defined in:
lib/milk_tea/core/control_flow/constant_propagation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#in_statesObject (readonly)

Returns the value of attribute in_states

Returns:

  • (Object)

    the current value of in_states



13
14
15
# File 'lib/milk_tea/core/control_flow/constant_propagation.rb', line 13

def in_states
  @in_states
end

#out_statesObject (readonly)

Returns the value of attribute out_states

Returns:

  • (Object)

    the current value of out_states



13
14
15
# File 'lib/milk_tea/core/control_flow/constant_propagation.rb', line 13

def out_states
  @out_states
end

Instance Method Details

#constant_at(node_id, key) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/milk_tea/core/control_flow/constant_propagation.rb', line 14

def constant_at(node_id, key)
  entry = in_states[node_id]
  return nil unless entry

  v = entry[key]
  v.is_a?(ConstVal) ? v.value : nil
end