Omitting tunable parameters from Transform's constructors
authorHamed <hamed.gorjiara@gmail.com>
Tue, 29 Aug 2017 23:20:53 +0000 (16:20 -0700)
committerHamed <hamed.gorjiara@gmail.com>
Tue, 29 Aug 2017 23:20:53 +0000 (16:20 -0700)
src/ASTTransform/analyzer.cc
src/ASTTransform/decomposeordertransform.cc
src/ASTTransform/decomposeordertransform.h
src/ASTTransform/integerencoding.cc
src/ASTTransform/integerencoding.h
src/ASTTransform/pass.cc [deleted file]
src/ASTTransform/pass.h
src/ASTTransform/transform.cc
src/ASTTransform/transform.h
src/classlist.h

index 7d24ae2..4c8562e 100644 (file)
@@ -21,10 +21,10 @@ void orderAnalysis(CSolver *This) {
        uint size = orders->getSize();
        for (uint i = 0; i < size; i++) {
                Order *order = orders->get(i);
-               DecomposeOrderTransform* decompose = new DecomposeOrderTransform(This, order, DECOMPOSEORDER, &onoff);
+               DecomposeOrderTransform* decompose = new DecomposeOrderTransform(This, order);
                if (!decompose->canExecuteTransform()){
-                       continue;
                        delete decompose;
+                       continue;
                }
 
                OrderGraph *graph = buildOrderGraph(order);
@@ -65,13 +65,13 @@ void orderAnalysis(CSolver *This) {
                delete graph;
 
                /*
-               IntegerEncodingTransform* integerEncoding = new IntegerEncodingTransform(This, order, ORDERINTEGERENCODING, &offon);
+               IntegerEncodingTransform* integerEncoding = new IntegerEncodingTransform(This, order);
                if(!integerEncoding->canExecuteTransform()){
-                       continue;
                        delete integerEncoding;
+                       continue;
                }
                integerEncoding->doTransform();
-               delete integerEncoding; */
+               delete integerEncoding;*/
        }
 }
 
index 6df2639..4a31eac 100644 (file)
@@ -15,8 +15,8 @@
 #include "csolver.h"
 
 
-DecomposeOrderTransform::DecomposeOrderTransform(CSolver* _solver, Order* _order, Tunables _tunable, TunableDesc* _desc)
-       :Transform(_solver, _tunable, _desc),
+DecomposeOrderTransform::DecomposeOrderTransform(CSolver* _solver, Order* _order)
+       :Transform(_solver),
        order(_order)
 {
 }
@@ -25,7 +25,7 @@ DecomposeOrderTransform::~DecomposeOrderTransform() {
 }
 
 bool DecomposeOrderTransform::canExecuteTransform(){
-       return canExecutePass(solver, order->type);
+       return canExecutePass(solver, order->type, DECOMPOSEORDER, &onoff);
 }
 
 void DecomposeOrderTransform::doTransform(){
index 25aea89..1fe7356 100644 (file)
@@ -13,7 +13,7 @@
 
 class DecomposeOrderTransform : public Transform {
 public:
-       DecomposeOrderTransform(CSolver* _solver, Order* order, Tunables _tunable, TunableDesc* _desc);
+       DecomposeOrderTransform(CSolver* _solver, Order* order);
        virtual ~DecomposeOrderTransform();
        void doTransform();
        void setOrderGraph(OrderGraph* _graph){
index b4b0f99..6a525cd 100644 (file)
@@ -8,8 +8,8 @@
 
 HashTableOrderIntegerEncoding* IntegerEncodingTransform::orderIntegerEncoding = new HashTableOrderIntegerEncoding();
 
-IntegerEncodingTransform::IntegerEncodingTransform(CSolver* _solver, Order* _order, Tunables _tunable, TunableDesc* _desc
-       :Transform(_solver, _tunable, _desc),
+IntegerEncodingTransform::IntegerEncodingTransform(CSolver* _solver, Order* _order) 
+       :Transform(_solver),
        order(_order)
        
 {      
@@ -19,7 +19,7 @@ IntegerEncodingTransform::~IntegerEncodingTransform(){
 }
 
 bool IntegerEncodingTransform::canExecuteTransform(){
-       return canExecutePass(solver, order->type);
+       return canExecutePass(solver, order->type, ORDERINTEGERENCODING, &offon);
 }
 
 void IntegerEncodingTransform::doTransform(){
index 64924f2..6434a95 100644 (file)
@@ -13,7 +13,7 @@
 
 class IntegerEncodingTransform : public Transform{
 public:
-       IntegerEncodingTransform(CSolver* solver, Order* order, Tunables _tunable, TunableDesc* _desc);
+       IntegerEncodingTransform(CSolver* solver, Order* order);
        void orderIntegerEncodingSATEncoder(BooleanOrder *boolOrder);
        void doTransform();
        bool canExecuteTransform();
diff --git a/src/ASTTransform/pass.cc b/src/ASTTransform/pass.cc
deleted file mode 100644 (file)
index 3b54821..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "pass.h"
-#include "tunable.h"
-#include "csolver.h"
-
-Pass::Pass(Tunables _tunable, TunableDesc* _desc): 
-       tunable(_tunable),
-       tunableDesc(_desc)
-{
-       
-}
-
-Pass::~Pass(){
-}
index 2d5c84e..c9ee69e 100644 (file)
 
 class Pass{
 public:
-       Pass(Tunables _tunable, TunableDesc* _desc);
-       virtual ~Pass();
-       virtual inline bool canExecutePass(CSolver* This, uint type=0){
-               return GETVARTUNABLE(This->getTuner(), type, tunable, tunableDesc);
+       Pass(){};
+       virtual ~Pass(){};
+       virtual inline bool canExecutePass(CSolver* This, uint type, Tunables tunable, TunableDesc* desc){
+               return GETVARTUNABLE(This->getTuner(), type, tunable, desc);
        }
        MEMALLOC;
-protected:
-       Tunables tunable;
-       TunableDesc* tunableDesc;
+
 };
 
 
index d28980e..bf04575 100644 (file)
@@ -7,8 +7,7 @@
 
 #include "transform.h"
 
-Transform::Transform(CSolver* _solver, Tunables _tunable, TunableDesc* _desc):
-       Pass(_tunable, _desc)
+Transform::Transform(CSolver* _solver)
 {
        solver = _solver;
 }
index 65d8119..98316de 100644 (file)
@@ -15,7 +15,7 @@
 
 class Transform : public Pass{
 public:
-       Transform(CSolver* _solver,Tunables _tunable, TunableDesc* _desc);
+       Transform(CSolver* _solver);
        virtual ~Transform();
        virtual bool canExecuteTransform() = 0;
        virtual void doTransform() = 0;
index 2e395f7..7b842ff 100644 (file)
@@ -43,6 +43,7 @@ class OrderPair;
 class OrderElement;
 class IntegerEncodingRecord;
 class Transform;
+class Pass;
 
 class ElementEncoding;
 class FunctionEncoding;
@@ -55,8 +56,6 @@ class OrderEdge;
 class AutoTuner;
 class SearchTuner;
 class TunableSetting;
-class Pass;
-class Transform;
 
 struct IncrementalSolver;
 typedef struct IncrementalSolver IncrementalSolver;