Class: CastOff::Compiler::SimpleIR::TmpVariable

Inherits:
Variable show all
Includes:
Util
Defined in:
lib/cast_off/compile/ir/operand.rb

Constant Summary

Constants inherited from TypeContainer

CastOff::Compiler::SimpleIR::TypeContainer::FixnumWrapper, CastOff::Compiler::SimpleIR::TypeContainer::FloatWrapper

Instance Attribute Summary collapse

Attributes inherited from TypeContainer

#state, #types

Instance Method Summary collapse

Methods included from Util

#bug, #dlog, #todo, #vlog

Methods inherited from Variable

#class_exact?, #declare?, #is_class_exact, #reset

Methods inherited from TypeContainer

#box, #boxed?, #boxed_form, #can_unbox?, #class_exact?, #declare, #declare_class, #dynamic?, #is_also, #is_also?, #is_annotated, #is_class_exact, #is_dynamic, #is_just?, #is_negative_cond_value, #is_not, #is_static, #not_initialized, #reset, #static?, #to_debug_string, #to_s, #unboxed?, #undefined?, #union

Constructor Details

#initialize(index) ⇒ TmpVariable

Returns a new instance of TmpVariable.



640
641
642
643
# File 'lib/cast_off/compile/ir/operand.rb', line 640

def initialize(index)
  super()
  @index = index
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



638
639
640
# File 'lib/cast_off/compile/ir/operand.rb', line 638

def index
  @index
end

Instance Method Details

#==(v) ⇒ Object



658
659
660
# File 'lib/cast_off/compile/ir/operand.rb', line 658

def ==(v)
  eql?(v)
end

#eql?(v) ⇒ Boolean

Returns:

  • (Boolean)


653
654
655
656
# File 'lib/cast_off/compile/ir/operand.rb', line 653

def eql?(v)
  return false unless v.is_a?(TmpVariable)
  @index == v.index
end

#has_undefined_pathObject



666
667
668
# File 'lib/cast_off/compile/ir/operand.rb', line 666

def has_undefined_path()
  bug()
end

#hashObject



662
663
664
# File 'lib/cast_off/compile/ir/operand.rb', line 662

def hash
  self.to_name.hash
end

#sourceObject



649
650
651
# File 'lib/cast_off/compile/ir/operand.rb', line 649

def source
  bug()
end

#to_nameObject



645
646
647
# File 'lib/cast_off/compile/ir/operand.rb', line 645

def to_name
  "tmp#{@index}"
end