From 238830745ba3939323c285b722c9ae512b7baa9b Mon Sep 17 00:00:00 2001 From: Hamed Gorjiara Date: Tue, 8 May 2018 11:00:33 -0700 Subject: [PATCH] making the qsort deterministic for BooleanEdge --- src/AST/boolean.cc | 4 +++- src/AST/boolean.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/AST/boolean.cc b/src/AST/boolean.cc index c576268..647f548 100644 --- a/src/AST/boolean.cc +++ b/src/AST/boolean.cc @@ -5,11 +5,13 @@ #include "order.h" #include "predicate.h" +uint64_t Boolean::counter = 0; + Boolean::Boolean(ASTNodeType _type) : ASTNode(_type), polarity(P_UNDEFINED), boolVal(BV_UNDEFINED), - parents() { + parents(), id(counter++) { } BooleanConst::BooleanConst(bool _isTrue) : diff --git a/src/AST/boolean.h b/src/AST/boolean.h index 207b327..1f218b2 100644 --- a/src/AST/boolean.h +++ b/src/AST/boolean.h @@ -11,6 +11,8 @@ #include "serializer.h" class Boolean : public ASTNode { +private: + static uint64_t counter; public: Boolean(ASTNodeType _type); virtual ~Boolean() {} @@ -23,7 +25,7 @@ public: BooleanValue boolVal; Vector parents; virtual void updateParents() {} - + uint64_t id; CMEMALLOC; }; -- 2.34.1