From 4b6fd39c89f308a379882426c1ed3616d60c4628 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 23 Jun 2010 11:37:12 -0700 Subject: Add a virtual clone() method to ir_instruction. This will be used by function inlining, the linker, and avoiding double usage of the LHS deref chains in ++, *=, and similar operations. --- ast_to_hir.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ast_to_hir.cpp') diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index aa90d4b663..b4692c6922 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -2171,8 +2171,7 @@ ast_jump_statement::hir(exec_list *instructions, if (loop != NULL) { ir_loop_jump *const jump = - new ir_loop_jump(loop, - (mode == ast_break) + new ir_loop_jump((mode == ast_break) ? ir_loop_jump::jump_break : ir_loop_jump::jump_continue); instructions->push_tail(jump); @@ -2251,7 +2250,7 @@ ast_iteration_statement::condition_to_hir(ir_loop *stmt, ir_if *const if_stmt = new ir_if(not_cond); ir_jump *const break_stmt = - new ir_loop_jump(stmt, ir_loop_jump::jump_break); + new ir_loop_jump(ir_loop_jump::jump_break); if_stmt->then_instructions.push_tail(break_stmt); stmt->body_instructions.push_tail(if_stmt); -- cgit v1.2.3