klee
klee::MergeHandler Class Reference

Represents one klee_open_merge() call. Handles merging of states that branched from it. More...

#include <MergeHandler.h>

Collaboration diagram for klee::MergeHandler:

Public Member Functions

void addClosedState (ExecutionState *es, llvm::Instruction *mp)
 Called when a state runs into a 'klee_close_merge()' call. More...
 
ExecutionStategetPrioritizeState ()
 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

Executorexecutor
 
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...
 

Detailed Description

Represents one klee_open_merge() call. Handles merging of states that branched from it.

Definition at line 96 of file MergeHandler.h.

Constructor & Destructor Documentation

◆ MergeHandler()

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.

Here is the call graph for this function:

◆ ~MergeHandler()

klee::MergeHandler::~MergeHandler ( )

Definition at line 143 of file MergeHandler.cpp.

References executor, klee::MergingSearcher::mergeGroups, klee::Executor::mergingSearcher, and releaseStates().

Here is the call graph for this function:

Member Function Documentation

◆ addClosedState()

void klee::MergeHandler::addClosedState ( ExecutionState es,
llvm::Instruction *  mp 
)

◆ addOpenState()

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().

Here is the caller graph for this function:

◆ getInstructionDistance()

unsigned klee::MergeHandler::getInstructionDistance ( ExecutionState es)
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().

Here is the caller graph for this function:

◆ getMean()

double klee::MergeHandler::getMean ( )

Definition at line 45 of file MergeHandler.cpp.

References closedMean, and closedStateCount.

Referenced by getPrioritizeState().

Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:

◆ hasMergedStates()

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.

◆ releaseStates()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeOpenState()

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().

Here is the caller graph for this function:

Member Data Documentation

◆ _refCount

class ReferenceCounter klee::MergeHandler::_refCount

Required by klee::ref-managed objects.

Definition at line 150 of file MergeHandler.h.

◆ closedMean

double klee::MergeHandler::closedMean
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().

◆ closedStateCount

unsigned klee::MergeHandler::closedStateCount
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().

◆ executor

Executor* klee::MergeHandler::executor
private

◆ openInstruction

uint64_t klee::MergeHandler::openInstruction
private

The instruction count when the state ran into the klee_open_merge.

Definition at line 101 of file MergeHandler.h.

Referenced by getInstructionDistance().

◆ openStates

std::vector<ExecutionState *> klee::MergeHandler::openStates
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().

◆ reachedCloseMerge

std::map<llvm::Instruction *, std::vector<ExecutionState *> > klee::MergeHandler::reachedCloseMerge
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().


The documentation for this class was generated from the following files: