Class: Rubycc::IR::Global

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

Overview

A file-scope variable as laid out by the compiler. name is its symbol name, size its storage width in bytes and align its required alignment (its type size for a scalar/pointer, its element size for an array, its widest member's for a struct). init is either nil — a zero-initialized global that lives in .bss — or a GlobalInit: the size-byte little-endian image to place in .data together with the relocations that patch pointer slots at link time. linkage is :external for an ordinary file-scope variable (a global symbol) or :internal for a static one — a file-scope static, or a block-scope static lowered to a uniquely named file-scope object — emitted STB_LOCAL so it stays private to this object.

Instance Attribute Summary collapse

Instance Attribute Details

#alignObject (readonly)

Returns the value of attribute align

Returns:

  • (Object)

    the current value of align



365
366
367
# File 'lib/rubycc/ir/ir.rb', line 365

def align
  @align
end

#initObject (readonly)

Returns the value of attribute init

Returns:

  • (Object)

    the current value of init



365
366
367
# File 'lib/rubycc/ir/ir.rb', line 365

def init
  @init
end

#linkageObject (readonly)

Returns the value of attribute linkage

Returns:

  • (Object)

    the current value of linkage



365
366
367
# File 'lib/rubycc/ir/ir.rb', line 365

def linkage
  @linkage
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



365
366
367
# File 'lib/rubycc/ir/ir.rb', line 365

def name
  @name
end

#sizeObject (readonly)

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



365
366
367
# File 'lib/rubycc/ir/ir.rb', line 365

def size
  @size
end