Commit c84a953c authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Make NewTempExprNode play nicer; fix typo

parent aed824f2
...@@ -431,10 +431,14 @@ class ExprNode(Node): ...@@ -431,10 +431,14 @@ class ExprNode(Node):
# its sub-expressions, and dispose of any # its sub-expressions, and dispose of any
# temporary results of its sub-expressions. # temporary results of its sub-expressions.
self.generate_subexpr_evaluation_code(code) self.generate_subexpr_evaluation_code(code)
self.pre_generate_result_code(code)
self.generate_result_code(code) self.generate_result_code(code)
if self.is_temp: if self.is_temp:
self.generate_subexpr_disposal_code(code) self.generate_subexpr_disposal_code(code)
def pre_generate_result_code(self, code):
pass
def generate_subexpr_evaluation_code(self, code): def generate_subexpr_evaluation_code(self, code):
for node in self.subexpr_nodes(): for node in self.subexpr_nodes():
node.generate_evaluation_code(code) node.generate_evaluation_code(code)
...@@ -573,7 +577,7 @@ class NewTempExprNode(ExprNode): ...@@ -573,7 +577,7 @@ class NewTempExprNode(ExprNode):
def allocate_target_temps(self, env, rhs): def allocate_target_temps(self, env, rhs):
self.allocate_subexpr_temps(env) self.allocate_subexpr_temps(env)
rhs.release_temp(rhs) rhs.release_temp(rhs)
self.releasesubexpr_temps(env) self.release_subexpr_temps(env)
def allocate_temps(self, env, result = None): def allocate_temps(self, env, result = None):
self.allocate_subexpr_temps(env) self.allocate_subexpr_temps(env)
...@@ -587,7 +591,7 @@ class NewTempExprNode(ExprNode): ...@@ -587,7 +591,7 @@ class NewTempExprNode(ExprNode):
def release_temp(self, env): def release_temp(self, env):
pass pass
def generate_result_code(self, code): def pre_generate_result_code(self, code):
if self.is_temp: if self.is_temp:
type = self.type type = self.type
if not type.is_void: if not type.is_void:
...@@ -3327,7 +3331,6 @@ class BinopNode(NewTempExprNode): ...@@ -3327,7 +3331,6 @@ class BinopNode(NewTempExprNode):
self.operand2.check_const() self.operand2.check_const()
def generate_result_code(self, code): def generate_result_code(self, code):
NewTempExprNode.generate_result_code(self, code)
#print "BinopNode.generate_result_code:", self.operand1, self.operand2 ### #print "BinopNode.generate_result_code:", self.operand1, self.operand2 ###
if self.operand1.type.is_pyobject: if self.operand1.type.is_pyobject:
function = self.py_operation_function() function = self.py_operation_function()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment