Class: Rubycc::IR::Program
- Inherits:
-
Data
- Object
- Data
- Rubycc::IR::Program
- Defined in:
- lib/rubycc/ir/ir.rb
Overview
A whole translation unit lowered to IR: its functions (an array of
Function), the shared read-only string pool strings (an array of
ASCII-8BIT byte strings, without their NUL terminators, indexed by the id
a :string_addr instruction carries), its globals (an array of Global
in source order) and its array_entries (an array of ArrayEntry, empty for
a unit with no constructor/destructor). Identical string contents are
pooled once, so the compiler can lay them out in .rodata in this order and
resolve each :string_addr to an offset.
Instance Attribute Summary collapse
-
#array_entries ⇒ Object
readonly
Returns the value of attribute array_entries.
-
#functions ⇒ Object
readonly
Returns the value of attribute functions.
-
#globals ⇒ Object
readonly
Returns the value of attribute globals.
-
#strings ⇒ Object
readonly
Returns the value of attribute strings.
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Instance Method Summary collapse
-
#initialize(functions:, strings:, globals:, array_entries: [], visibility: {}) ⇒ Program
constructor
A new instance of Program.
Constructor Details
#initialize(functions:, strings:, globals:, array_entries: [], visibility: {}) ⇒ Program
Returns a new instance of Program.
412 413 414 |
# File 'lib/rubycc/ir/ir.rb', line 412 def initialize(functions:, strings:, globals:, array_entries: [], visibility: {}) super end |
Instance Attribute Details
#array_entries ⇒ Object (readonly)
Returns the value of attribute array_entries
411 412 413 |
# File 'lib/rubycc/ir/ir.rb', line 411 def array_entries @array_entries end |
#functions ⇒ Object (readonly)
Returns the value of attribute functions
411 412 413 |
# File 'lib/rubycc/ir/ir.rb', line 411 def functions @functions end |
#globals ⇒ Object (readonly)
Returns the value of attribute globals
411 412 413 |
# File 'lib/rubycc/ir/ir.rb', line 411 def globals @globals end |
#strings ⇒ Object (readonly)
Returns the value of attribute strings
411 412 413 |
# File 'lib/rubycc/ir/ir.rb', line 411 def strings @strings end |
#visibility ⇒ Object (readonly)
Returns the value of attribute visibility
411 412 413 |
# File 'lib/rubycc/ir/ir.rb', line 411 def visibility @visibility end |