Change dependences
authorbdemsky <bdemsky@uci.edu>
Wed, 30 Aug 2017 23:36:27 +0000 (16:36 -0700)
committerbdemsky <bdemsky@uci.edu>
Wed, 30 Aug 2017 23:36:27 +0000 (16:36 -0700)
31 files changed:
src/AST/asthash.h
src/AST/astnode.h
src/AST/boolean.h
src/AST/element.h
src/AST/function.h
src/AST/mutableset.h
src/AST/order.h
src/AST/predicate.h
src/AST/set.h
src/AST/table.h
src/ASTAnalyses/orderedge.h
src/ASTAnalyses/ordergraph.h
src/ASTAnalyses/ordernode.h
src/ASTTransform/integerencodingrecord.h
src/ASTTransform/pass.h
src/Backend/orderelement.h
src/Backend/orderpair.h
src/Backend/satencoder.h
src/Collections/corestructs.h [new file with mode: 0644]
src/Collections/structs.h
src/Encoders/elementencoding.h
src/Encoders/functionencoding.h
src/Encoders/orderencoding.h
src/Tuner/autotuner.h
src/Tuner/searchtuner.h
src/Tuner/tunable.h
src/classes.h [new file with mode: 0755]
src/classlist.h
src/csolver.cc
src/csolver.h
src/mymemory.h

index 184215290d4d8112ea6fc01627f4a95e70b14f16..bdb5ec6e315d1819502a4f391fc38e40a1429c14 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef ASTHASH_H
 #define ASTHASH_H
-#include "classlist.h"
+#include "classes.h"
 #include "hashtable.h"
 
 uint hashBoolean(Boolean * boolean);
index 0fc94a03285168e6be07a147cd4f2062d904055d..e6760ea91cb3f12965136d5c42ba81faca08c50f 100644 (file)
@@ -8,7 +8,7 @@ class ASTNode {
 public:
        ASTNode(ASTNodeType _type) : type(_type) {}
        ASTNodeType type;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 #endif
index f66cee42adbed31269f1a2ad57c8b9e80e83ad76..7dd0bb3ed2c2d38e014781bce9f1f476c75e1332 100644 (file)
@@ -18,7 +18,7 @@ public:
        BooleanValue boolVal;
        Vector<Boolean *> parents;
 
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class BooleanConst : public Boolean {
@@ -26,7 +26,7 @@ class BooleanConst : public Boolean {
        BooleanConst(bool isTrue);
        Boolean *clone(CSolver *solver, CloneMap *map);
        bool isTrue;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class BooleanVar : public Boolean {
@@ -36,7 +36,7 @@ public:
 
        VarType vtype;
        Edge var;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class BooleanOrder : public Boolean {
@@ -47,7 +47,7 @@ public:
        Order *order;
        uint64_t first;
        uint64_t second;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class BooleanPredicate : public Boolean {
@@ -60,7 +60,7 @@ public:
        Array<Element *> inputs;
        Boolean *undefStatus;
        FunctionEncoding *getFunctionEncoding() {return &encoding;}
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class BooleanLogic : public Boolean {
@@ -70,6 +70,6 @@ public:
 
        LogicOp op;
        Array<Boolean *> inputs;
-       MEMALLOC;
+       CMEMALLOC;
 };
 #endif
index 8277b42b018159b57d896e3234c15217144ba0fb..2622437a2205ead15ce91620ac2d2c06a74faf18 100644 (file)
@@ -16,7 +16,7 @@ public:
        ElementEncoding encoding;
        virtual Element *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;};
        
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class ElementConst : public Element {
@@ -25,7 +25,7 @@ public:
        Set *set;
        uint64_t value;
        Element *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class ElementSet : public Element {
@@ -33,7 +33,7 @@ public:
        ElementSet(Set *s);
        Set *set;
        Element *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class ElementFunction : public Element {
@@ -44,7 +44,7 @@ public:
        Boolean *overflowstatus;
        FunctionEncoding functionencoding;
        Element *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 Set *getElementSet(Element *This);
index 6d0e1d05ff79e863081875be19710079908a75ed..fcb5068ad7703b296130450f6cebad838edacae5 100644 (file)
@@ -12,7 +12,7 @@ public:
        FunctionType type;
        virtual ~Function() {}
        virtual Function *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;}
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class FunctionOperator : public Function {
@@ -25,7 +25,7 @@ public:
        uint64_t applyFunctionOperator(uint numVals, uint64_t *values);
        bool isInRangeFunction(uint64_t val);
        Function *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class FunctionTable : public Function {
@@ -34,7 +34,7 @@ public:
        UndefinedBehavior undefBehavior;
        FunctionTable (Table *table, UndefinedBehavior behavior);
        Function *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 #endif
index 080db14c863f4bbddf882477a92ca44542da22dd..568678f5cea381f9e66840f56f174bda088e6b73 100644 (file)
@@ -7,6 +7,6 @@ public:
        MutableSet(VarType t);
        void addElementMSet(uint64_t element);
        Set *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       CMEMALLOC;
 };
 #endif
index f9bd69b5a3fdca34d6074a9c45399689ffd401bf..ea2de5eea72a50e19330401313a21cacbb1b9747 100644 (file)
@@ -23,7 +23,7 @@ public:
        void initializeOrderElementsHashTable();
        void addOrderConstraint(BooleanOrder *constraint);
        void setOrderEncodingType(OrderEncodingType type);
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 #endif
index 8d370512723b322e3bb4bc749168a7fdeea01dc4..183a96099c9d69157f8a63dc7d4c6bd323a91f36 100644 (file)
@@ -13,7 +13,7 @@ public:
        virtual ~Predicate() {}
        virtual Predicate *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;}
        PredicateType type;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class PredicateOperator : public Predicate {
@@ -23,7 +23,7 @@ public:
        Predicate *clone(CSolver *solver, CloneMap *map);
        CompOp op;
        Array<Set *> domains;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class PredicateTable : public Predicate {
@@ -32,6 +32,6 @@ public:
        Predicate *clone(CSolver *solver, CloneMap *map);
        Table *table;
        UndefinedBehavior undefinedbehavior;
-       MEMALLOC;
+       CMEMALLOC;
 };
 #endif
index eb406bb553c6ed4feded557fc57454a46dd0b13c..056794e35de355e8deeda51b1235843f889bf1bc 100644 (file)
@@ -25,7 +25,7 @@ public:
        uint64_t getMemberAt(uint index);
        uint64_t getElement(uint index);
        virtual Set *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       CMEMALLOC;
 protected:
        VarType type;
        bool isRange;
index 346da4791e4c9266c229a6646f64253aae43dd00..51c15818aa6b73446ad9154d416d8afe5e36f1db 100644 (file)
@@ -14,7 +14,7 @@ public:
        Array<Set *> domains;
        Set *range;
        HashSetTableEntry *entries;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 #endif
index 9b1af29f2c46901d9d831b7085eac972ed2c9d93..b10b7811ca4893740ba335532bc243c4cdcbe029 100644 (file)
@@ -21,7 +21,7 @@ public:
        unsigned int mustPos : 1;
        unsigned int mustNeg : 1;
        unsigned int pseudoPos : 1;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 #endif/* ORDEREDGE_H */
index eb756a8d63d1b50e1387b5cee12742dd41a06541..f80ec98ba026e68eb2dcb8392327753b0d8b8713 100644 (file)
@@ -28,7 +28,7 @@ public:
        HSIteratorOrderNode *getNodes() {return nodes->iterator();}
        HSIteratorOrderEdge *getEdges() {return edges->iterator();}
 
-       MEMALLOC;
+       CMEMALLOC;
 private:
        HashSetOrderNode *nodes;
        HashSetOrderEdge *edges;
index 550bf1ed3719e0bda852928b1e9fc255843d054b..3ffecb8cbd92235790ae0b7193a49c3142774ba1 100644 (file)
@@ -28,7 +28,7 @@ public:
        uint sccNum;
        HashSetOrderEdge inEdges;
        HashSetOrderEdge outEdges;
-       MEMALLOC;
+       CMEMALLOC;
 };
 #endif/* ORDERNODE_H */
 
index 3069da536b6127009f5ba337329e3c5198c48f19..da539189ffcdb667f85f1607a4cc675145cc8617 100644 (file)
@@ -17,7 +17,7 @@ public:
        IntegerEncodingRecord(Set* set);
        ~IntegerEncodingRecord();
        Element* getOrderIntegerElement(CSolver *This, uint64_t item);
-       MEMALLOC;
+       CMEMALLOC;
        
 private:
        HashSetOrderElement *elementTable;
index c9ee69ec5e69e8ae5bce783f4a3f457e59855376..211bd4e1b2c9cb0a8f5bcad8262781f8ccbdd998 100644 (file)
@@ -20,7 +20,7 @@ public:
        virtual inline bool canExecutePass(CSolver* This, uint type, Tunables tunable, TunableDesc* desc){
                return GETVARTUNABLE(This->getTuner(), type, tunable, desc);
        }
-       MEMALLOC;
+       CMEMALLOC;
 
 };
 
index a5f08a3a85f0001c05ba9c9fbebcc694a02c1338..ab2ef7916d85bc6dc67bcaf614815b3e3f2e8b0b 100644 (file)
@@ -17,7 +17,7 @@ public:
        OrderElement(uint64_t item, Element *elem);
        uint64_t item;
        Element *elem;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 
index 6fc5df1289417ebd321ca15f3479f2486a443713..aad68ff8315a15c2d6b21d0ed7edd30e2947b643 100644 (file)
@@ -19,7 +19,7 @@ public:
        uint64_t first;
        uint64_t second;
        Edge constraint;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 #endif/* ORDERPAIR_H */
index 4cfe4c2fc6ca5121448a099424b70f2218760b01..25a46d0124ee3451fc673fba6a2007e56a269a5f 100644 (file)
@@ -19,7 +19,7 @@ class SATEncoder {
        long long getSolveTime() { return cnf->solveTime; }
        long long getEncodeTime() { return cnf->encodeTime; }
        
-       MEMALLOC;
+       CMEMALLOC;
  private:
        Edge getNewVarSATEncoder();
        void getArrayNewVarsSATEncoder(uint num, Edge *carray);
diff --git a/src/Collections/corestructs.h b/src/Collections/corestructs.h
new file mode 100644 (file)
index 0000000..867feb7
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef CORESTRUCTS_H
+#define CORESTRUCTS_H
+
+#include "cppvector.h"
+#include "hashset.h"
+
+typedef HashSet<Boolean *, uintptr_t, 4> HashSetBoolean;
+typedef HSIterator<Boolean *, uintptr_t, 4> HSIteratorBoolean;
+
+#endif
index 266fc171f8bde4d6bf6703279118a8e77e8e51a4..30fc93b2eafb72ee6219b2acd63c9bdb6f70e741 100644 (file)
@@ -5,6 +5,7 @@
 #include "hashset.h"
 #include "classlist.h"
 #include "array.h"
+#include "corestructs.h"
 
 unsigned int table_entry_hash_function(TableEntry *This);
 bool table_entry_equals(TableEntry *key1, TableEntry *key2);
@@ -18,7 +19,7 @@ unsigned int order_pair_hash_function(OrderPair *This);
 bool order_pair_equals(OrderPair *key1, OrderPair *key2);
 
 
-typedef HashSet<Boolean *, uintptr_t, 4> HashSetBoolean;
+
 typedef HashSet<TableEntry *, uintptr_t, 4, table_entry_hash_function, table_entry_equals> HashSetTableEntry;
 typedef HashSet<OrderNode *, uintptr_t, 4, order_node_hash_function, order_node_equals> HashSetOrderNode;
 typedef HashSet<OrderEdge *, uintptr_t, 4, order_edge_hash_function, order_edge_equals> HashSetOrderEdge;
@@ -29,7 +30,6 @@ typedef HashTable<void *, void *, uintptr_t, 4> CloneMap;
 typedef HashTable<Order* , IntegerEncodingRecord*, uintptr_t, 4> HashTableOrderIntegerEncoding; 
 
 typedef HSIterator<TableEntry *, uintptr_t, 4, table_entry_hash_function, table_entry_equals> HSIteratorTableEntry;
-typedef HSIterator<Boolean *, uintptr_t, 4> HSIteratorBoolean;
 typedef HSIterator<OrderEdge *, uintptr_t, 4, order_edge_hash_function, order_edge_equals> HSIteratorOrderEdge;
 typedef HSIterator<OrderNode *, uintptr_t, 4, order_node_hash_function, order_node_equals> HSIteratorOrderNode;
 
index 1d41940fcf4493b039ea2e46d14deb83c9a81455..d7585f4bc0372adfde75579a0c6781f227da455e 100644 (file)
@@ -55,7 +55,7 @@ public:
                };
        };
        uint numVars;   /* Number of variables */
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 
index e4bd5aa4bcec7266a64ac2adc7c6064dc078406e..a7b6364a67af95d71d617c8423475ff69c91a707 100644 (file)
@@ -24,7 +24,7 @@ public:
        FunctionEncoding(Boolean *predicate);
        void setFunctionEncodingType(FunctionEncodingType type);
        FunctionEncodingType getFunctionEncodingType() {return type;}
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 
index 57409e733514a52780de1c32c26b08229a65267a..4d71805f03cb3ee313b4b8d0a6f8f750a7df1656 100644 (file)
@@ -14,7 +14,7 @@ public:
 
        OrderEncodingType type;
        Order *order;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 #endif
index 2490d564c71f721e8bd9972f2e58f2e3c3c06179..9e36732212cac2957ea03b457bf4639a7dd69b72 100644 (file)
@@ -8,7 +8,7 @@ class AutoTuner {
        AutoTuner(uint budget);
        void addProblem(CSolver *solver);
        void tune();
-       MEMALLOC;
+       CMEMALLOC;
  private:
        long long evaluate(CSolver *problem, SearchTuner *tuner);
        double evaluateAll(SearchTuner *tuner);
index b41a3e0bc1c2a40c04a3f0bf049bffc52547bd72..3470aa8bb07e3fff6bc3abf6342aa8bec08ecae8 100644 (file)
@@ -11,7 +11,7 @@ class TunableSetting {
        TunableSetting(TunableSetting * ts);
        void setDecision(int _low, int _high, int _default, int _selection);
        void print();
-       MEMALLOC;
+       CMEMALLOC;
  private:
        bool hasVar;
        VarType type;
@@ -43,7 +43,7 @@ class SearchTuner : public Tuner {
        void print();
        void printUsed();
 
-       MEMALLOC;
+       CMEMALLOC;
  private:
        /** Used Settings keeps track of settings that were actually used by
                 the example. Mutating settings may cause the Constraint Compiler
index a1e165a3cf6afa21b5b68dd8079e4390b7303755..480034516bb328fd1e418386aeb6d985ee894509 100644 (file)
@@ -8,7 +8,7 @@ public:
        virtual int getTunable(TunableParam param, TunableDesc *descriptor) {ASSERT(0); return 0;}
        virtual int getVarTunable(VarType vartype, TunableParam param, TunableDesc *descriptor) {ASSERT(0); return 0;}
        virtual ~Tuner() {}
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class DefaultTuner : public Tuner {
@@ -16,7 +16,7 @@ public:
        DefaultTuner();
        int getTunable(TunableParam param, TunableDesc *descriptor);
        int getVarTunable(VarType vartype, TunableParam param, TunableDesc *descriptor);
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 
@@ -27,7 +27,7 @@ public:
        int lowValue;
        int highValue;
        int defaultValue;
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 
diff --git a/src/classes.h b/src/classes.h
new file mode 100755 (executable)
index 0000000..fd370a7
--- /dev/null
@@ -0,0 +1,30 @@
+/*      Copyright (c) 2015 Regents of the University of California
+ *
+ *      Author: Brian Demsky <bdemsky@uci.edu>
+ *
+ *      This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      version 2 as published by the Free Software Foundation.
+ */
+
+#ifndef CLASSES_H
+#define CLASSES_H
+
+#include "mymemory.h"
+#include <inttypes.h>
+
+class SATEncoder;
+class CSolver;
+class Boolean;
+class Element;
+class Predicate;
+class Table;
+class Order;
+class MutableSet;
+class Function;
+class Tuner;
+class Set;
+class BooleanLogic;
+typedef uint64_t VarType;
+
+#endif
index 7b842ffc84a80c9cfce71332f74a6dc7ad4bb309..1145d676225657396a2363ac3e52d22c422659bf 100644 (file)
 
 #include "mymemory.h"
 #include <inttypes.h>
+#include "classes.h"
+
 
-class CSolver;
-class SATEncoder;
-class Boolean;
 class BooleanOrder;
 class BooleanVar;
-class BooleanLogic;
+
 class BooleanPredicate;
 class ASTNode;
-class Set;
-class MutableSet;
+
+
 
 class ElementFunction;
 class ElementSet;
 class ElementConst;
-class Element;
 
 class FunctionOperator;
 class FunctionTable;
-class Function;
 
-class Predicate;
+
+
 class PredicateTable;
 class PredicateOperator;
-class Table;
-class Order;
+
+
 class OrderPair;
 
 class OrderElement;
@@ -57,18 +55,16 @@ class AutoTuner;
 class SearchTuner;
 class TunableSetting;
 
+class TunableDesc;
+
 struct IncrementalSolver;
 typedef struct IncrementalSolver IncrementalSolver;
 
 struct TableEntry;
 typedef struct TableEntry TableEntry;
 
-class Tuner;
-class TunableDesc;
-
 typedef int TunableParam;
-
 typedef unsigned int uint;
 typedef long int int64;
-typedef uint64_t VarType;
+
 #endif
index 9092af9e91fe37db62d931ded3c7c2ae6a1979ac..bcde64e9b84274cebed1ebabd1b14688ee7e9a42 100644 (file)
@@ -14,6 +14,7 @@
 #include "analyzer.h"
 #include "autotuner.h"
 #include "astops.h"
+#include "structs.h"
 
 CSolver::CSolver() :
        boolTrue(new BooleanConst(true)),
index 52f1c98eb13a1d2ea2ede74a2c075622715c42b4..0f49dcde8d15af60890146a0d796a0bfbe5ee682 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef CSOLVER_H
 #define CSOLVER_H
-#include "classlist.h"
+#include "classes.h"
 #include "ops.h"
-#include "structs.h"
+#include "corestructs.h"
 #include "asthash.h"
 
 class CSolver {
@@ -129,7 +129,7 @@ public:
        long long getEncodeTime();
        long long getSolveTime();
        
-       MEMALLOC;
+       CMEMALLOC;
 
 private:
        void handleXORFalse(BooleanLogic *bexpr, Boolean *child);
index 294985d98a5deca8f07c884a5ae4e29015fb8e90..1c7f3b3f2f4924daf3fdcd81ea444f4dad14ba55 100644 (file)
@@ -11,8 +11,8 @@
  *  @brief Memory allocation functions.
  */
 
-#ifndef _MY_MEMORY_H
-#define _MY_MEMORY_H
+#ifndef CSAT_MY_MEMORY_H
+#define CSAT_MY_MEMORY_H
 #include <limits.h>
 #include <stddef.h>
 #include <stdlib.h>
@@ -31,7 +31,7 @@ static inline void ourfree(void *ptr) { free(ptr); }
 static inline void *ourcalloc(size_t count, size_t size) { return calloc(count, size); }
 static inline void *ourrealloc(void *ptr, size_t size) { return realloc(ptr, size); }
 
-#define MEMALLOC                           \
+#define CMEMALLOC                           \
        void *operator new(size_t size) {       \
                return ourmalloc(size);                \
        }                                                  \