Browse Source

starting optimizations

Nicolas Winkler 5 years ago
parent
commit
99775443b5

+ 2 - 3
libmandel/include/IterationFormula.h

@@ -46,6 +46,8 @@ struct mnd::IterationFormula
 {
     std::unique_ptr<Expression> expr;
     IterationFormula(Expression expr);
+
+    void constantPropagation
 };
 
 
@@ -55,9 +57,6 @@ struct mnd::Constant
     inline Constant(double value) :
         value{ value }
     {}
-    inline Constant() :
-        value{ 1010 }
-    {}
 };
 
 

+ 2 - 0
libmandel/include/IterationIR.h

@@ -53,6 +53,8 @@ namespace mnd
             Node* newB;
 
             std::string toString(void) const;
+
+            void constantPropagation(void);
         };
     }
 

+ 0 - 3
libmandel/src/IterationFormula.cpp

@@ -14,9 +14,6 @@ mnd::IterationFormula::IterationFormula(mnd::Expression expr) :
 }
 
 
-
-
-
 static const std::string regexIdent = "[A-Za-z][A-Za-z0-9]*";
 static const std::string regexNum = "[1-9][0-9]*";
 static const std::string regexFloat = "(\\d*\\.?\\d+|\\d+\\.?\\d*)([eE][-+]\\d+)?";

+ 11 - 0
libmandel/src/IterationIR.cpp

@@ -149,6 +149,8 @@ namespace mnd
         std::tie(formula.newA, formula.newB) = std::visit(cv, *fmla.expr);
         return formula;
     }
+
+    
 }
 
 
@@ -208,3 +210,12 @@ std::string mnd::ir::Formula::toString(void) const
     return std::string("a = ") + std::visit(ToStringVisitor{}, *this->newA) + 
         "\nb = " + std::visit(ToStringVisitor{}, *this->newB);
 }
+
+
+void mnd::ir::Formula::constantPropagation(void)
+{
+
+}
+
+
+