diff options
author | Frank Busse <bb0xfb@gmail.com> | 2020-06-16 20:07:06 +0100 |
---|---|---|
committer | MartinNowack <2443641+MartinNowack@users.noreply.github.com> | 2020-06-24 13:48:18 +0100 |
commit | aef3ecea2868ea08fafe34632c395df29a99f633 (patch) | |
tree | 6934e350882741093f1532e2f11d7c419de6219a /lib/Core/ExecutionState.h | |
parent | a36f7a20afaf6e477846cf72814ebe2c346d87ec (diff) | |
download | klee-aef3ecea2868ea08fafe34632c395df29a99f633.tar.gz |
add ExecutionState IDs
* add getID()/setID() * use ExecutionStateIDCompare in Executor::states set * output state id in .err files
Diffstat (limited to 'lib/Core/ExecutionState.h')
-rw-r--r-- | lib/Core/ExecutionState.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/Core/ExecutionState.h b/lib/Core/ExecutionState.h index 176ffef6..e7332472 100644 --- a/lib/Core/ExecutionState.h +++ b/lib/Core/ExecutionState.h @@ -131,6 +131,12 @@ public: /// instruction was covered. std::uint32_t instsSinceCovNew; + /// @brief the global state counter + static std::uint32_t nextID; + + /// @brief the state id + std::uint32_t id {0}; + /// @brief Whether a new instruction was covered in this state bool coveredNew; @@ -138,7 +144,7 @@ public: bool forkDisabled; public: - // ctors + // only to create the initial state explicit ExecutionState(KFunction *kf); // XXX total hack, just used to make a state so solver can // use on structure @@ -164,6 +170,15 @@ public: bool merge(const ExecutionState &b); void dumpStack(llvm::raw_ostream &out) const; + + std::uint32_t getID() const { return id; }; + void setID() { id = nextID++; }; +}; + +struct ExecutionStateIDCompare { + bool operator()(const ExecutionState *a, const ExecutionState *b) const { + return a->getID() < b->getID(); + } }; } |