klee
klee::SpecialFunctionHandler Class Reference

#include <SpecialFunctionHandler.h>

Collaboration diagram for klee::SpecialFunctionHandler:

Classes

class  const_iterator
 
struct  HandlerInfo
 

Public Types

typedef void(SpecialFunctionHandler::* Handler) (ExecutionState &state, KInstruction *target, std::vector< ref< Expr > > &arguments)
 
typedef std::map< const llvm::Function *, std::pair< Handler, bool > > handlers_ty
 

Public Member Functions

 SpecialFunctionHandler (Executor &_executor)
 
void prepare (std::vector< const char * > &preservedFunctions)
 
void bind ()
 
bool handle (ExecutionState &state, llvm::Function *f, KInstruction *target, std::vector< ref< Expr > > &arguments)
 
std::string readStringAtAddress (ExecutionState &state, ref< Expr > address)
 
 HANDLER (handleAbort)
 
 HANDLER (handleAssert)
 
 HANDLER (handleAssertFail)
 
 HANDLER (handleAssume)
 
 HANDLER (handleCalloc)
 
 HANDLER (handleCheckMemoryAccess)
 
 HANDLER (handleDefineFixedObject)
 
 HANDLER (handleDelete)
 
 HANDLER (handleDeleteArray)
 
 HANDLER (handleErrnoLocation)
 
 HANDLER (handleExit)
 
 HANDLER (handleFree)
 
 HANDLER (handleGetErrno)
 
 HANDLER (handleGetObjSize)
 
 HANDLER (handleGetValue)
 
 HANDLER (handleIsSymbolic)
 
 HANDLER (handleMakeSymbolic)
 
 HANDLER (handleMalloc)
 
 HANDLER (handleMemalign)
 
 HANDLER (handleMarkGlobal)
 
 HANDLER (handleOpenMerge)
 
 HANDLER (handleCloseMerge)
 
 HANDLER (handleNew)
 
 HANDLER (handleNewArray)
 
 HANDLER (handlePreferCex)
 
 HANDLER (handlePosixPreferCex)
 
 HANDLER (handlePrintExpr)
 
 HANDLER (handlePrintRange)
 
 HANDLER (handleRange)
 
 HANDLER (handleRealloc)
 
 HANDLER (handleReportError)
 
 HANDLER (handleRevirtObjects)
 
 HANDLER (handleSetForking)
 
 HANDLER (handleSilentExit)
 
 HANDLER (handleStackTrace)
 
 HANDLER (handleUnderConstrained)
 
 HANDLER (handleWarning)
 
 HANDLER (handleWarningOnce)
 
 HANDLER (handleAddOverflow)
 
 HANDLER (handleMulOverflow)
 
 HANDLER (handleSubOverflow)
 
 HANDLER (handleDivRemOverflow)
 

Static Public Member Functions

static const_iterator begin ()
 
static const_iterator end ()
 
static int size ()
 

Public Attributes

handlers_ty handlers
 
class Executorexecutor
 

Detailed Description

Definition at line 31 of file SpecialFunctionHandler.h.

Member Typedef Documentation

◆ Handler

typedef void(SpecialFunctionHandler::* klee::SpecialFunctionHandler::Handler) (ExecutionState &state, KInstruction *target, std::vector< ref< Expr > > &arguments)

Definition at line 33 of file SpecialFunctionHandler.h.

◆ handlers_ty

typedef std::map<const llvm::Function*, std::pair<Handler,bool> > klee::SpecialFunctionHandler::handlers_ty

Definition at line 38 of file SpecialFunctionHandler.h.

Constructor & Destructor Documentation

◆ SpecialFunctionHandler()

SpecialFunctionHandler::SpecialFunctionHandler ( Executor _executor)

Definition at line 178 of file SpecialFunctionHandler.cpp.

Member Function Documentation

◆ begin()

SpecialFunctionHandler::const_iterator SpecialFunctionHandler::begin ( )
static

Definition at line 153 of file SpecialFunctionHandler.cpp.

References handlerInfo.

◆ bind()

void SpecialFunctionHandler::bind ( )

◆ end()

SpecialFunctionHandler::const_iterator SpecialFunctionHandler::end ( )
static

Definition at line 157 of file SpecialFunctionHandler.cpp.

◆ handle()

bool SpecialFunctionHandler::handle ( ExecutionState state,
llvm::Function *  f,
KInstruction target,
std::vector< ref< Expr > > &  arguments 
)

Definition at line 219 of file SpecialFunctionHandler.cpp.

References executor, handlers, klee::KInstruction::inst, and klee::Executor::terminateStateOnExecError().

Referenced by klee::Executor::callExternalFunction().

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

◆ HANDLER() [1/42]

klee::SpecialFunctionHandler::HANDLER ( handleAbort  )

◆ HANDLER() [2/42]

klee::SpecialFunctionHandler::HANDLER ( handleAddOverflow  )

◆ HANDLER() [3/42]

klee::SpecialFunctionHandler::HANDLER ( handleAssert  )

◆ HANDLER() [4/42]

klee::SpecialFunctionHandler::HANDLER ( handleAssertFail  )

◆ HANDLER() [5/42]

klee::SpecialFunctionHandler::HANDLER ( handleAssume  )

◆ HANDLER() [6/42]

klee::SpecialFunctionHandler::HANDLER ( handleCalloc  )

◆ HANDLER() [7/42]

klee::SpecialFunctionHandler::HANDLER ( handleCheckMemoryAccess  )

◆ HANDLER() [8/42]

klee::SpecialFunctionHandler::HANDLER ( handleCloseMerge  )

◆ HANDLER() [9/42]

klee::SpecialFunctionHandler::HANDLER ( handleDefineFixedObject  )

◆ HANDLER() [10/42]

klee::SpecialFunctionHandler::HANDLER ( handleDelete  )

◆ HANDLER() [11/42]

klee::SpecialFunctionHandler::HANDLER ( handleDeleteArray  )

◆ HANDLER() [12/42]

klee::SpecialFunctionHandler::HANDLER ( handleDivRemOverflow  )

◆ HANDLER() [13/42]

klee::SpecialFunctionHandler::HANDLER ( handleErrnoLocation  )

◆ HANDLER() [14/42]

klee::SpecialFunctionHandler::HANDLER ( handleExit  )

◆ HANDLER() [15/42]

klee::SpecialFunctionHandler::HANDLER ( handleFree  )

◆ HANDLER() [16/42]

klee::SpecialFunctionHandler::HANDLER ( handleGetErrno  )

◆ HANDLER() [17/42]

klee::SpecialFunctionHandler::HANDLER ( handleGetObjSize  )

◆ HANDLER() [18/42]

klee::SpecialFunctionHandler::HANDLER ( handleGetValue  )

◆ HANDLER() [19/42]

klee::SpecialFunctionHandler::HANDLER ( handleIsSymbolic  )

◆ HANDLER() [20/42]

klee::SpecialFunctionHandler::HANDLER ( handleMakeSymbolic  )

◆ HANDLER() [21/42]

klee::SpecialFunctionHandler::HANDLER ( handleMalloc  )

◆ HANDLER() [22/42]

klee::SpecialFunctionHandler::HANDLER ( handleMarkGlobal  )

◆ HANDLER() [23/42]

klee::SpecialFunctionHandler::HANDLER ( handleMemalign  )

◆ HANDLER() [24/42]

klee::SpecialFunctionHandler::HANDLER ( handleMulOverflow  )

◆ HANDLER() [25/42]

klee::SpecialFunctionHandler::HANDLER ( handleNew  )

◆ HANDLER() [26/42]

klee::SpecialFunctionHandler::HANDLER ( handleNewArray  )

◆ HANDLER() [27/42]

klee::SpecialFunctionHandler::HANDLER ( handleOpenMerge  )

◆ HANDLER() [28/42]

klee::SpecialFunctionHandler::HANDLER ( handlePosixPreferCex  )

◆ HANDLER() [29/42]

klee::SpecialFunctionHandler::HANDLER ( handlePreferCex  )

◆ HANDLER() [30/42]

klee::SpecialFunctionHandler::HANDLER ( handlePrintExpr  )

◆ HANDLER() [31/42]

klee::SpecialFunctionHandler::HANDLER ( handlePrintRange  )

◆ HANDLER() [32/42]

klee::SpecialFunctionHandler::HANDLER ( handleRange  )

◆ HANDLER() [33/42]

klee::SpecialFunctionHandler::HANDLER ( handleRealloc  )

◆ HANDLER() [34/42]

klee::SpecialFunctionHandler::HANDLER ( handleReportError  )

◆ HANDLER() [35/42]

klee::SpecialFunctionHandler::HANDLER ( handleRevirtObjects  )

◆ HANDLER() [36/42]

klee::SpecialFunctionHandler::HANDLER ( handleSetForking  )

◆ HANDLER() [37/42]

klee::SpecialFunctionHandler::HANDLER ( handleSilentExit  )

◆ HANDLER() [38/42]

klee::SpecialFunctionHandler::HANDLER ( handleStackTrace  )

◆ HANDLER() [39/42]

klee::SpecialFunctionHandler::HANDLER ( handleSubOverflow  )

◆ HANDLER() [40/42]

klee::SpecialFunctionHandler::HANDLER ( handleUnderConstrained  )

◆ HANDLER() [41/42]

klee::SpecialFunctionHandler::HANDLER ( handleWarning  )

◆ HANDLER() [42/42]

klee::SpecialFunctionHandler::HANDLER ( handleWarningOnce  )

◆ prepare()

void SpecialFunctionHandler::prepare ( std::vector< const char * > &  preservedFunctions)

Perform any modifications on the LLVM module before it is prepared for execution. At the moment this involves deleting unused function bodies and marking intrinsics with appropriate flags for use in optimizations.

Parameters
preservedFunctionscontains all the function names which should be preserved during optimization

Definition at line 181 of file SpecialFunctionHandler.cpp.

References klee::SpecialFunctionHandler::HandlerInfo::doesNotReturn, klee::SpecialFunctionHandler::HandlerInfo::doNotOverride, executor, handlerInfo, klee::Executor::kmodule, klee::SpecialFunctionHandler::HandlerInfo::name, and size().

Referenced by klee::Executor::setModule().

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

◆ readStringAtAddress()

◆ size()

int SpecialFunctionHandler::size ( )
static

Definition at line 174 of file SpecialFunctionHandler.cpp.

References handlerInfo.

Referenced by klee::SpecialFunctionHandler::const_iterator::operator++(), and prepare().

Here is the caller graph for this function:

Member Data Documentation

◆ executor

class Executor& klee::SpecialFunctionHandler::executor

Definition at line 41 of file SpecialFunctionHandler.h.

Referenced by bind(), handle(), prepare(), and readStringAtAddress().

◆ handlers

handlers_ty klee::SpecialFunctionHandler::handlers

Definition at line 40 of file SpecialFunctionHandler.h.

Referenced by bind(), and handle().


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