Bug Fix
[satune.git] / src / AST / function.h
index 2cd5ccae7f7ef699cfa2b5c3ea080e11ac912069..fcb5068ad7703b296130450f6cebad838edacae5 100644 (file)
@@ -3,16 +3,16 @@
 #include "classlist.h"
 #include "mymemory.h"
 #include "ops.h"
+#include "astops.h"
 #include "structs.h"
 
-#define GETFUNCTIONTYPE(o) (((Function *)o)->type)
-
 class Function {
 public:
        Function(FunctionType _type) : type(_type) {}
        FunctionType type;
-       MEMALLOC;
        virtual ~Function() {}
+       virtual Function *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;}
+       CMEMALLOC;
 };
 
 class FunctionOperator : public Function {
@@ -24,7 +24,8 @@ public:
        FunctionOperator(ArithOp op, Set **domain, uint numDomain, Set *range, OverFlowBehavior overflowbehavior);
        uint64_t applyFunctionOperator(uint numVals, uint64_t *values);
        bool isInRangeFunction(uint64_t val);
-       MEMALLOC;
+       Function *clone(CSolver *solver, CloneMap *map);
+       CMEMALLOC;
 };
 
 class FunctionTable : public Function {
@@ -32,7 +33,8 @@ public:
        Table *table;
        UndefinedBehavior undefBehavior;
        FunctionTable (Table *table, UndefinedBehavior behavior);
-       MEMALLOC;
+       Function *clone(CSolver *solver, CloneMap *map);
+       CMEMALLOC;
 };
 
 #endif