Class: Relyze::TCG::TCGOperand
- Inherits:
-
Object
- Object
- Relyze::TCG::TCGOperand
- Defined in:
- C:/Program Files/Relyze/lib/relyze/core/tcg.rb
Instance Attribute Summary collapse
-
#access ⇒ Object
Returns the value of attribute access.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type, access, value, name = nil) ⇒ TCGOperand
constructor
A new instance of TCGOperand.
- #to_s ⇒ Object
Constructor Details
#initialize(type, access, value, name = nil) ⇒ TCGOperand
Returns a new instance of TCGOperand
15 16 17 18 19 20 |
# File 'C:/Program Files/Relyze/lib/relyze/core/tcg.rb', line 15 def initialize( type, access, value, name=nil ) @type = type @access = access @value = value @name = name end |
Instance Attribute Details
#access ⇒ Object
Returns the value of attribute access
13 14 15 |
# File 'C:/Program Files/Relyze/lib/relyze/core/tcg.rb', line 13 def access @access end |
#name ⇒ Object
Returns the value of attribute name
13 14 15 |
# File 'C:/Program Files/Relyze/lib/relyze/core/tcg.rb', line 13 def name @name end |
#type ⇒ Object
Returns the value of attribute type
13 14 15 |
# File 'C:/Program Files/Relyze/lib/relyze/core/tcg.rb', line 13 def type @type end |
#value ⇒ Object
Returns the value of attribute value
13 14 15 |
# File 'C:/Program Files/Relyze/lib/relyze/core/tcg.rb', line 13 def value @value end |
Instance Method Details
#to_s ⇒ Object
[View source]
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'C:/Program Files/Relyze/lib/relyze/core/tcg.rb', line 22 def to_s txt = '' case @type when :bar, :register, :cond, :memop, :helper, :alias_register, :register_unversioned if( not @name.nil? ) txt << @name else txt << "0x%X" % @value end when :label txt << "label_%d" % @value when :immediate txt << "0x%X" % @value when :pointer_domain, :phi txt << @name when :string_name txt << @value when :alias_name txt << @value when :instruction txt << @value.to_s else raise "Unknown TCGOperand type #{@type}" end return txt end |