Fixed Bitwise negation in ST
authoretisserant
Fri, 05 Oct 2007 10:24:39 +0200
changeset 64 ab704568fa25
parent 63 42f0e28a2399
child 65 c6d41c1287de
Fixed Bitwise negation in ST
stage4/generate_cc/generate_cc_st.cc
--- a/stage4/generate_cc/generate_cc_st.cc	Fri Sep 28 07:45:03 2007 +0200
+++ b/stage4/generate_cc/generate_cc_st.cc	Fri Oct 05 10:24:39 2007 +0200
@@ -349,7 +349,7 @@
 /* TODO: power expression... */
 void *visit(power_expression_c *symbol) {ERROR; return print_binary_expression(symbol->l_exp, symbol->r_exp, " ** ");}
 void *visit(neg_expression_c *symbol) {return print_unary_expression(symbol->exp, " -");}
-void *visit(not_expression_c *symbol) {return print_unary_expression(symbol->exp, "!");}
+void *visit(not_expression_c *symbol) {return print_unary_expression(symbol->exp, search_expression_type->is_bool_type(symbol->exp)?"!":"~");}
 
 void *visit(function_invocation_c *symbol) {
   function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name);