update docs and remove unused option
[satcheck.git] / storeloadset.h
1 /*      Copyright (c) 2015 Regents of the University of California
2  *
3  *      Author: Brian Demsky <bdemsky@uci.edu>
4  *
5  *      This program is free software; you can redistribute it and/or
6  *      modify it under the terms of the GNU General Public License
7  *      version 2 as published by the Free Software Foundation.
8  */
9
10 #ifndef STORELOADSET_H
11 #define STORELOADSET_H
12 #include "classlist.h"
13 #include "stl-model.h"
14
15 class StoreLoadSet {
16 public:
17         StoreLoadSet();
18         ~StoreLoadSet();
19         void add(EPRecord *op);
20         RecordIterator * iterator() {return storeloadset.iterator();}
21         Constraint * getAddressEncoding(ConstGen *cg, EPRecord *op, const void * addr);
22         Constraint * getValueEncoding(ConstGen *cg, EPRecord *op, uint64_t val);
23         Constraint * getRMWRValueEncoding(ConstGen *cg, EPRecord *op, uint64_t val);
24
25         const void * getAddressEncoding(ConstGen *cg, EPRecord *op, bool *);
26         uint64_t getValueEncoding(ConstGen *cg, EPRecord *op,  bool *);
27         uint64_t getRMWRValueEncoding(ConstGen *cg, EPRecord *op, bool *);
28         uint getNumAddrVars();
29         uint getNumValVars();
30         Constraint ** getAddrVars(ConstGen *cg, EPRecord * op);
31         Constraint ** getValVars(ConstGen *cg, EPRecord * op);
32         Constraint ** getRMWRValVars(ConstGen *cg, EPRecord * op);
33         IntHashSet * getValues() {return &values;}
34         bool removeAddress(const void *addr) {addresses.remove((uint64_t)addr);return addresses.isEmpty();}
35
36         MEMALLOC;
37 private:
38         void genEncoding();
39         RecordSet storeloadset;
40         IntHashSet addresses;
41         IntHashSet values;
42         VarTable addrvars;
43         VarTable valvars;
44         VarTable valrmwrvars;
45         ValueRecord *addrencodings;
46         ValueRecord *valencodings;
47 };
48 #endif