writer.write_op(content.function_body, OP_SELECTION_MERGE, merge_block_id, 0); // Selection control (none)
writer.write_op(content.function_body, OP_BRANCH_CONDITIONAL, condition_id, true_label_id, false_label_id);
+ std::map<const VariableDeclaration *, Id> saved_load_ids = variable_load_ids;
+
writer.write_op_label(true_label_id);
ternary.true_expr->visit(*this);
Id true_result_id = r_expression_result_id;
true_label_id = writer.get_current_block();
writer.write_op(content.function_body, OP_BRANCH, merge_block_id);
+ swap(saved_load_ids, variable_load_ids);
writer.write_op_label(false_label_id);
ternary.false_expr->visit(*this);
Id false_result_id = r_expression_result_id;
false_label_id = writer.get_current_block();
writer.write_op_label(merge_block_id);
+ prune_loads(true_label_id);
r_expression_result_id = begin_expression(OP_PHI, get_id(*ternary.type), 4);
writer.write(true_result_id);
writer.write(true_label_id);