Concrete predicate class
authorweiyu <weiyuluo1232@gmail.com>
Mon, 30 Sep 2019 17:41:07 +0000 (10:41 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Mon, 30 Sep 2019 17:41:07 +0000 (10:41 -0700)
concretepredicate.cc [new file with mode: 0644]
concretepredicate.h [new file with mode: 0644]

diff --git a/concretepredicate.cc b/concretepredicate.cc
new file mode 100644 (file)
index 0000000..e3cbcac
--- /dev/null
@@ -0,0 +1,16 @@
+#include "concretepredicate.h"
+
+ConcretePredicate::ConcretePredicate(void * loc) :
+       location(loc),
+       expressions()
+{}
+
+ConcretePredicate::~ConcretePredicate()
+{
+       expressions.clear();
+}
+
+void ConcretePredicate::add_expression(token_t token, uint64_t value, bool equality)
+{
+       expressions.push_back(concrete_pred_expr(token, value, equality));
+}
diff --git a/concretepredicate.h b/concretepredicate.h
new file mode 100644 (file)
index 0000000..2ec4e85
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef __CONCRETE_PREDICATE_H__
+#define __CONCRETE_PREDICATE_H__
+
+#include <inttypes.h>
+#include "classlist.h"
+#include "predicatetypes.h"
+
+class ConcretePredicate {
+public:
+       ConcretePredicate(void * loc);
+       ~ConcretePredicate();
+
+       void add_expression(token_t token, uint64_t value, bool equality);
+       SnapVector<struct concrete_pred_expr> * getExpressions() { return &expressions; }
+       void * get_location() { return location; }
+
+       SNAPSHOTALLOC
+private:
+       void * location;
+       SnapVector<struct concrete_pred_expr> expressions;
+};
+
+#endif /* __CONCRETE_PREDICATE_H */