klee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExternalDispatcher.h
Go to the documentation of this file.
1 //===-- ExternalDispatcher.h ------------------------------------*- C++ -*-===//
2 //
3 // The KLEE Symbolic Virtual Machine
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef KLEE_EXTERNALDISPATCHER_H
11 #define KLEE_EXTERNALDISPATCHER_H
12 
13 #include <map>
14 #include <string>
15 #include <stdint.h>
16 
17 namespace llvm {
18  class ExecutionEngine;
19  class Instruction;
20  class Function;
21  class FunctionType;
22  class Module;
23 }
24 
25 namespace klee {
27  private:
28  typedef std::map<const llvm::Instruction*,llvm::Function*> dispatchers_ty;
30  llvm::Module *dispatchModule;
31  llvm::ExecutionEngine *executionEngine;
32  std::map<std::string, void*> preboundFunctions;
33 
34  llvm::Function *createDispatcher(llvm::Function *f, llvm::Instruction *i);
35  bool runProtectedCall(llvm::Function *f, uint64_t *args);
36 
37  public:
40 
41  /* Call the given function using the parameter passing convention of
42  * ci with arguments in args[1], args[2], ... and writing the result
43  * into args[0].
44  */
45  bool executeCall(llvm::Function *function, llvm::Instruction *i, uint64_t *args);
46  void *resolveSymbol(const std::string &name);
47  };
48 }
49 
50 #endif
void * resolveSymbol(const std::string &name)
std::map< std::string, void * > preboundFunctions
std::map< const llvm::Instruction *, llvm::Function * > dispatchers_ty
llvm::ExecutionEngine * executionEngine
llvm::Function * createDispatcher(llvm::Function *f, llvm::Instruction *i)
bool runProtectedCall(llvm::Function *f, uint64_t *args)
bool executeCall(llvm::Function *function, llvm::Instruction *i, uint64_t *args)