Disable constant propagation again (still not working correctly)
authormjsousa
Sun, 28 Dec 2014 22:20:08 +0000
changeset 981 aad6aa35ce60
parent 980 9ed5aff159db
child 982 760b26477193
Disable constant propagation again (still not working correctly)
stage3/constant_folding.cc
stage3/constant_folding.hh
--- a/stage3/constant_folding.cc	Sun Dec 28 13:29:47 2014 +0000
+++ b/stage3/constant_folding.cc	Sun Dec 28 22:20:08 2014 +0000
@@ -988,14 +988,14 @@
 /*********************/
 /* B 1.4 - Variables */
 /*********************/
-// #if DO_CONSTANT_PROPAGATION__
+#if DO_CONSTANT_PROPAGATION__
 void *constant_folding_c::visit(symbolic_variable_c *symbol) {
 	std::string varName = get_var_name_c::get_name(symbol->var_name)->value;
 	if (values.count(varName) > 0) 
 		symbol->const_value = values[varName];
 	return NULL;
 }
-// #endif  // DO_CONSTANT_PROPAGATION__
+#endif  // DO_CONSTANT_PROPAGATION__
 
 void *constant_folding_c::visit(symbolic_constant_c *symbol) {
 	std::string varName = get_var_name_c::get_name(symbol->var_name)->value;
@@ -1711,6 +1711,7 @@
 
 
 
+#if DO_CONSTANT_PROPAGATION__
 /*********************************/
 /* B 3.2.1 Assignment Statements */
 /*********************************/
@@ -1724,7 +1725,6 @@
 	return NULL;
 }
 
-#if DO_CONSTANT_PROPAGATION__
 /********************************/
 /* B 3.2.3 Selection Statements */
 /********************************/
--- a/stage3/constant_folding.hh	Sun Dec 28 13:29:47 2014 +0000
+++ b/stage3/constant_folding.hh	Sun Dec 28 22:20:08 2014 +0000
@@ -121,9 +121,9 @@
     /*********************/
     /* B 1.4 - Variables */
     /*********************/
-//     #if DO_CONSTANT_PROPAGATION__
+    #if DO_CONSTANT_PROPAGATION__
     void *visit(symbolic_variable_c *symbol);
-//     #endif // DO_CONSTANT_PROPAGATION__
+    #endif // DO_CONSTANT_PROPAGATION__
     void *visit(symbolic_constant_c *symbol);
                              
     /******************************************/
@@ -261,13 +261,12 @@
     void *visit(   not_expression_c *symbol);
     //void *visit(function_invocation_c *symbol); /* TODO */
 
-    
+    #if DO_CONSTANT_PROPAGATION__
     /*********************************/
     /* B 3.2.1 Assignment Statements */
     /*********************************/
     void *visit(assignment_statement_c *symbol);
 
-    #if DO_CONSTANT_PROPAGATION__
     /********************************/
     /* B 3.2.3 Selection Statements */
     /********************************/