Class: Kumi::IR::Loop::Lower::LoopNode

Inherits:
Object
  • Object
show all
Defined in:
lib/kumi/ir/loop/lower.rb

Overview

A loop nest under construction. Nodes are kept in a mutable tree so materialization discovered later can still insert array_init/push nodes at the right places.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start:, end_node:, parent_body:) ⇒ LoopNode

Returns a new instance of LoopNode.



46
47
48
49
50
51
52
# File 'lib/kumi/ir/loop/lower.rb', line 46

def initialize(start:, end_node:, parent_body:)
  @pre = []
  @start = start
  @body = []
  @end_node = end_node
  @parent_body = parent_body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



43
44
45
# File 'lib/kumi/ir/loop/lower.rb', line 43

def body
  @body
end

#end_nodeObject (readonly)

Returns the value of attribute end_node.



43
44
45
# File 'lib/kumi/ir/loop/lower.rb', line 43

def end_node
  @end_node
end

#parent_bodyObject

Returns the value of attribute parent_body.



44
45
46
# File 'lib/kumi/ir/loop/lower.rb', line 44

def parent_body
  @parent_body
end

#preObject (readonly)

Returns the value of attribute pre.



43
44
45
# File 'lib/kumi/ir/loop/lower.rb', line 43

def pre
  @pre
end

#startObject (readonly)

Returns the value of attribute start.



43
44
45
# File 'lib/kumi/ir/loop/lower.rb', line 43

def start
  @start
end