klee
|
Represents one klee_open_merge()
call. Handles merging of states that branched from it.
More...
#include <MergeHandler.h>
Public Member Functions | |
void | addClosedState (ExecutionState *es, llvm::Instruction *mp) |
Called when a state runs into a 'klee_close_merge()' call. More... | |
ExecutionState * | getPrioritizeState () |
Return state that should be prioritized to complete this merge. More... | |
void | addOpenState (ExecutionState *es) |
Add state to the 'openStates' vector. More... | |
void | removeOpenState (ExecutionState *es) |
Remove state from the 'openStates' vector. More... | |
bool | hasMergedStates () |
True, if any states have run into 'klee_close_merge()' and have not been released yet. More... | |
void | releaseStates () |
Immediately release the merged states that have run into a 'klee_merge_close()'. More... | |
double | getMean () |
MergeHandler (Executor *_executor, ExecutionState *es) | |
~MergeHandler () | |
Public Attributes | |
class ReferenceCounter | _refCount |
Required by klee::ref-managed objects. More... | |
Private Member Functions | |
unsigned | getInstructionDistance (ExecutionState *es) |
Get distance of state from the openInstruction. More... | |
Private Attributes | |
Executor * | executor |
uint64_t | openInstruction |
The instruction count when the state ran into the klee_open_merge. More... | |
double | closedMean |
The average number of instructions between the open and close merge of each state that has finished so far. More... | |
unsigned | closedStateCount |
Number of states that are tracked by this MergeHandler, that ran into a relevant klee_close_merge. More... | |
std::vector< ExecutionState * > | openStates |
States that ran through the klee_open_merge, but not yet into a corresponding klee_close_merge. More... | |
std::map< llvm::Instruction *, std::vector< ExecutionState * > > | reachedCloseMerge |
Mapping the different 'klee_close_merge' calls to the states that ran into them. More... | |
Represents one klee_open_merge()
call. Handles merging of states that branched from it.
Definition at line 96 of file MergeHandler.h.
klee::MergeHandler::MergeHandler | ( | Executor * | _executor, |
ExecutionState * | es | ||
) |
Definition at line 136 of file MergeHandler.cpp.
References addOpenState(), executor, klee::MergingSearcher::mergeGroups, and klee::Executor::mergingSearcher.
klee::MergeHandler::~MergeHandler | ( | ) |
Definition at line 143 of file MergeHandler.cpp.
References executor, klee::MergingSearcher::mergeGroups, klee::Executor::mergingSearcher, and releaseStates().
void klee::MergeHandler::addClosedState | ( | ExecutionState * | es, |
llvm::Instruction * | mp | ||
) |
Called when a state runs into a 'klee_close_merge()' call.
Definition at line 81 of file MergeHandler.cpp.
References closedMean, closedStateCount, executor, getInstructionDistance(), klee::MergingSearcher::inCloseMerge, klee::Executor::mergingSearcher, klee::MergingSearcher::pauseState(), reachedCloseMerge, removeOpenState(), and klee::Executor::terminateStateEarly().
void klee::MergeHandler::addOpenState | ( | ExecutionState * | es | ) |
Add state to the 'openStates' vector.
Definition at line 70 of file MergeHandler.cpp.
References openStates.
Referenced by MergeHandler().
|
private |
Get distance of state from the openInstruction.
Definition at line 52 of file MergeHandler.cpp.
References openInstruction, and klee::ExecutionState::steppedInstructions.
Referenced by addClosedState(), and getPrioritizeState().
double klee::MergeHandler::getMean | ( | ) |
Definition at line 45 of file MergeHandler.cpp.
References closedMean, and closedStateCount.
Referenced by getPrioritizeState().
ExecutionState * klee::MergeHandler::getPrioritizeState | ( | ) |
Return state that should be prioritized to complete this merge.
Definition at line 56 of file MergeHandler.cpp.
References executor, getInstructionDistance(), getMean(), klee::MergingSearcher::inCloseMerge, klee::Executor::mergingSearcher, and openStates.
bool klee::MergeHandler::hasMergedStates | ( | ) |
True, if any states have run into 'klee_close_merge()' and have not been released yet.
Definition at line 132 of file MergeHandler.cpp.
References reachedCloseMerge.
void klee::MergeHandler::releaseStates | ( | ) |
Immediately release the merged states that have run into a 'klee_merge_close()'.
Definition at line 122 of file MergeHandler.cpp.
References klee::MergingSearcher::continueState(), executor, klee::MergingSearcher::inCloseMerge, klee::Executor::mergingSearcher, and reachedCloseMerge.
Referenced by ~MergeHandler().
void klee::MergeHandler::removeOpenState | ( | ExecutionState * | es | ) |
Remove state from the 'openStates' vector.
Definition at line 74 of file MergeHandler.cpp.
References openStates.
Referenced by addClosedState().
class ReferenceCounter klee::MergeHandler::_refCount |
Required by klee::ref-managed objects.
Definition at line 150 of file MergeHandler.h.
|
private |
The average number of instructions between the open and close merge of each state that has finished so far.
Definition at line 105 of file MergeHandler.h.
Referenced by addClosedState(), and getMean().
|
private |
Number of states that are tracked by this MergeHandler, that ran into a relevant klee_close_merge.
Definition at line 109 of file MergeHandler.h.
Referenced by addClosedState(), and getMean().
|
private |
Definition at line 98 of file MergeHandler.h.
Referenced by addClosedState(), getPrioritizeState(), MergeHandler(), releaseStates(), and ~MergeHandler().
|
private |
The instruction count when the state ran into the klee_open_merge.
Definition at line 101 of file MergeHandler.h.
Referenced by getInstructionDistance().
|
private |
States that ran through the klee_open_merge, but not yet into a corresponding klee_close_merge.
Definition at line 116 of file MergeHandler.h.
Referenced by addOpenState(), getPrioritizeState(), and removeOpenState().
|
private |
Mapping the different 'klee_close_merge' calls to the states that ran into them.
Definition at line 121 of file MergeHandler.h.
Referenced by addClosedState(), hasMergedStates(), and releaseStates().