disable not yet complete constant propagation algorithm (currently brocken and producing incorrect results),
authorMario de Sousa <msousa@fe.up.pt>
Thu, 10 Jan 2013 10:47:06 +0000
changeset 792 78083edf93d5
parent 791 ab601bdea102
child 796 73e14a2ce5d1
disable not yet complete constant propagation algorithm (currently brocken and producing incorrect results),
stage3/constant_folding.cc
stage3/constant_folding.hh
--- a/stage3/constant_folding.cc	Thu Jan 10 10:38:41 2013 +0000
+++ b/stage3/constant_folding.cc	Thu Jan 10 10:47:06 2013 +0000
@@ -977,6 +977,7 @@
 /*********************/
 /* B 1.4 - Variables */
 /*********************/
+#if DO_CONSTANT_PROPAGATION__
 void *constant_folding_c::visit(symbolic_variable_c *symbol) {
 	std::string varName;
 
@@ -986,11 +987,13 @@
 	}
 	return NULL;
 }
+#endif  // DO_CONSTANT_PROPAGATION__
 
 
 /**********************/
 /* B 1.5.3 - Programs */
 /**********************/
+#if DO_CONSTANT_PROPAGATION__
 void *constant_folding_c::visit(program_declaration_c *symbol) {
 	symbol_c *var_name;
 
@@ -1007,6 +1010,7 @@
 	symbol->function_block_body->accept(*this);
 	return NULL;
 }
+#endif  // DO_CONSTANT_PROPAGATION__
 
 
 /****************************************/
@@ -1279,7 +1283,7 @@
 
 
 
-
+#if DO_CONSTANT_PROPAGATION__
 /*********************************/
 /* B 3.2.1 Assignment Statements */
 /*********************************/
@@ -1399,6 +1403,6 @@
 	return NULL;
 }
 
-
-
-
+#endif  // DO_CONSTANT_PROPAGATION__
+
+
--- a/stage3/constant_folding.hh	Thu Jan 10 10:38:41 2013 +0000
+++ b/stage3/constant_folding.hh	Thu Jan 10 10:47:06 2013 +0000
@@ -43,6 +43,14 @@
 #include "../absyntax_utils/absyntax_utils.hh"
 
 
+
+/* For the moment we disable constant propagation algorithm as it is not yet complete, 
+ * and due to this is currently brocken and producing incorrect results!
+ */
+#define DO_CONSTANT_PROPAGATION__ 0
+
+
+
 class constant_folding_c : public iterator_visitor_c {
     search_varfb_instance_type_c *search_varfb_instance_type;
     int error_count;
@@ -87,12 +95,16 @@
     /*********************/
     /* B 1.4 - Variables */
     /*********************/
+    #if DO_CONSTANT_PROPAGATION__
     void *visit(symbolic_variable_c *symbol);
+    #endif
 
     /**********************/
     /* B 1.5.3 - Programs */
     /**********************/
+    #if DO_CONSTANT_PROPAGATION__
     void *visit(program_declaration_c *symbol);
+    #endif
 
     /****************************************/
     /* B.2 - Language IL (Instruction List) */
@@ -188,6 +200,7 @@
     //void *visit(function_invocation_c *symbol); /* TODO */
 
     
+    #if DO_CONSTANT_PROPAGATION__
     /*********************************/
     /* B 3.2.1 Assignment Statements */
     /*********************************/
@@ -204,5 +217,6 @@
     void *visit(for_statement_c *symbol);
     void *visit(while_statement_c *symbol);
     void *visit(repeat_statement_c *symbol);
+    #endif // DO_CONSTANT_PROPAGATION__
 };