|
@@ -466,6 +466,14 @@ class LoweringState(object):
|
|
|
return tree_ir.ReadValueInstruction(
|
|
|
self.load_definition(value.node))
|
|
|
|
|
|
+ def lower_create_node(self, value):
|
|
|
+ """Lowers a 'create-node' value."""
|
|
|
+ if value.value.has_value():
|
|
|
+ return tree_ir.CreateNodeWithValueInstruction(
|
|
|
+ self.load_definition(value.value))
|
|
|
+ else:
|
|
|
+ return tree_ir.CreateNodeInstruction()
|
|
|
+
|
|
|
def lower_binary(self, value):
|
|
|
"""Lowers a 'binary' value."""
|
|
|
return tree_ir.BinaryInstruction(
|
|
@@ -510,6 +518,7 @@ class LoweringState(object):
|
|
|
cfg_ir.LoadPointer : lower_load_pointer,
|
|
|
cfg_ir.StoreAtPointer : lower_store_pointer,
|
|
|
cfg_ir.Read : lower_read,
|
|
|
+ cfg_ir.CreateNode : lower_create_node,
|
|
|
cfg_ir.Binary : lower_binary,
|
|
|
cfg_ir.Input : lower_input,
|
|
|
cfg_ir.Output : lower_output,
|