Class: Rubycc::IR::Generator::AddressConstant

Inherits:
Data
  • Object
show all
Defined in:
lib/rubycc/ir/generator.rb

Overview

A folded address constant (ISO C 6.6): a base object plus a constant byte displacement, the form a pointer global's initializer must reduce to. base_kind is :symbol (a file-scope object named by symbol), :string (an interned string literal indexed by string_id), or :absolute (no object at all — symbol and string_id are nil and offset is the raw bit pattern, from a pointer cast of an integer constant such as "(dfree_t)-1"); offset is the byte displacement past that base for :symbol/:string (accumulated from subscripts, member accesses and pointer arithmetic), or the absolute value itself for :absolute; pointee is the type of the object presently at base+offset, so a further subscript or "+ n" knows how many bytes one step spans (and a cast overrides it without moving the address).

Instance Attribute Summary collapse

Instance Attribute Details

#base_kindObject (readonly)

Returns the value of attribute base_kind

Returns:

  • (Object)

    the current value of base_kind



70
71
72
# File 'lib/rubycc/ir/generator.rb', line 70

def base_kind
  @base_kind
end

#offsetObject (readonly)

Returns the value of attribute offset

Returns:

  • (Object)

    the current value of offset



70
71
72
# File 'lib/rubycc/ir/generator.rb', line 70

def offset
  @offset
end

#pointeeObject (readonly)

Returns the value of attribute pointee

Returns:

  • (Object)

    the current value of pointee



70
71
72
# File 'lib/rubycc/ir/generator.rb', line 70

def pointee
  @pointee
end

#string_idObject (readonly)

Returns the value of attribute string_id

Returns:

  • (Object)

    the current value of string_id



70
71
72
# File 'lib/rubycc/ir/generator.rb', line 70

def string_id
  @string_id
end

#symbolObject (readonly)

Returns the value of attribute symbol

Returns:

  • (Object)

    the current value of symbol



70
71
72
# File 'lib/rubycc/ir/generator.rb', line 70

def symbol
  @symbol
end