Class: Rubycc::IR::Generator::Local

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

Overview

A declared variable's binding and its declared Rubycc::Type. When global is false it is a local: storage is a virtual-register number for a scalar (int or pointer) and a stack object id for an array, which one following from type.array?. When global is true it is a file-scope variable and storage is its symbol name (a String), whose address :global_addr materializes. const records whether the object is top-level const-qualified, so a write to it (a plain assignment, a compound assignment or "++"/"--") is diagnosed as writing a read-only variable; reads and "&" are unaffected.

Instance Attribute Summary collapse

Instance Attribute Details

#constObject (readonly)

Returns the value of attribute const

Returns:

  • (Object)

    the current value of const



27
28
29
# File 'lib/rubycc/ir/generator.rb', line 27

def const
  @const
end

#globalObject (readonly)

Returns the value of attribute global

Returns:

  • (Object)

    the current value of global



27
28
29
# File 'lib/rubycc/ir/generator.rb', line 27

def global
  @global
end

#storageObject (readonly)

Returns the value of attribute storage

Returns:

  • (Object)

    the current value of storage



27
28
29
# File 'lib/rubycc/ir/generator.rb', line 27

def storage
  @storage
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



27
28
29
# File 'lib/rubycc/ir/generator.rb', line 27

def type
  @type
end